Skip to content
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

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

SomeoneSerge
Copy link
Contributor

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

@@ -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
Copy link
Contributor Author

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?

Comment on lines +180 to +182
except RuntimeError:
ptxas_version = b"NO_PTXAS"
_cached_cuda_version_key = key + '-' + hashlib.sha1(ptxas_version).hexdigest()
Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

@github-actions
Copy link

⚠️ This PR does not produce bitwise identical kernels as the branch it's merged against. Please check artifacts for details. Download the output file here.

@ptillet ptillet merged commit cde42e6 into triton-lang:main Oct 27, 2023
4 checks passed
pingzhuu pushed a commit to siliconflow/triton that referenced this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants