Perform check using implicit list length #37
Merged
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.
Resolves #34
Hello!
Pull request overview
ccs is not None
, asccs
is always a list, so thisif
-statement is currently alwaysTrue
.Details
The function within which the exception from #34 occurs:
https:/TimDettmers/bitsandbytes/blob/9b5f2eda8fbd3f042c4af7ed1b870525d4668f2a/bitsandbytes/cuda_setup/main.py#L99-L109
This function takes
ccs
fromget_compute_capabilities
:https:/TimDettmers/bitsandbytes/blob/9b5f2eda8fbd3f042c4af7ed1b870525d4668f2a/bitsandbytes/cuda_setup/main.py#L65-L95
As you can see,
ccs
is initialized as a list, and is only optionally appended to. In short, it is neverNone
, soccs is not None
is alwaysTrue
, even ifccs
is an empty list.I've resolved this by using the implicit list length check using
if ccs:
. The new traceback from the Colab provided by @justheuristic (Thank you for raising the issue, and providing the Colab) is:Traceback
I would argue that the new traceback is much clearer.