Repository navigation
[rl] Fix the RL load weights bug: fused qkv load hooks are bypassed - #3794
Merged
Merged
Conversation
felipemello1
approved these changes
Jun 25, 2026
tianyu-l
approved these changes
Jun 25, 2026
| # state_dict() returns hook-produced copies for fused modules (e.g. | ||
| # FusedQKVLinear's wqkv -> wq/wk/wv), so the in-place fill above never | ||
| # reaches the real param. Re-apply via load_state_dict to run the merge hook. | ||
| self._get_model().model.load_state_dict(model_sd, strict=False) |
Contributor
There was a problem hiding this comment.
stamping to unblock, but ideally we should avoid extra GPU copies of entire model because of the state_dict hooks.
Add a TODO / issue and follow up with @meetv18
I'm a bit worried about if it makes 235B single-node inference impossible.
Contributor
Author
There was a problem hiding this comment.
Yes this copy is full model weights now, not only fused qkv (maybe I could reduce the amount of copy for just "wqkv")
Let me add this change to 235B singlenode inference test,
felipemello1
pushed a commit
to felipemello1/torchtitan
that referenced
this pull request
Jun 26, 2026
…-qkv workaround - trainer.py -> controller.py; batcher.py -> components/batcher.py; components/metrics_utils.py -> controller_metrics.py; update all imports. - Drop _force_non_fused_qkv workaround (real fix pytorch#3794 arrives via the main re-merge). - Carry minor work_buffer / controller (_pad_id inline) cleanups.
felipemello1
pushed a commit
to felipemello1/torchtitan
that referenced
this pull request
Jun 26, 2026
…orch#3794 fuse-qkv fix) Reconcile our async-loop generator (min/max policy version) onto main's RequestDispatcher (pytorch#3765: routes to highest DP rank + result fan-in): - rank 0 stamps min_policy_version on every future in the STEP decision (it owns all futures regardless of which DP rank serves the request). - _build_completions sets min == max (finish version) as a placeholder; rank 0 replaces min with the true admitted version in _rank0_resolve_futures. - pytorch#3794 fused-qkv HF-load fix arrives via the merge; our workaround was removed.
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.
No description provided.