Skip to content

Amoradzadeh/cp implicit filter#15199

Closed
moradza wants to merge 11 commits intoNVIDIA-NeMo:mainfrom
moradza:amoradzadeh/cp_implicit_filter
Closed

Amoradzadeh/cp implicit filter#15199
moradza wants to merge 11 commits intoNVIDIA-NeMo:mainfrom
moradza:amoradzadeh/cp_implicit_filter

Conversation

@moradza
Copy link
Copy Markdown
Contributor

@moradza moradza commented Dec 16, 2025

Important

The Update branch button must only be pressed in very rare occassions.
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 ?

Reduce memory consumption of mixer kernels in context parallel setup.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

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
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

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

  • Related to # (issue)

moradza and others added 7 commits December 16, 2025 13:10
Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: moradza <moradza@users.noreply.github.com>
Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: moradza <moradza@users.noreply.github.com>
"""Compute the log poles for the implicit modal filter."""
logp = -torch.exp(self.p.to(torch.float32))
glogp = logp * torch.exp(self.gamma.to(torch.float32))
if context_parallel_group is not None:
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.

should this be and context_parallel_group.size() > 1:?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see your point, if _hyena_use_cp set to False, this can be None. Slightly confusing code, b/c it sets cp_group to None.

Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
jstjohn added a commit to NVIDIA/bionemo-framework that referenced this pull request Dec 16, 2025
Co-authored-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: John St John <jstjohn@nvidia.com>
jstjohn
jstjohn previously approved these changes Dec 17, 2025
moradza and others added 2 commits December 17, 2025 11:06
Signed-off-by: amoradzadeh <amoradzadeh@nvidia.com>
Signed-off-by: moradza <moradza@users.noreply.github.com>
@moradza
Copy link
Copy Markdown
Contributor Author

moradza commented Dec 17, 2025

@jstjohn You can test locally CP == 1 and CP == 2 with this command.
torchrun --nproc_per_node=2 tests/collections/llm/gpt/model/test_hyena_mixer_cp.py --operator_type hyena [--use_subquadratic_ops]

@jstjohn jstjohn enabled auto-merge (squash) December 17, 2025 21:39
@pzelasko
Copy link
Copy Markdown
Collaborator

Closing this PR as "won't merge".
The following collections have been moved to separate repos in https://github.com/NVIDIA-NeMo organization: avlm, llm, multimodal, multimodal-autoregressive, vlm, speechlm, diffusion.
If you still wish to proceed with this contribution, please re-open it in the relevant repo.

@pzelasko pzelasko closed this Mar 16, 2026
auto-merge was automatically disabled March 16, 2026 16:50

Pull request was closed

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.

3 participants