Skip to content

fix(megatron): specialize grouped linear for Iluvatar - #163

Draft
lukatao wants to merge 1 commit into
flagos-ai:mainfrom
lukatao:kernelgen/iluvatar-grouped-linear
Draft

lukatao wants to merge 1 commit into
flagos-ai:mainfrom
lukatao:kernelgen/iluvatar-grouped-linear

Conversation

@lukatao

@lukatao lukatao commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a BI-V150 Triton specialization of grouped_linear. Its FP16 and BF16 biased epilogue rounds the matmul result to the output dtype before adding bias, matching the Iluvatar Torch reference. The kernel also specializes tile size and full-width K loads.

Validation

  • BI-V150, CoreX 4.5.0, PyTorch 2.10.0 and Triton 3.6.0.
  • KernelGen produced a candidate that passed all 57 correctness/benchmark workloads. Independent retest through FlagTrain's normal backend dispatch passed all 33 correctness cases, up from 23/33 on the generic implementation.
  • All 24 benchmark workloads matched the H800 native data with positive Optest scaling factors. The geometric mean of normalized speedups was 8.34×.
GEMS_VENDOR=iluvatar pytest -q tests/megatron/test_grouped_linear.py
GEMS_VENDOR=iluvatar pytest -q -s benchmark/megatron/test_grouped_linear.py \
  --mode kernel --base-data "$H800_JSON" --warmup 3 --iter 12

Signed-off-by: taooo <gumptao2997@gmail.com>
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