Skip to content

Provide a MACA fallback for the sparse tensorcore example#38

Open
VitalyAnkh wants to merge 3 commits into
tile-ai:devfrom
VitalyAnkh:vitaly/sparse-tensorcore-maca-fallback
Open

Provide a MACA fallback for the sparse tensorcore example#38
VitalyAnkh wants to merge 3 commits into
tile-ai:devfrom
VitalyAnkh:vitaly/sparse-tensorcore-maca-fallback

Conversation

@VitalyAnkh

@VitalyAnkh VitalyAnkh commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #32.

Review note

This PR is now self-contained. It only touches examples/maca/sparse_tensorcore/*.

Problem

The sparse tensorcore example does not currently have a true sparse MMA execution path on C500/MACA. The platform limitation is real, so the example needs a MACA-safe implementation rather than a forced backend adaptation.

What this PR changes

  • keeps the sparse example flow for supported targets unchanged
  • switches the MACA path to an equivalent dense TileLang GEMM implemented directly in the example
  • updates the example-level test so the MACA path is exercised and verified explicitly

Solution

The PR does not pretend that MACA supports the missing sparse MMA primitive. Instead, it rewrites only the example's MACA path in terms of DSL features that C500 actually supports, using an equivalent dense TileLang GEMM for correctness and coverage.

Alternatives considered

One alternative was to leave the example xfailed until sparse MMA support appears in the underlying stack. That would have kept the limitation visible, but it would not have provided a workable MACA path. Another option was to widen backend support and sparse preprocessing despite the missing hardware capability, but that would have obscured the real constraint and made the change harder to review.

Verification

  • python -m pytest -q examples/maca/sparse_tensorcore/test_example_sparse_tensorcore.py

@VitalyAnkh VitalyAnkh changed the title [MetaxGPU][Examples] Fallback sparse tensorcore on MACA Provide a MACA fallback for the sparse tensorcore example Apr 9, 2026
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@VitalyAnkh VitalyAnkh force-pushed the vitaly/sparse-tensorcore-maca-fallback branch from d1380bc to a3c47c2 Compare April 9, 2026 20:19
@VitalyAnkh VitalyAnkh force-pushed the vitaly/sparse-tensorcore-maca-fallback branch from a3c47c2 to 85d5851 Compare April 12, 2026 20:25
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.

Sparse tensorcore example has no executable sparse MMA path on MACA

1 participant