Skip to content

Use flyc.compile for MOE kernel fast dispatch - #3607

Closed
xudoyuan wants to merge 1 commit into
mainfrom
moe_flyc_compile
Closed

xudoyuan wants to merge 1 commit into
mainfrom
moe_flyc_compile

Conversation

@xudoyuan

@xudoyuan xudoyuan commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Replace exe(*args) with flyc.compile-based caching: first call compiles and executes via flyc.compile(), subsequent calls use the cached CompiledFunction for ~5µs dispatch instead of full JitFunction overhead.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@xudoyuan
xudoyuan requested a review from a team June 8, 2026 09:40
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 3607 --add-label <label>

@xudoyuan
xudoyuan force-pushed the moe_flyc_compile branch from 4ad4677 to 301cabb Compare June 8, 2026 09:54
coderfeli
coderfeli previously approved these changes Jun 8, 2026
All FlyDSL kernel launchers were calling JitFunction.__call__ directly,
which rebuilds cache keys (sig.bind, DLPack metadata extraction,
dict lookup) on every invocation -- ~170-370 us/call overhead.

Switch to flyc.compile + CompiledFunction._cf caching so that after
the first call, subsequent invocations skip JitFunction overhead and
dispatch directly through the pre-built CallState (~15-25 us/call).

Affected kernels:
  - moe_kernels.py (MoE stage1/stage2)
  - flash_attn_func_gfx1201.py (Flash Attention gfx1201/RDNA4)
  - linear_attention_prefill_kernels.py (chunk_gated_delta_h K5)
  - qk_norm_rope_quant.py (QK norm + RoPE + quant fused)
  - fused_compress_attn.py (fused compress attention)
  - fused_compress_attn_hca.py (HCA compress + norm_rope_scatter)

Co-Authored-By: Claude Opus 4 <[email protected]>
@xudoyuan xudoyuan closed this Jun 17, 2026
@xudoyuan
xudoyuan deleted the moe_flyc_compile branch June 17, 2026 01:14
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