Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196576
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit 7ea6b1c with merge base 3d6eb40 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
anshul-si
added a commit
that referenced
this pull request
Sep 10, 2026
Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 10, 2026
anshul-si
added a commit
that referenced
this pull request
Sep 10, 2026
Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 10, 2026
anshul-si
added a commit
that referenced
this pull request
Sep 11, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 11, 2026
anshul-si
added a commit
that referenced
this pull request
Sep 11, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 11, 2026
anshul-si
added a commit
that referenced
this pull request
Sep 11, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 16, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 16, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 [ghstack-poisoned]
anshul-si
added a commit
that referenced
this pull request
Sep 16, 2026
pytorchmergebot
pushed a commit
that referenced
this pull request
Oct 3, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: #196576 Pull Request resolved: #196626 Approved by: https://github.com/weifengpy
cyyever
pushed a commit
to BakeLab/pytorch
that referenced
this pull request
Oct 11, 2026
**Summary:** We want to enable per-param mixed precision policy in FSDP2 for several reasons including KDA, etc. **Key Points** All-gather: During all-gather, existing homogenous path remains unchanged. When parameters require different compute dtypes, FSDP groups staging copies by source/target dtype and invokes the existing uint8 communication buffer, keeping only one AG per fully_shard. As seen in benchmarking results below, there is a small perf difference in the copy-in which can be attributed to foreach_copy uses a fixed four elements per thread, so for uint8 vs bf16, we have twice as much element-level scheduling and instruction work to transfer the same number of bytes. Reduce-scatter: Parameters using different compute_dtypes inevitably results in gradients with different dtypes, but a reduce-scatter input buffer must have a single dtype. When all parameters share reduce_dtype, we want FSDP to preserve existing single-collective behavior. To support this efficiently, the existing _chunk_cat.out CUDA path was extended to read heterogeneous BF16/FP32 inputs and cast them directly into the reduction buffer while performing chunking and padding. Without this fused path, FSDP would need to materialize full-size tensors in the reduction dtype and then run the ordinary homogeneous packing kernel, adding another read/write pass and substantial temporary memory. The existing operator schema and homogeneous kernels remain intact. If parameters request genuinely different reduction dtypes, FSDP instead creates one bucket and one reduce-scatter per effective dtype. Benchmarking: We first isolated reduce-scatter packing on an H100 using a transformer-like workload containing 50.3 million elements and small FP32 islands. Fused mixed BF16/FP32-to-FP32 packing took 0.1888 ms, compared with 0.3582 ms for pre-casting into FP32 staging tensors followed by homogeneous packing, reducing packing latency by approximately 47% while avoiding roughly 192 MiB of temporary FP32 storage. We then measured all-gather using real FSDP parameter objects and a KDA-style layout containing FP32 decay parameters, normalization weights, and a router gate. Across grouped and approximately 500-parameter layouts, raw packing was approximately 8.7–8.8% slower, complete copy-in was approximately 2.4–2.5% slower, and copy-out was unchanged. Finally, we ran an eight-block, 1.75-billion-parameter KDA-style model through real FSDP2 forward and backward passes, including per-block unsharding, resharding, NCCL collectives, and gradient reduction. Across both benchmark orderings, total all-gather copy-in was 4.2–4.9% slower, copy-out varied from −0.6% to +0.3%, and synchronized forward-plus-backward time remained approximately 53 ms for both configurations, showing no measurable end-to-end regression. Pull-Request: pytorch#196576 Pull Request resolved: pytorch#196626 Approved by: https://github.com/weifengpy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):