-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Bugfix] Fix for the import error from #24588 #25481
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
Conversation
Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
There was a problem hiding this 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
.
except (ModuleNotFoundError, AttributeError, ImportError) as e: | |
except (ImportError, AttributeError) as e: |
Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
…ct#25481) Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
Fix for getting
when running any quantized model after #24588 when using an incompatible version of triton_kernels