Skip to content

Make fused QKV projection the default implementation - #4546

Merged
anijain2305 merged 21 commits into
gh/anijain2305/13/basefrom
gh/anijain2305/13/head
Sep 13, 2026
Merged

anijain2305 merged 21 commits into
gh/anijain2305/13/basefrom
gh/anijain2305/13/head

Conversation

[ghstack-poisoned]
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 9, 2026
@anijain2305
anijain2305 marked this pull request as draft September 9, 2026 18:04
@anijain2305
anijain2305 marked this pull request as ready for review September 9, 2026 18:06
[ghstack-poisoned]
f"set_qkv_linear_sharding requires QKVLinear.Config or "
f"FusedQKVLinear.Config, got {type(qkv_linear_cfg).__name__}"
)
def set_fused_qkv_linear_sharding(qkv_linear_cfg: FusedQKVLinear.Config) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this function any more

Comment thread torchtitan/models/common/attention.py Outdated


class FusedQKVLinear(BaseQKVLinear):
class FusedQKVLinear(Module):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should call it QKVLinear to be consistent with FeedForward. After all, we don't have "unfused" version any more.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@wconstab

Copy link
Copy Markdown
Contributor

Would be nice to have some motivation (performance or memory improvements) in the PR desc.

@anijain2305

Copy link
Copy Markdown
Contributor Author

Would be nice to have some motivation (performance or memory improvements) in the PR desc.

Added.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Sep 12, 2026
[ghstack-poisoned]
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Sep 13, 2026
[ghstack-poisoned]
[ghstack-poisoned]
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Sep 13, 2026
[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/8gpu.
Currently recognized labels are

  • ciflow/b200
  • ciflow/h100.8
  • ciflow/rl

Please add the new label to .github/pytorch-probot.yml

[ghstack-poisoned]
anijain2305 added a commit that referenced this pull request Sep 13, 2026
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.18.0)
(oldest at bottom):
* #4543
* #4542
* #4541
* #4623
* #4559
* #4591
* #4592
* #4540
* #4539
* #4643
* #4526
* #4546
* __->__ #4535

Use one physical w13 Linear config and parameter for dense feed-forward
gate and up projections. Compose their initialization before module
construction, configure activation implementations directly, and
translate external gate/up checkpoint keys in model state-dict adapters.
[ghstack-poisoned]
@anijain2305
anijain2305 merged commit ad10e7c into gh/anijain2305/13/base Sep 13, 2026
16 checks passed
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants