Skip to content

[MetaXGPU] apply cuda tests to maca, mark with xfail if failed#40

Merged
Five-HZ merged 3 commits into
MetaX-MACA:devfrom
JoieAli:mcTVM_apply_cuda_cases
Jul 13, 2026
Merged

[MetaXGPU] apply cuda tests to maca, mark with xfail if failed#40
Five-HZ merged 3 commits into
MetaX-MACA:devfrom
JoieAli:mcTVM_apply_cuda_cases

Conversation

@JoieAli

@JoieAli JoieAli commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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"}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
target = tvm.target.Target({"kind": "maca", "arch": "sm_100a"})
target = tvm.target.Target({"kind": "maca"})

@JoieAli
JoieAli force-pushed the mcTVM_apply_cuda_cases branch from 039d9e1 to 678c078 Compare July 10, 2026 03:54
@JoieAli
JoieAli force-pushed the mcTVM_apply_cuda_cases branch from 678c078 to e93b7da Compare July 10, 2026 05:55

@Five-HZ Five-HZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Five-HZ
Five-HZ merged commit 726b6cf into MetaX-MACA:dev Jul 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants