Skip to content

Make fused grouped-expert projection the default - #4552

Open
anijain2305 wants to merge 6 commits into
gh/anijain2305/15/basefrom
gh/anijain2305/15/head
Open

Make fused grouped-expert projection the default#4552
anijain2305 wants to merge 6 commits into
gh/anijain2305/15/basefrom
gh/anijain2305/15/head

Conversation

@anijain2305

@anijain2305 anijain2305 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

[ghstack-poisoned]
[ghstack-poisoned]
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Sep 9, 2026
[ghstack-poisoned]
Comment thread torchtitan/models/kimi_k3/moe.py Outdated
self.linear_beta = config.linear_beta

def forward(
def _activation(

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.

commented in the linear PR

class GroupedExperts(Module):
"""SwiGLU experts with one physical interleaved gate-up parameter.

``w13`` has shape ``(E, F, 2, D)`` and is flattened to ``(E, 2F, D)`` for

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.

return init


def _fuse_grouped_experts_param_init(param_init: dict | None) -> dict | 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.

can be put together with https://github.com/pytorch/torchtitan/blob/main/torchtitan/models/common/config_utils.py#L109

In some sense, this is not part of core torchtitan. Users can do whatever.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants