Skip to content

fix: compare inputs_embeds generate against input_ids generate, not u…#1787

Draft
akoumpa wants to merge 2 commits intomainfrom
akoumparouli/fix_mamba_cached_vs_uncached_test
Draft

fix: compare inputs_embeds generate against input_ids generate, not u…#1787
akoumpa wants to merge 2 commits intomainfrom
akoumparouli/fix_mamba_cached_vs_uncached_test

Conversation

@akoumpa
Copy link
Copy Markdown
Contributor

@akoumpa akoumpa commented Apr 12, 2026

…ncached decode

The test compared cached generation (model.generate) against uncached manual decoding (use_cache=False). For Mamba hybrid models, these two paths use different CUDA kernels that are mathematically equivalent but not bit-identical in bf16, causing spurious assertion failures.

Changed the reference to use generate(input_ids=...) which exercises the same cached kernel path as generate(inputs_embeds=...).

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Changelog

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

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?

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

Additional Information

  • Related to # (issue)

…ncached decode

The test compared cached generation (model.generate) against uncached
manual decoding (use_cache=False). For Mamba hybrid models, these two
paths use different CUDA kernels that are mathematically equivalent but
not bit-identical in bf16, causing spurious assertion failures.

Changed the reference to use generate(input_ids=...) which exercises
the same cached kernel path as generate(inputs_embeds=...).

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 12, 2026

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.

@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Apr 12, 2026

/ok to test 2897aab

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Apr 12, 2026

/ok to test 50f5374

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.

1 participant