-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
cuda executables: make optional #2546
Conversation
@@ -150,7 +152,6 @@ def download_and_copy(src_path, version, url_func): | |||
src_path = os.path.join(temp_dir, src_path) | |||
os.makedirs(os.path.split(dst_path)[0], exist_ok=True) | |||
shutil.copy(src_path, dst_path) | |||
return dst_suffix |
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.
The value wasn't being used so I dropped it. That OK?
except RuntimeError: | ||
ptxas_version = b"NO_PTXAS" | ||
_cached_cuda_version_key = key + '-' + hashlib.sha1(ptxas_version).hexdigest() |
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.
I had an impression that get_cuda_version_key()
was called even for cpu-only users, so I just modified the function rather than eliminating references to cuda in the cpu-only branches.
This try-except
block has the adverse side-effect that users who actually want to use ptxas
won't see this RuntimeError
, but instead will observe some failure later. I think they'll see the same error upon a call to llir_to_ptx
or ptx_to_cubin
, so it's probably fine.
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.
I see now that in v2.0.0
you had been doing effectively the same: catching the Exception
and resetting ptxas_version
to a fixed (empty) string literal. Was there a reason not to do that anymore?
|
A tiny patch addressing #1618 (comment) (also may affect #1625, #1617, NixOS/nixpkgs#263048 (comment)). Not too pretty, but addresses our needs at least and shouldn't conflict with anyone else's workflow.
Kindly wait while I'm running tests locally