Skip to content

[weight checker] enable in all CIs + ULP-based quant error tolerance - #1336

Merged
Zhichenzzz merged 12 commits into
weight_update_refactorfrom
weight-check-ulp
Jun 24, 2026
Merged

Zhichenzzz merged 12 commits into
weight_update_refactorfrom
weight-check-ulp

Conversation

@yueming-yuan

@yueming-yuan yueming-yuan commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

ci-sglang-pr: #28082

Replaces #812. sglang-side PR: sgl-project/sglang#28082. Stacked on #1329.

Summary

  • Force-enable --check-weight-update-equal whenever --ci-test is set, so every future CI verifies weight sync between the training actor and SGLang engines after weight update. The now-redundant explicit flags in test_qwen3_4B_p2p.py and test_qwen3_30B_A3B/_common.py are removed.
  • Replace the manual-threshold design from [weight checker] add dequant_mean_err_threshold and enable weight checker in all Megatron CIs #812 with a boolean --check-weight-update-allow-quant-error, plumbed through train.py/train_async.py → rollout manager/server/group → engine → sglang /weights_checker.
  • On the sglang side ([sglang-miles] weight checker: ULP-based quant error tolerance via allow_quant_error sgl-project/sglang#28082), quantized weights are compared via their dequantized tensors; with the flag set, each element may differ by up to 1 ULP of the quantized dtype per side (e.g. fp8e4m3 spacing at that element's magnitude, scaled by the block scale). This is principled (each side is one faithful quantization of the same weight), per-element (a mean threshold lets corruption hide in large tensors), and needs no per-model tuning.
  • Quantized CI cases get the flag: qwen3-30B fp8/int4, glm5-4layer under MILES_TEST_USE_FP8_ROLLOUT, dsv32 fp8 + mxfp8, dsv4-flash (FP8 checkpoint). bf16 checkpoints keep exact-equality comparison.

Test plan

  • run-ci-megatron with weight checking enabled everywhere

🤖 Generated with Claude Code

…-based --check-weight-update-allow-quant-error

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new command-line argument --check-weight-update-allow-quant-error to allow quantized tensors to differ slightly when comparing weights after an update. This parameter is propagated through the rollout manager, rollout server, server group, and SGLang engine. Additionally, the --check-weight-update-equal flag is now automatically enabled when --ci-test is active, and various end-to-end tests have been updated to utilize the new quantization error tolerance argument. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Zhichenzzz Zhichenzzz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zhichenzzz
Zhichenzzz merged commit 80eba40 into weight_update_refactor Jun 24, 2026
29 checks passed
@Zhichenzzz
Zhichenzzz deleted the weight-check-ulp branch June 24, 2026 22:56
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