Skip to content

Fix mamba2 family decode and simplify all reshape ops - #47569

Merged
Cyrilvallez merged 2 commits into
mainfrom
fix-mamba-reshape
Jul 27, 2026
Merged

Fix mamba2 family decode and simplify all reshape ops#47569
Cyrilvallez merged 2 commits into
mainfrom
fix-mamba-reshape

Conversation

@Cyrilvallez

@Cyrilvallez Cyrilvallez commented Jul 27, 2026

Copy link
Copy Markdown
Member

CI

What does this PR do?

As per the title. This supersedes #47533 with more simplifications instead of simply squeezeing. Those models are all over the place in terms of reshape/view ops, so always a good idea to remove a few no-ops and shenanigans

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: bamba, falcon_h1, granitemoehybrid, mamba2, nemotron_h, zamba2

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 30242609084:1
Result: success | Jobs: 5 | Tests: 1,885 | Failures: 0 | Duration: 11m 25s

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova albertvillanova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested this PR branch with TRL CI:

Before: https://github.com/huggingface/trl/actions/runs/30251482183/job/89930273248

  FAILED tests/test_grpo_trainer.py::TestGRPOTrainer::test_train[trl-internal-testing/tiny-NemotronHForCausalLM-nano] - RuntimeError: expand(CUDABFloat16Type{[3, 1, 1, 8]}, size=[-1, -1, 4]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)
  FAILED tests/test_rloo_trainer.py::TestRLOOTrainer::test_train[trl-internal-testing/tiny-NemotronHForCausalLM-nano] - RuntimeError: expand(CUDABFloat16Type{[3, 1, 1, 8]}, size=[-1, -1, 4]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)
  = 2 failed

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