Skip to content

Commit 32f3296

Browse files
authored
Add input use_system_python (#2723)
It is false by default. When set to true the workflow uses the existing system python installed in the runner. Fixes #2722.
1 parent 932d0be commit 32f3296

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/build-test-gpu.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ on:
3939
description: Ignore pytest.skip
4040
type: boolean
4141
default: false
42+
use_system_python:
43+
description: Use system Python
44+
type: boolean
45+
default: false
4246

4347
permissions: read-all
4448

@@ -60,3 +64,4 @@ jobs:
6064
skip_list: ${{ inputs.skip_list }}
6165
run_name: ${{ inputs.run_name || format('Build and test {0}', inputs.runner_label) }}
6266
enable_unskip: ${{ inputs.enable_unskip }}
67+
use_system_python: ${{ inputs.use_system_python || false }}

.github/workflows/build-test-reusable.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ on:
5656
description: Runner label for version
5757
type: string
5858
default: runner-0.0.20
59+
use_system_python:
60+
description: Use system Python
61+
type: boolean
62+
default: false
5963

6064
permissions: read-all
6165

@@ -91,10 +95,16 @@ jobs:
9195
key: pip-${{ inputs.python_version }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}
9296

9397
- name: Install Python ${{ inputs.python_version }}
98+
if: ${{ !inputs.use_system_python }}
9499
uses: actions/setup-python@v5
95100
with:
96101
python-version: ${{ inputs.python_version }}
97102

103+
- name: Identify Python version
104+
run: |
105+
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info[0]}.{ sys.version_info[1]}")')"
106+
echo "PYTHON_VERSION=$PYTHON_VERSION" | tee -a $GITHUB_ENV
107+
98108
- name: Setup PyTorch
99109
uses: ./.github/actions/setup-pytorch
100110
with:

.github/workflows/triton-benchmarks.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ on:
2828
description: JSON list of benchmarks to skip
2929
type: string
3030
default: "[]"
31+
use_system_python:
32+
description: Use system Python
33+
type: boolean
34+
default: false
3135
schedule:
3236
- cron: "5 23 * * *"
3337
pull_request:
@@ -67,10 +71,16 @@ jobs:
6771
key: pip-$PYTHON_VERSION-$GITHUB_SHA
6872

6973
- name: Install Python
74+
if: ${{ !(inputs.use_system_python || false) }}
7075
uses: actions/setup-python@v5
7176
with:
7277
python-version: ${{ env.PYTHON_VERSION }}
7378

79+
- name: Identify Python version
80+
run: |
81+
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info[0]}.{ sys.version_info[1]}")')"
82+
echo "PYTHON_VERSION=$PYTHON_VERSION" | tee -a $GITHUB_ENV
83+
7484
- name: Install Python build dependencies
7585
run: |
7686
pip install wheel cmake

0 commit comments

Comments
 (0)