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