Skip to content

[CPU] Merge MoE ±bias tests via bias=[False, True] - #93

Closed
mingfeima wants to merge 3 commits into
mainfrom
cursor/merge-moe-bias-param-7180
Closed

mingfeima wants to merge 3 commits into
mainfrom
cursor/merge-moe-bias-param-7180

Conversation

@mingfeima

@mingfeima mingfeima commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up cleanup on top of the rcp14 SiLU work: simplify test/registered/cpu/test_moe.py by merging each *_moe / *_moe_bias pair into one parametrized test with bias=[False, True].

Changes

  • Add run_fused_experts / make_routing helpers (drops the long None arg lists)
  • Merge bf16 / fp8 / mxfp4 non-bias and bias cases
    • bias=False → silu path
    • bias=True → bias + clamped SwiGLU (alpha=1.702, limit=7.0)
  • File size: ~514 → ~389 lines

Note

This branch is based on pr_add_rcp14 (#31304). Prefer either:

  1. Cherry-pick the test-only commit onto [CPU] improve silu performance by replacing fp32 div with rcp14 sgl-project/sglang#31304, or
  2. Merge this PR after / instead of [CPU] improve silu performance by replacing fp32 div with rcp14 sgl-project/sglang#31304 if it already includes the kernel changes.

Checklist

  • Format / style consistent with existing CPU tests
  • CI CPU MoE suite green
Open in Web Open in Cursor 

CI States

Latest PR Test (Base): ❌ Run #29481466626
Latest PR Test (Extra): ❌ Run #29481466474

mingfeima and others added 2 commits July 16, 2026 15:15
- Add run_fused_experts / make_routing helpers to drop None arg walls
- Merge bf16/fp8/mxfp4 non-bias and bias tests into one parametrized case
- bias=True also covers clamped SwiGLU (alpha/limit); bias=False keeps silu

Co-authored-by: Ma Mingfei <[email protected]>
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.

2 participants