Skip to content

Adding MoE, PEE, GGEMM then SALM, vLLM related changes - #16038

Open
tango4j wants to merge 29 commits into
mainfrom
moe_pee_ggemm
Open

Adding MoE, PEE, GGEMM then SALM, vLLM related changes#16038
tango4j wants to merge 29 commits into
mainfrom
moe_pee_ggemm

Conversation

@tango4j

@tango4j tango4j commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Important

The Update branch button must only be pressed in very rare occasions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do?

Adds grouped-GEMM Mixture-of-Experts (MoE) and Parallel Expert Encoder (PEE) support to ASR, and integrates PEE with SpeechLM2 SALM training and generation.

Collection: ASR, SpeechLM2

Changelog

  • Add GGEMMTransformerEncoder for packed execution of heterogeneous transformer experts, including grouped attention and feed-forward paths with serial reference implementations for correctness checks.
  • Add MoETransformerEncoder with dense and top-k expert routing plus activation-checkpointing support.
  • Add ParallelExpertEncoder, combining speech MoE, speaker Sortformer, and sound experts behind a Conformer-compatible interface.
  • Use memory-efficient per-expert execution during PEE training and packed grouped-GEMM execution during evaluation and inference.
  • Add long-form PEE inference with windowing, context handling, and streaming speaker-cache support.
  • Integrate PEE bundles into SALM through model.pe_encoder_path, including external speaker-target routing, speaker-target lengths through context-parallel/chunked batches, and generation-only online inference.
  • Update SALM vLLM audio handling for PEE-compatible speaker inputs and lengths.
  • Add focused MoE, GGEMM, PEE, SALM, encoder-chunking, and vLLM tests.

Usage

Configure a PEE bundle as the SALM perception encoder:

from omegaconf import OmegaConf

from nemo.collections.speechlm2.models import SALMAutomodel

cfg = OmegaConf.load("path/to/salm_config.yaml")
cfg.model.pe_encoder_path = "/path/to/parallel_expert_encoder.nemo"

model = SALMAutomodel(cfg.model)
model.configure_model()

PEE automatically uses its memory-efficient per-expert path while training and its packed GGEMM path during evaluation and inference.

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines (author to confirm)
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation? (API documentation and usage example included)
  • Does the PR affect components that are optional to install? No new optional dependencies are introduced.
    • Reviewer: Does the PR have correct import guards for all optional libraries? N/A

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Local validation: 249 tests passed and 55 tests were skipped as expected.
  • Formatting, import-order, Python compilation, and git diff --check validation passed.
  • Related to: N/A

Signed-off-by: Taejin Park <tango4j@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the ASR label Aug 6, 2026
Comment thread nemo/collections/asr/modules/ggemm_transformer_encoder.py Fixed
Comment thread nemo/collections/asr/modules/ggemm_transformer_encoder.py Fixed
Comment thread nemo/collections/asr/modules/tests/test_moe_transformer_encoder.py Fixed
Comment thread nemo/collections/asr/modules/tests/test_moe_transformer_encoder.py Fixed
Comment thread nemo/collections/asr/modules/tests/test_moe_transformer_encoder.py Fixed
Signed-off-by: Taejin Park <tango4j@gmail.com>
@tango4j
tango4j marked this pull request as ready for review August 6, 2026 07:46
Signed-off-by: Taejin Park <tango4j@gmail.com>
Comment thread nemo/collections/asr/parts/utils/sot_speaker_alignment.py Fixed
Comment thread tests/collections/asr/utils/test_sot_speaker_alignment.py Fixed
tango4j and others added 2 commits August 6, 2026 02:33
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
…ith 'import' and 'import from''

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
@tango4j

tango4j commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 025605c

@@ -0,0 +1,825 @@
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.

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.

This file should live in tests/collections/asr right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved.

Comment thread nemo/collections/asr/modules/ggemm_transformer_encoder.py
# per-encoder (see ParallelExpertEncoder.set_activation_checkpointing). Kept as a
# flag rather than a checkpoint_wrapper around each layer so module structure and
# state_dict keys stay identical to a checkpoint saved without it.
self.activation_checkpointing = False

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.

Is this change necessary? Our training worked so far with AC and without this workaround.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

All the changes in Transformer Encoder are removed. Transformer encoder file is untouched.

@tango4j
tango4j requested a review from ipmedenn August 6, 2026 23:53
Comment thread nemo/collections/asr/modules/transformer_encoder.py Outdated
tango4j added 3 commits August 6, 2026 20:23
…mport

Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
@tango4j

tango4j commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test dab3466

tango4j and others added 7 commits August 11, 2026 08:56
…ith 'import' and 'import from''

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
…mport

Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
@pzelasko

Copy link
Copy Markdown
Collaborator

/ok to test 23028a3

pzelasko
pzelasko previously approved these changes Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

[🤖]: Hi @tango4j 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: Taejin Park <tango4j@gmail.com>
Comment thread tests/collections/asr/test_parallel_expert_encoder.py Fixed
Signed-off-by: Taejin Park <tango4j@gmail.com>
@tango4j

tango4j commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test aa368b3

@github-actions

Copy link
Copy Markdown
Contributor

[🤖]: Hi @tango4j 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants