You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8a4ad5f
Browse filesBrowse the repository at this point in the historyBrowse files
perf(dsv41): FFN seam writes the shared expert's MXFP8 input, no quantize launch before shared_in
On a DeepSeek-V4.1 target layer whose routed MegaMoE call computes the
shared expert (AITER shared_in, #3894), the call still launched
quantize_fp8(x) on every fused decode step to make the shared expert's
MXFP8 input. x is the FFN seam's normed output, and the FFN seam's Mega-MHC
launch can already write that pair next to the BF16 rows
(mega_mhc(out_dtype="mxfp8"), what the attention seam uses for wqkv_a).
- mhc_pre_delayed: pre_delayed / v41_mhc_pre_delayed take ffn_pair. When
set, on the HIP backend with row-major scales and for rows up to AITER's
small-input ceiling (SMALL_M_MAX_MTPR, the only route that fuses the shared
expert), the seam asks mega_mhc for MXFP8 output and leaves (fp8, e8m0)
in a one-entry slot. Its return value is unchanged (BF16 only), so the op
signature and fake shapes stay as they are. Every other seam clears the
slot; take_ffn_pair(x) takes it and hands it out only for those very rows.
- Block: hc_ffn_pair is set where the FFN is a shared_in layer (draft layers
never are) and passed by prepare_ffn.
- flydsl_mega_experts: the shared_in input takes the seam's pair when there
is one; otherwise x is quantized lazily as before.
The pair is bit for bit quantize_fp8 of the BF16 norm (E4M3, one E8M0 ceil
scale per 32 columns), and the BF16 outputs are bit for bit the BF16-only
seam's. No new switch or environment variable.
Tests: tests/model_ops/test_mhc_pre_delayed_backend.py (when the seam writes
the pair, only for its own rows, cleared by other seams),
tests/test_mega_shared_in.py (the pair replaces the quantize launch).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments