Skip to content

Adjust resource-sensitive MACA examples for contiguous inputs and smaller launch configurations#35

Open
VitalyAnkh wants to merge 3 commits into
tile-ai:devfrom
VitalyAnkh:vitaly/maca-resource-portability
Open

Adjust resource-sensitive MACA examples for contiguous inputs and smaller launch configurations#35
VitalyAnkh wants to merge 3 commits into
tile-ai:devfrom
VitalyAnkh:vitaly/maca-resource-portability

Conversation

@VitalyAnkh

@VitalyAnkh VitalyAnkh commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #29.

Review note

This branch now carries only the shared MACA backend prerequisite from #33 plus the resource-portability changes below. It no longer includes the low-precision example work from #34.

Problem

A separate group of MACA failures is caused by resource assumptions at the example layer. The algorithms are sound, but some examples pass non-contiguous inputs into TileLang kernels or use launch settings that exceed practical MACA limits.

What this PR changes

  • materialises contiguous inputs before launching the affected kernels
  • reduces launch shapes and related tuning parameters for MACA in the resource-bound examples
  • broadens the optional-import fallback in the GDN examples so the intended TileLang path remains reachable
  • removes or reduces CUDA-oriented shared-memory layout assumptions where MACA has tighter limits

Solution

The fix is to make the examples portable with respect to layout and resource usage. By ensuring contiguity and choosing MACA-safe launch parameters, the same kernels can execute correctly without inflating the example logic with hidden assumptions about a larger CUDA/Hopper resource budget.

Alternatives considered

One alternative was to leave the examples unchanged and attempt to compensate in backend scheduling. That would have obscured the true issue, namely that these examples had been tuned for a larger CUDA/Hopper resource budget. Another option was to skip the offending cases on MACA, but that would have left straightforward portability work unresolved.

Verification

  • python -m pytest -q examples/maca/attention_sink/test_example_attention_sink.py::test_example_gqa_sink_varlen examples/maca/convolution/test_example_convolution.py::test_example_convolution examples/maca/deepseek_mla/test_example_mla_decode.py::test_example_mla_decode examples/maca/flash_attention/test_example_flash_attention.py::test_example_gqa_bwd_tma_reduce_varlen examples/maca/gdn/test_example_gdn_compilation.py

@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 changed the title [MetaxGPU][Examples] Tune resource-bound MACA examples Adjust resource-sensitive MACA examples for contiguous inputs and smaller launch configurations Apr 9, 2026
@VitalyAnkh VitalyAnkh force-pushed the vitaly/maca-resource-portability branch from 7af1244 to 0143a59 Compare April 9, 2026 20:19
@VitalyAnkh VitalyAnkh force-pushed the vitaly/maca-resource-portability branch from 0143a59 to b72cfe6 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.

Several MACA examples exceed platform resource limits or require contiguous inputs

1 participant