Skip to content

Cosmos3-edge PR 1: dense tensor-parallel MLP (ParallelMLP) and relu2 activation - #292

Open
merceod wants to merge 4 commits into
mainfrom
engine/dense-parallel-mlp
Open

merceod wants to merge 4 commits into
mainfrom
engine/dense-parallel-mlp

Conversation

@merceod

@merceod merceod commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Small shared component for the dense (ungated) FFN used by the Nemotron family.

  • ParallelMLP = down_proj(act(up_proj(x))), with up_proj column-parallel and down_proj row-parallel. Parameter names follow the dense-LLM checkpoint convention so a Nemotron-style FFN loads by name.
  • _resolve_activation now knows relu2 / relu_squared.
  • Exported next to ParallelGatedMLPUnfused.

First user is the Cosmos3-Edge integration (#297), whose DiT and reasoner share a dense Nemotron backbone with hidden_act=relu2. Nemotron-H based models can reuse it.

Tests in test/modular/test_parallel_mlp.py (CPU) cover relu2 semantics, state_dict names and shapes, and parity with an nn.functional reference for relu2 and gelu+bias. ruff and test/modular pass.

@merceod
merceod force-pushed the engine/dense-parallel-mlp branch from 4ab7255 to 8649b5a Compare September 23, 2026 23:14

@NSagan271 NSagan271 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants