Skip to content

Raise ValueError when nvfp4 pack tensor has odd number of columns #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fynnsu
Copy link

@fynnsu fynnsu commented Jul 23, 2025

Fixes #401 (option 3 as discussed w/ @brian-dellabetta)

Also introduces a new test for odd columned tensors.
Note: we check that the function raises either a ValueError (current behavior) or a torch._dynamo.exc.Unsupported (expected behavior after #400 merges).

This raises an explicit error for a case that previously threw an implicit error during the reshape op at the end of the function.

Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
@dsikka
Copy link
Collaborator

dsikka commented Jul 23, 2025

should probably validate on vllm

@fynnsu
Copy link
Author

fynnsu commented Jul 24, 2025

I've compressed a llama3.1 8B model, using this change and successfully loaded it into vllm and generated a sentence.

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.

Bug: Incorrect handling of odd sized dims in nvfp4 packing/unpacking
3 participants