[MetaXGPU] apply cuda tests to maca, mark with xfail if failed#40
Conversation
There was a problem hiding this comment.
Code Review
This pull request transitions various GPU-related tests and support modules from CUDA/NVIDIA configurations to MACA (Meta Accelerator Card Architecture), renaming targets, devices, and imports, and marking unsupported features as expected failures. The code review feedback correctly identifies several remaining NVIDIA-specific configurations in the migrated tests, such as the use of tvm.support.nvcc.get_target_compute_version() instead of the MACA-equivalent mxcc helper, and the inclusion of the CUDA-specific "arch" attribute in target configurations, which should be removed or replaced with "mcpu" for "maca" targets.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ) | ||
| def test_inject_ptx_intrin(): | ||
| f = vector_add | ||
| arch = tvm.support.nvcc.get_target_compute_version() |
There was a problem hiding this comment.
Since this test is skipped if not env.has_maca(), when it runs, it will execute on a MACA device. However, tvm.support.nvcc.get_target_compute_version() is NVIDIA-specific and will fail or return incorrect results on a MACA device.
Please update this to use tvm.support.mxcc.get_target_compute_version() instead.
| arch = tvm.support.nvcc.get_target_compute_version() | |
| from tvm.support import mxcc | |
| arch = mxcc.get_target_compute_version() |
| kind="cuda", | ||
| mod=mod, | ||
| target=Target({"kind": "cuda", "arch": "sm_70"}), | ||
| target=Target({"kind": "maca", "arch": "sm_70"}), |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_70") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu" (e.g., "xcore700"), and passing "arch" will likely result in target creation errors or be ignored.
Since the specific architecture is not strictly required for this test, please remove "arch": "sm_70" from the target configuration, similar to the changes made in test_transform_realize_vdevice.py and test_tvmscript_parser.py.
| target=Target({"kind": "maca", "arch": "sm_70"}), | |
| target=Target({"kind": "maca"}), |
| kind="cuda", | ||
| mod=mod, | ||
| target=tvm.target.Target({"kind": "cuda", "arch": "sm_70"}), | ||
| target=tvm.target.Target({"kind": "maca", "arch": "sm_70"}), |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_70") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_70" from the target configuration here and in other occurrences within this file.
| target=tvm.target.Target({"kind": "maca", "arch": "sm_70"}), | |
| target=tvm.target.Target({"kind": "maca"}), |
| config = {"mbar": Var("mbar", "handle"), "remote_cta_id": IntImm("int32", 1)} | ||
| op_call = CopyAsync(BufferRegion(dst_buf, ranges), BufferRegion(src_buf, ranges), config=config) | ||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_90a"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90a"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_90a") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_90a" from the target configuration here and in other occurrences within this file.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90a"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
| op_call = CopyAsync(dst_br, src_br, config=config) | ||
|
|
||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_90a"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90a"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_90a") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_90a" from the target configuration.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90a"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
| # when no GPU is detected, which nvcc 13+ rejects. Codegen happens before | ||
| # nvcc; if the whole tvm.compile pipeline fails, we never see the source. | ||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_90"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_90") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_90" from the target configuration.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_90"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
| """Full pipeline (UnrollLoop + CUDA codegen) emits one mma per (Mt, Nt, Kt) | ||
| tile; K-tiles accumulate in place, so D is cleared once per output tile.""" | ||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_80"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_80"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_80") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_80" from the target configuration.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_80"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
| Tx.copy(A[tx], ra) | ||
|
|
||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_100a"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_100a") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_100a" from the target configuration here and in other occurrences within this file.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
| Tx.copy(D[tx], rd) | ||
|
|
||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_100a"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_100a") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_100a" from the target configuration.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
|
|
||
| # Use sm_100a target for packed add sum dispatch | ||
| target = tvm.target.Target({"kind": "cuda", "arch": "sm_100a"}) | ||
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) |
There was a problem hiding this comment.
The "arch" attribute (e.g., "sm_100a") is specific to the "cuda" target kind. For the "maca" target kind, the appropriate attribute is "mcpu", and passing "arch" will likely result in target creation errors or be ignored.
Please remove "arch": "sm_100a" from the target configuration.
| target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"}) | |
| target = tvm.target.Target({"kind": "maca"}) |
039d9e1 to
678c078
Compare
678c078 to
e93b7da
Compare
No description provided.