Skip to content

S25-B: MXFP4 routed-expert RTN requantization (N8.5) - #270

Draft
michaellchung wants to merge 1 commit into
s25-n7-trainerfrom
s25-n85-mxfp4
Draft

michaellchung wants to merge 1 commit into
s25-n7-trainerfrom
s25-n85-mxfp4

Conversation

@michaellchung

Copy link
Copy Markdown
Contributor
  • yeto/rl/quant/mxfp4.py: g32, E8M0 shared scale, E2M1 RTN, only routed experts; QuantScheme selected from the template quantization_config.format.
  • Layer 10 (296 expert modules) bit-identical to HF yetalabs/apex-flash-1-mxfp4-experts@70e86a0 from the BF16 source.

Testing: Full remote test suite on the stack tip: 0 failures. Not validated on PPU/NPU hardware (machines busy).

Part of the S25 stack (NPU+PPU heterogeneous GLM5.3-Flash full-param RL). Draft; do not merge before the S24 stack (#262–#268).

🤖 Generated with Claude Code

New yeto/rl/quant/mxfp4.py implements the compressed-tensors
mxfp4-pack-quantized rules: E8M0 shared scale per 32 inputs (BF16 amax
rounded to a power of two at mantissa 1.75, minus 2), FP4 E2M1 ties to
even with saturation at 6, sign bit for w < 0, even column in the low
nibble.

requant.py now selects a QuantScheme from the template's
quantization_config.format: w4a8-int4-channel (int-quantized, unchanged
behaviour) or mxfp4-g32-rtn (weight_packed + weight_scale, refuses AWQ
smoothing). compare_checkpoints reports FP4 and E8M0 code match shares.
The release CLI takes its scheme tag from the template.

Checked on CPU against yetalabs/apex-flash-1-mxfp4-experts@70e86a0:
layer-10 routed experts (296 modules) equal in every FP4 and E8M0 code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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