ZeRO-1/2: add bounded quantized weight all-gather - #8511
adenzhou1350 wants to merge 3 commits into
Conversation
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb2383dadf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0debf7df7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
|
Addressed all four findings in Fresh-head validation: 28/28 focused tests pass, including six real DP2 cases; the same-condition, order-balanced DP4 Qwen run passes correctness/memory gates at 1.085x speedup. The PR body now has the updated results and their scope. |
Summary
Extend the existing
zero_quantized_weightsopt-in to ZeRO stages 1 and 2. After each optimizer step, weight partitions are quantized in bounded chunks, gathered, and dequantized one source rank at a time into the persistent flat buffer.Large weights use 64-element symmetric INT8 groups. Parameters with at most 65,536 elements use a bounded original-dtype side channel; they are masked before quantization and restored after gathering. The bucket limit applies across all data-parallel ranks, with a minimum of one quantization group per rank. Unsupported FP32 and ZenFlow combinations are rejected during optimizer initialization.
The patch also removes an unused
cuda_profiler_api.hinclude fromgemm_test.h; CUDA 13 no longer ships that header and the quantizer does not use the profiler API. The default ZeRO-1/2 path is unchanged.Validation (
f2c781d)atol=0.02, rtol=0.02violations.The DP4 run used PyTorch 2.11.0+cu130, CUDA 13.0, NCCL CTA8, a 26M reduce bucket and a 50M all-gather bucket. Both arms used the same exact source; only
zero_quantized_weightsdiffered.Scope and risks
This is lossy, opt-in synchronization. The short BF16 Qwen run is not a convergence study; its within-run interval does not establish cross-day or cross-machine robustness. FP16 has focused DP2 correctness coverage, not whole-model performance qualification. MoE, offload, other models/accelerators, NVLink/RDMA, and long-horizon convergence are not established. Small-parameter-heavy workloads may not benefit from the extra side-channel collectives.
Prepared and tested with Codex assistance.