Skip to content

feat(megatron): specialize fused DSA indexer loss for Ascend and MetaX - #161

Draft
lukatao wants to merge 1 commit into
flagos-ai:mainfrom
lukatao:kernelgen/ascend-metax-fused-dsa-indexer-loss
Draft

lukatao wants to merge 1 commit into
flagos-ai:mainfrom
lukatao:kernelgen/ascend-metax-fused-dsa-indexer-loss

Conversation

@lukatao

@lukatao lukatao commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Add Ascend and MetaX Triton implementations for Fused DSA Indexer Loss. Both use bounded key tiles for long contexts. MetaX uses torch.topk for the exact ordering of tied indices and Triton for score and loss computation.

Validation

Verified both implementations through the public FlagTrain dispatcher. The full correctness suites include the 65,537-token regression.

Backend Correctness H800 native matches Optest normalized geometric mean
Ascend 910B, CANN 9.2.1, Torch NPU 2.13.0, Triton 3.5.1 35/35 22/22 5.07×
MetaX C550, MACA 3.8.1.3, PyTorch 2.10.0+metax3.8.1.0, Triton 3.6.0 35/35 22/22 16.11×
GEMS_VENDOR="$VENDOR" pytest -q tests/megatron/test_fused_dsa_indexer_loss.py
GEMS_VENDOR="$VENDOR" pytest -q -s benchmark/megatron/test_fused_dsa_indexer_loss.py \
  --mode kernel --base-data "$H800_JSON" --warmup 3 --iter 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant