Skip to content

Commit

Permalink
installs an older version of Triton if CUDA < 11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwook committed Jan 24, 2023
1 parent 812f446 commit cd5191f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ def read_version(fname="whisper/version.py"):

requirements = []
if sys.platform.startswith("linux"):
requirements.append("triton>=2.0.0.dev20221202")
triton_requirement = "triton>=2.0.0.dev20221202"
try:
import re
import subprocess
version_line = subprocess.check_output(["nvcc", "--version"]).strip().split(b"\n")[-1]
major, minor = re.findall(rb"cuda_([\d]+)\.([\d]+)", version_line)[0]
if (int(major), int(minor)) < (11, 4):
# the last version supporting CUDA < 11.4
triton_requirement = "triton==2.0.0.dev20221011"
except (IndexError, OSError, subprocess.SubprocessError):
pass
requirements.append(triton_requirement)

setup(
name="openai-whisper",
Expand Down

0 comments on commit cd5191f

Please sign in to comment.