Skip to content

Commit da06f9c

Browse files
committed
[tmp]: Add gemm workflows for ci
1 parent 501c933 commit da06f9c

File tree

2 files changed

+264
-0
lines changed

2 files changed

+264
-0
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: gemm test reusable workflow
2+
run-name: ${{ inputs.run_name }} - ${{ inputs.python_version }} - ${{ inputs.runner_label || 'default'}}
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
device:
8+
description: Device
9+
type: string
10+
default: max1550
11+
driver_version:
12+
description: Driver version
13+
type: string
14+
default: rolling
15+
runner_label:
16+
description: Runner label, keep empty for default
17+
type: string
18+
default: ""
19+
pytorch_ref:
20+
description: PyTorch ref, keep empty for default
21+
type: string
22+
default: ""
23+
pytorch_mode:
24+
description: PyTorch mode, source or wheels
25+
type: string
26+
default: "source"
27+
python_version:
28+
description: Python version
29+
type: string
30+
required: true
31+
upload_test_reports:
32+
description: Upload test reports
33+
type: boolean
34+
default: false
35+
ignore_errors:
36+
description: Ignore test errors
37+
type: boolean
38+
default: false
39+
skip_list:
40+
description: Skip list
41+
type: string
42+
default: ""
43+
run_name:
44+
description: Custom run name
45+
type: string
46+
default: Build and test
47+
build_llvm:
48+
description: Build LLVM
49+
type: boolean
50+
default: false
51+
enable_unskip:
52+
description: Ignore pytest.skip
53+
type: boolean
54+
default: false
55+
runner_version:
56+
description: Runner label for version
57+
type: string
58+
default: runner-0.0.19
59+
60+
permissions: read-all
61+
62+
env:
63+
TRITON_DISABLE_LINE_INFO: 1
64+
TEST_UNSKIP: ${{ inputs.enable_unskip }}
65+
66+
jobs:
67+
integration-tests:
68+
name: Integration tests
69+
runs-on: ${{ fromJson(inputs.runner_label && format('["{0}"]', inputs.runner_label) || format('["{0}", "{1}", "{2}"]', inputs.device, inputs.driver_version, inputs.runner_version)) }}
70+
defaults:
71+
run:
72+
shell: bash -noprofile --norc -eo pipefail -c "source /opt/intel/oneapi/setvars.sh > /dev/null; source {0}"
73+
steps:
74+
- name: Print inputs
75+
run: |
76+
cat <<EOF
77+
${{ toJSON(inputs) }}
78+
EOF
79+
80+
- name: Checkout repository
81+
uses: actions/checkout@v4
82+
83+
- name: Load pip cache
84+
id: pip-cache
85+
uses: ./.github/actions/load
86+
env:
87+
# Increase this value to reset cache
88+
CACHE_NUMBER: 1
89+
with:
90+
path: $HOME/.cache/pip
91+
key: pip-${{ inputs.python_version }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}
92+
93+
- name: Install Python ${{ inputs.python_version }}
94+
uses: actions/setup-python@v5
95+
with:
96+
python-version: ${{ inputs.python_version }}
97+
98+
- name: Setup PyTorch
99+
uses: ./.github/actions/setup-pytorch
100+
with:
101+
repository: pytorch/pytorch
102+
ref: ${{ inputs.pytorch_ref }}
103+
mode: ${{ inputs.pytorch_mode }}
104+
105+
- name: Install pass_rate dependencies
106+
run: |
107+
pip install defusedxml
108+
109+
- name: Setup Triton
110+
uses: ./.github/actions/setup-triton
111+
with:
112+
build_llvm: ${{ inputs.build_llvm }}
113+
114+
- name: Run GEMM Script
115+
run: |
116+
python3 test.py
117+
118+
- name: Report environment details
119+
run: |
120+
source ./scripts/capture-hw-details.sh --quiet
121+
cat <<EOF | tee .env
122+
TIMESTAMP=$(date '+%Y%m%d%H%M%S')
123+
GITHUB_RUN_ID=$GITHUB_RUN_ID
124+
GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER
125+
GITHUB_RUN_ATTEMPT=$GITHUB_RUN_ATTEMPT
126+
PYTHON_VERSION=${{ inputs.python_version }}
127+
PYTORCH_REPO=$PYTORCH_REPO
128+
PYTORCH_COMMIT_ID=$PYTORCH_COMMIT_ID
129+
PYTORCH_VERSION=$PYTORCH_VERSION
130+
TRITON_REPO=$GITHUB_REPOSITORY
131+
LIBIGC1_VERSION=$LIBIGC1_VERSION
132+
LEVEL_ZERO_VERSION=$LEVEL_ZERO_VERSION
133+
GPU_DEVICE=$GPU_DEVICE
134+
AGAMA_VERSION=$AGAMA_VERSION
135+
EOF

.github/workflows/gemm-tests.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Build and test gemm
2+
run-name: ${{ inputs.run_name }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
runner_label:
8+
description: Runner label, keep empty for default
9+
type: string
10+
default: "max1550"
11+
pytorch_ref:
12+
description: PyTorch ref, keep empty for default
13+
type: string
14+
default: ""
15+
pytorch_mode:
16+
description: PyTorch mode, source or wheels
17+
type: choice
18+
options:
19+
- source
20+
- wheels
21+
default: source
22+
upload_test_reports:
23+
description: Upload test reports
24+
type: boolean
25+
default: false
26+
ignore_errors:
27+
description: Ignore test errors
28+
type: boolean
29+
default: false
30+
skip_list:
31+
description: Skip list
32+
type: string
33+
default: ""
34+
run_name:
35+
description: Custom run name
36+
type: string
37+
default: "gemm test"
38+
enable_unskip:
39+
description: Ignore pytest.skip
40+
type: boolean
41+
default: false
42+
43+
permissions: read-all
44+
45+
jobs:
46+
pre-commit:
47+
name: Pre-commit checks
48+
runs-on: Linux
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
- name: Load pip cache
54+
id: pip-cache
55+
uses: ./.github/actions/load
56+
env:
57+
# Increase this value to reset cache
58+
CACHE_NUMBER: 2
59+
with:
60+
path: $HOME/.cache/pip
61+
key: pip-3.10-${{ hashFiles('.pre-commit-config.yaml') }}-${{ env.CACHE_NUMBER }}
62+
63+
- name: Install Python 3.10
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: '3.10'
67+
68+
- name: Run pre-commit checks
69+
run: |
70+
set -x
71+
pip install --upgrade pre-commit
72+
73+
# TODO: ignore the first yapf failure until https://github.com/google/yapf/issues/1164 is fixed
74+
python3 -m pre_commit run --all-files --verbose yapf &> /dev/null || true
75+
# If first run of yapf worked and made changes reset the tree to the original state
76+
git reset --hard
77+
78+
python3 -m pre_commit run --show-diff-on-failure --color=always --all-files --verbose
79+
80+
- name: Save pip cache
81+
if: ${{ steps.pip-cache.outputs.status == 'miss' }}
82+
uses: ./.github/actions/save
83+
with:
84+
path: ${{ steps.pip-cache.outputs.path }}
85+
dest: ${{ steps.pip-cache.outputs.dest }}
86+
87+
prepare:
88+
name: Prepare
89+
runs-on: Linux
90+
91+
outputs:
92+
matrix: ${{ steps.matrix.outputs.matrix }}
93+
94+
steps:
95+
- name: Inputs
96+
run: |
97+
cat <<EOF
98+
${{ toJSON(inputs) }}
99+
EOF
100+
101+
- name: Matrix
102+
id: matrix
103+
run: |
104+
if [[ -n "${{ inputs.runner_label }}" ]]; then
105+
matrix='{"python": ["3.9"]}'
106+
else
107+
matrix='{"python": ["3.9"], "driver": ["rolling", "lts"]}'
108+
fi
109+
echo "matrix=$matrix" | tee -a $GITHUB_OUTPUT
110+
111+
integration-tests:
112+
name: Integration tests matrix
113+
needs: prepare
114+
115+
strategy:
116+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
117+
118+
uses: ./.github/workflows/gemm-test-reusable.yml
119+
with:
120+
driver_version: ${{ matrix.driver }}
121+
runner_label: ${{ inputs.runner_label }}
122+
pytorch_ref: ${{ inputs.pytorch_ref }}
123+
pytorch_mode: ${{ inputs.pytorch_mode || 'source' }}
124+
python_version: ${{ matrix.python }}
125+
upload_test_reports: ${{ inputs.upload_test_reports || false }}
126+
ignore_errors: ${{ inputs.ignore_errors || false }}
127+
skip_list: ${{ inputs.skip_list }}
128+
run_name: ${{ inputs.run_name }}
129+
enable_unskip: ${{ inputs.enable_unskip || false }}

0 commit comments

Comments
 (0)