Skip to content

Commit f0c6e6c

Browse files
committed
[inductor] convert inductor gha to workflow
1 parent 7c6af81 commit f0c6e6c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

Diff for: .github/workflows/inductor.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test build/test linux gpu
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
workflow_dispatch:
7+
inputs:
8+
triton_pin:
9+
description: 'Triton branch or commit to pin'
10+
type: string
11+
default: 'main'
12+
required: false
13+
pytorch_pin:
14+
description: 'PyTorch branch or commit to pin'
15+
type: string
16+
default: 'main'
17+
required: false
18+
19+
jobs:
20+
build-test:
21+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
22+
with:
23+
runner: linux.g5.48xlarge.nvidia.gpu
24+
gpu-arch-type: cuda
25+
gpu-arch-version: "12.1"
26+
timeout: 360
27+
# docker-image: nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
28+
script: |
29+
set -x
30+
pushd ..
31+
echo "Installing triton"
32+
git clone https://github.com/triton-lang/triton.git
33+
pushd triton
34+
echo "Checking out triton branch or commit"
35+
git checkout ${{ github.event.inputs.triton_pin || 'main' }}
36+
sudo yum install -y zlib-devel
37+
echo "Installing build-time dependencies"
38+
pip install ninja==1.11.1.1 cmake==3.30.2 wheel==0.44.0
39+
export llvm_hash=$(cat cmake/llvm-hash.txt)
40+
echo "llvm_hash: $llvm_hash"
41+
pushd ..
42+
echo "Cloning llvm-project"
43+
git clone https://github.com/llvm/llvm-project.git
44+
pushd llvm-project
45+
echo "Checking out llvm hash"
46+
git checkout "$llvm_hash"
47+
mkdir build
48+
pushd build
49+
echo "Building llvm"
50+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON ../llvm -DLLVM_ENABLE_PROJECTS="mlir;llvm" -DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
51+
ninja
52+
export LLVM_BUILD_DIR=$(pwd)
53+
popd
54+
popd
55+
popd
56+
LLVM_INCLUDE_DIRS=$LLVM_BUILD_DIR/include LLVM_LIBRARY_DIR=$LLVM_BUILD_DIR/lib LLVM_SYSPATH=$LLVM_BUILD_DIR pip install -e python
57+
echo "Installing triton python package"
58+
popd
59+
echo "Cloning pytorch"
60+
git clone https://github.com/pytorch/pytorch.git
61+
pushd pytorch
62+
echo "Checking out pytorch branch or commit"
63+
git checkout ${{ github.event.inputs.pytorch_pin || 'main' }}
64+
git submodule sync
65+
git submodule update --init --recursive
66+
pip install -r requirements.txt
67+
pip install mkl-static mkl-include pytest pytest-xdist
68+
echo "Installing magma-cuda121"
69+
conda install -y -c pytorch magma-cuda121
70+
python setup.py install
71+
pytest -n 1 test/inductor/test_torchinductor.py

0 commit comments

Comments
 (0)