Improved error message for unavailable variant#504
Open
theely wants to merge 2 commits intohuggingface:mainfrom
Open
Improved error message for unavailable variant#504theely wants to merge 2 commits intohuggingface:mainfrom
theely wants to merge 2 commits intohuggingface:mainfrom
Conversation
danieldk
reviewed
Apr 24, 2026
Member
danieldk
left a comment
There was a problem hiding this comment.
Thanks for contributing to kernels!
Enumeration of variants is always going to be incomplete, see: #422 E.g., in the PR
missing_variant.filename = f"torch{torch_version.major}{torch_version.minor}-{'cxx11' if torch_cxx11_abi else 'cxx98'}-cu{selected_backend.version.major}{selected_backend.version.minor}-{cpu}-{os}"
Misses: tvm-ffi, the variant without the ABI tag (which is also supported), backwards CUDA compatibility (e.g. if the system has CUDA 12.8, CUDA 12.1 to 12.7 are also supported), etc. In this case it would also report the a variant for cu if the backend is ROCm, XPU, NPU, CPU, Metal, etc.
We discussed this a while back and came to the conclusion that we are instead going to add support for 'explaining', where for every available variant it's possible to get/list the reason why it is not selected.
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.
If a kernel is not available, the raised exception now also includes the name of the required variant.
This change should help users to identify what variant they need for their system.