Skip to content

Commit e0f4814

Browse files
committed
python311Packages.openai-triton: remove ptxas --version call when built without cuda support
1 parent 5d874ac commit e0f4814

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 10f3d49aa6084d1b9b9624017cce7df106b9fb7e Mon Sep 17 00:00:00 2001
2+
From: Yaroslav Bolyukin <[email protected]>
3+
Date: Tue, 6 Feb 2024 13:51:28 +0100
4+
Subject: [PATCH] ptxas: disable version key for non-cuda targets
5+
6+
---
7+
python/triton/runtime/jit.py | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/python/triton/runtime/jit.py b/python/triton/runtime/jit.py
11+
index d55972b4b..bd875a701 100644
12+
--- a/python/triton/runtime/jit.py
13+
+++ b/python/triton/runtime/jit.py
14+
@@ -117,8 +117,8 @@ def version_key():
15+
with open(lib.module_finder.find_spec(lib.name).origin, "rb") as f:
16+
contents += [hashlib.md5(f.read()).hexdigest()]
17+
# ptxas version
18+
- ptxas = path_to_ptxas()[0]
19+
- ptxas_version = hashlib.md5(subprocess.check_output([ptxas, "--version"])).hexdigest()
20+
+ # ptxas = path_to_ptxas()[0]
21+
+ ptxas_version = "noptxas"
22+
return '-'.join(TRITON_VERSION) + '-' + ptxas_version + '-' + '-'.join(contents)
23+
24+
25+
--
26+
2.43.0
27+

pkgs/development/python-modules/openai-triton/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ buildPythonPackage rec {
4646
})
4747
] ++ lib.optionals (!cudaSupport) [
4848
./0000-dont-download-ptxas.patch
49+
# openai-triton wants to get ptxas version even if ptxas is not
50+
# used, resulting in ptxas not found error.
51+
./0001-ptxas-disable-version-key-for-non-cuda-targets.patch
4952
];
5053

5154
nativeBuildInputs = [

0 commit comments

Comments
 (0)