Skip to content

Conversation

gshtras
Copy link
Collaborator

@gshtras gshtras commented Sep 23, 2025

Fix for getting

(APIServer pid=408377) ImportError: cannot import name 'routing_from_bitmatrix' from 'triton_kernels.routing' (/usr/local/lib/python3.12/dist-packages/triton_kernels/routing.py). Did you mean: '_routing_clear_bitmatrix'?

when running any quantized model after #24588 when using an incompatible version of triton_kernels

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes a bug where an ImportError would crash the application when using an incompatible version of triton_kernels. The change adds ImportError to the exception handling block, which resolves the issue. I have provided one suggestion to improve the code's clarity and maintainability by removing a redundant exception type from the except clause.

routing_from_bitmatrix)
from triton_kernels.tensor import Bitmatrix
except (ModuleNotFoundError, AttributeError) as e:
except (ModuleNotFoundError, AttributeError, ImportError) as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While adding ImportError is correct, the exception list (ModuleNotFoundError, AttributeError, ImportError) is redundant. ModuleNotFoundError is a subclass of ImportError, so catching ImportError already covers it. To improve code clarity and maintainability, you can simplify this to (ImportError, AttributeError).

Suggested change
except (ModuleNotFoundError, AttributeError, ImportError) as e:
except (ImportError, AttributeError) as e:

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Sep 23, 2025
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) September 23, 2025 20:17
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 23, 2025
@DarkLight1337 DarkLight1337 merged commit 690f948 into vllm-project:main Sep 23, 2025
54 checks passed
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
…ct#25481)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpt-oss Related to GPT-OSS models ready ONLY add when PR is ready to merge/full CI is needed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants