[rl][spmd_types] DTensor state dict adapter for vLLM HF weights - #4236
Merged
Conversation
[ghstack-poisoned]
tianyu-l
approved these changes
Aug 20, 2026
Comment on lines
+562
to
+584
| # FusedSwiGLU exposes split w1/w3 state-dict keys while the | ||
| # layout is declared on the fused w13 parameter. | ||
| w13_layout = sharding_config.state_shardings.get("w13") | ||
| if w13_layout is not None: | ||
| for proj_name in ("w1", "w3"): | ||
| layouts[f"{module_prefix}{proj_name}.weight"] = w13_layout | ||
|
|
||
| if isinstance(module, FusedQKVLinear): | ||
| # FusedQKVLinear exposes split wq/wk/wv state-dict keys while | ||
| # the layout is declared on the fused wqkv parameter. | ||
| wqkv_sharding_config = getattr( | ||
| module.wqkv, | ||
| "_sharding_config", | ||
| None, | ||
| ) | ||
| if wqkv_sharding_config is None: | ||
| continue | ||
| for ( | ||
| state_name, | ||
| layout, | ||
| ) in wqkv_sharding_config.state_shardings.items(): | ||
| for proj_name in ("wq", "wk", "wv"): | ||
| layouts[f"{module_prefix}{proj_name}.{state_name}"] = layout |
Contributor
There was a problem hiding this comment.
pls add a TODO to improve, ideally we should remove these specialized glue code
[ghstack-poisoned]
pianpwk
marked this pull request as ready for review
August 20, 2026 17:00
acisseJZhong
pushed a commit
that referenced
this pull request
Aug 21, 2026
Convert plain local state tensors to DTensors for SPMD-aware HF loading and restore plain tensors before vLLM load. (cherry picked from commit 9085e29)
5 tasks
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):