summary refs log tree commit diff
path: root/pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch')
-rw-r--r--pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch b/pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch
new file mode 100644
index 00000000000..5038a5ba52e
--- /dev/null
+++ b/pkgs/development/python-modules/openai-triton/0000-dont-download-ptxas.patch
@@ -0,0 +1,39 @@
+diff --git a/python/setup.py b/python/setup.py
+index 2ac3accd2..f26161c72 100644
+--- a/python/setup.py
++++ b/python/setup.py
+@@ -101,25 +101,6 @@ def get_thirdparty_packages(triton_cache_path):
+ # ---- package data ---
+ 
+ 
+-def download_and_copy_ptxas():
+-    base_dir = os.path.dirname(__file__)
+-    src_path = "bin/ptxas"
+-    url = "https://conda.anaconda.org/nvidia/label/cuda-12.0.0/linux-64/cuda-nvcc-12.0.76-0.tar.bz2"
+-    dst_prefix = os.path.join(base_dir, "triton")
+-    dst_suffix = os.path.join("third_party", "cuda", src_path)
+-    dst_path = os.path.join(dst_prefix, dst_suffix)
+-    if not os.path.exists(dst_path):
+-        print(f'downloading and extracting {url} ...')
+-        ftpstream = urllib.request.urlopen(url)
+-        file = tarfile.open(fileobj=ftpstream, mode="r|*")
+-        with tempfile.TemporaryDirectory() as temp_dir:
+-            file.extractall(path=temp_dir)
+-            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
+-
+-
+ # ---- cmake extension ----
+ 
+ 
+@@ -200,8 +181,6 @@ class CMakeBuild(build_ext):
+         subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=self.build_temp)
+ 
+ 
+-download_and_copy_ptxas()
+-
+ setup(
+     name="triton",
+     version="2.0.0",