Fix CUDA errors in sharded generation with Qwen3#41734
Open
SrijanUpadhyay wants to merge 1 commit intohuggingface:mainfrom
Open
Fix CUDA errors in sharded generation with Qwen3#41734SrijanUpadhyay wants to merge 1 commit intohuggingface:mainfrom
SrijanUpadhyay wants to merge 1 commit intohuggingface:mainfrom
Conversation
Issue huggingface#41720: CUDA asserts during multi-GPU generation with Qwen3 models due to NaN/Inf in hidden states. Changes: - Enhanced InfNanRemoveLogitsProcessor to handle hidden state stabilization - Added automatic remove_invalid_values=True for sharded models - Removed direct nan handling from Qwen3 model for cleaner architecture Fixes huggingface#41720
4 tasks
Contributor
Author
|
Hey! @vasqu, i have made these changes, please look into it and provide me feedback on this PR. |
|
Hi there, thanks for this potential fix. I’m truly grateful that you’re taking the time to look into this issue. I pulled and built your branch locally, but I’m still running into a similar problem. |
This was referenced Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #41720: CUDA asserts during multi-GPU generation with Qwen3 models due to NaN/Inf in hidden states.
Changes:
Fixes #41720