Skip to content

moe(w4a16): preserve preplanned tile geometry across launch op#1

Open
voipmonitor wants to merge 1 commit into
MadeBy561:nf3-hybridfrom
voipmonitor:codex/nf3-preserve-preplanned-tiles-20260714
Open

moe(w4a16): preserve preplanned tile geometry across launch op#1
voipmonitor wants to merge 1 commit into
MadeBy561:nf3-hybridfrom
voipmonitor:codex/nf3-preserve-preplanned-tiles-20260714

Conversation

@voipmonitor

Copy link
Copy Markdown

Problem

compile_w4a16_fused_moe(..., force_tile_config=...) correctly builds a pinned launch, but run_w4a16_moe crosses the torch.library custom-op boundary and _w4a16_fused_moe_launch_flat recompiles without the selected tile geometry. The lookup therefore silently resolves auto tiles. NF3 packs are tile-N specific, so the GLM-5.2 TP4 hybrid path packed FC1 for tile-N 256 while the custom op ran the auto tile-N 128 kernel, producing garbled output.

The production-shape reproducer measured relative error 1.29 with the pinned (64,256,64,256) launch before this fix. Small auto-tile tests did not expose it.

Fix

Thread the four selected FC1/FC2 tile dimensions through both normal and calibrated launch custom ops, then re-pin those exact values at the internal compile/cache lookup. This preserves the preplanned launch contract without disabling direct-topk TC decode or duplicating weights.

Validation

  • New GLM-5.2 TP4 production-shape NF3 test: H=6144, I/rank=512, m=8 launch replayed at m=1, pinned tiles, top-k=8, and -1 cross-tier routes.
  • test_w4a16_moe_launch_ops_have_fake_dispatch passes with the extended schemas.
  • NF3 numerical suite plus preplanned TC-decode suite: 11 passed.
  • Full madeby561/GLM-5.2-MXFP8-NVFP4-NF3-Hybrid TP4 E2E with the native vLLM loader: short and 30k-context generation are coherent; the same image without this patch is garbled from token 1.

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.

1 participant