Skip to content

Commit

Permalink
Add steps to build triton
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Mar 24, 2024
1 parent 6346979 commit 6b56531
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ def build_pytorch_repo(repo: TorchRepo, build_env: Dict[str, str]):
if os.path.exists(version_py_path):
os.remove(version_py_path)
try:
# Build and test triton
build_triton_command = ["make", "triton"]
subprocess.check_call(build_triton_command, cwd=repo.src_path.absolute(), env=build_env)
command_testbuild = [sys.executable, "-c", "'import triton'"]
subprocess.check_call(command_testbuild, cwd=os.environ["HOME"], env=build_env)
# Build and test pytorch
subprocess.check_call(repo.build_command, cwd=repo.src_path.absolute(), env=build_env)
command_testbuild = [sys.executable, "-c", "'import torch'"]
command_testbuild = [sys.executable, "-c", "'import torch; import triton'"]
subprocess.check_call(command_testbuild, cwd=os.environ["HOME"], env=build_env)
except subprocess.CalledProcessError:
_print_info(f"BUILDING {repo.name.upper()} commit {repo.cur_commit} 2ND TRY")
Expand Down

0 comments on commit 6b56531

Please sign in to comment.