add support for hsdp and configurable nccl timeout#40
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces configurable NCCL timeouts and support for the Hybrid Sharded Data Parallel (HSDP) sharding strategy. It adds nccl_timeout_seconds and sharding_strategy to the distributed configuration and updates the FSDP application logic to handle HSDP mesh construction. Feedback includes a recommendation to retain the default heartbeat timeout in environment setup to prevent regressions in alternative initialization paths and a suggestion to use public DeviceMesh APIs instead of private internal methods for better maintainability.
MasterJH5574
approved these changes
May 16, 2026
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.
TLDR: HSDP replicates across DP ; other dimensions still shard.
Small models trained across many devices for shorter wall-clock time often fit comfortably within a fraction of the cluster, making full-mesh sharding with FSDP unnecessary and creating overhead that HSDP avoids by sharding within a smaller intra-replica group and replicating across the rest.
In fact, on Qwen3-30B-A3B at 8×8 H100 with PP=4, CP=1, EP=8, MBS=1, GBS=1024, switching from FSDP to HSDP raised steady-state throughput from ~293K to ~392K tokens/sec (a 1.34× speedup) at a ~5.6 GB increase in per-device peak memory (48.3 → 53.9 GB).
8n8g-h100/pp4-cp1-ep8-mbs1-gbs1024-seq4096-bf16_fsdp
8n8g-h100/pp4-cp1-ep8-mbs1-gbs1024-seq4096-bf16_hsdp