Skip to content

Fixing redundant transpose in HPUMambaMixer2 (#999)#1014

Open
ksmusz wants to merge 3 commits intoreleases/v0.15.1from
dev/ksmusz/mme_transpose_fix_granite4_0.15.1
Open

Fixing redundant transpose in HPUMambaMixer2 (#999)#1014
ksmusz wants to merge 3 commits intoreleases/v0.15.1from
dev/ksmusz/mme_transpose_fix_granite4_0.15.1

Conversation

@ksmusz
Copy link
Collaborator

@ksmusz ksmusz commented Feb 24, 2026

We are noticing some MME transposes within the profiling, which are fixed by this change


cherry-pick of #999

We are noticing some MME transposes within the profiling, which are
fixed by this change

---------

Signed-off-by: Krzysztof Smusz <ksmusz@habana.ai>
Copilot AI review requested due to automatic review settings February 24, 2026 09:05
@ksmusz ksmusz marked this pull request as ready for review February 24, 2026 09:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes redundant transpose operations in the HPUMambaMixer2 implementation that were causing inefficient MME (Matrix Multiply Engine) operations during profiling. The fix involves creating a custom state shape calculator for HPU that eliminates the need for transpose operations.

Changes:

  • Removed redundant transpose operation when accessing conv_state from the KV cache
  • Added custom hpu_mamba2_state_shape function to return conv_state in the correct layout
  • Implemented get_state_shape method in HPUMambaMixer2 to use the custom state shape calculator

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
vllm_gaudi/ops/hpu_mamba_utils.py New utility file implementing hpu_mamba2_state_shape function that returns conv_state with contiguous 'dim' axis layout
vllm_gaudi/ops/hpu_mamba_mixer2.py Removed transpose operation on conv_state access and added get_state_shape method using the new HPU-specific state shape calculator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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