Skip to content

Commit 71db31d

Browse files
TroyGardenfacebook-github-bot
authored andcommitted
minior refactor github workflow (#3062)
Summary: Pull Request resolved: #3062 # context * refactor the matrix statement in the github workflow * in case of pull-request only cu128+py313 would be running in gpu ci only py39 and py313 would be running in cpu ci Reviewed By: aporialiao Differential Revision: D76242338 fbshipit-source-id: b56ba4965842d89371d9a7baec858734bc306aaf
1 parent d8bd415 commit 71db31d

File tree

2 files changed

+66
-75
lines changed

2 files changed

+66
-75
lines changed

.github/workflows/unittest_ci.yml

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,74 +13,56 @@ on:
1313
- "third_party/*"
1414
- .gitignore
1515
- "*.md"
16+
pull_request:
17+
paths-ignore:
18+
- "docs/*"
19+
- "third_party/*"
20+
- .gitignore
21+
- "*.md"
1622
workflow_dispatch:
1723

1824
jobs:
1925
build_test:
2026
strategy:
2127
fail-fast: false
2228
matrix:
23-
include:
24-
- os: linux.g5.12xlarge.nvidia.gpu
25-
python-version: 3.9
26-
python-tag: "py39"
27-
cuda-tag: "cu118"
28-
- os: linux.g5.12xlarge.nvidia.gpu
29-
python-version: 3.9
30-
python-tag: "py39"
31-
cuda-tag: "cu126"
32-
- os: linux.g5.12xlarge.nvidia.gpu
33-
python-version: 3.9
34-
python-tag: "py39"
35-
cuda-tag: "cu128"
36-
- os: linux.g5.12xlarge.nvidia.gpu
37-
python-version: '3.10'
38-
python-tag: "py310"
29+
cuda-tag: ["cu118", "cu126", "cu128"]
30+
os:
31+
- linux.g5.12xlarge.nvidia.gpu
32+
python:
33+
- version: "3.9"
34+
tag: "py39"
35+
- version: "3.10"
36+
tag: "py310"
37+
- version: "3.11"
38+
tag: "py311"
39+
- version: "3.12"
40+
tag: "py312"
41+
- version: "3.13"
42+
tag: "py313"
43+
is_pr:
44+
- ${{ github.event_name == 'pull_request' }}
45+
exclude:
46+
- is_pr: true
3947
cuda-tag: "cu118"
40-
- os: linux.g5.12xlarge.nvidia.gpu
41-
python-version: '3.10'
42-
python-tag: "py310"
48+
- is_pr: true
4349
cuda-tag: "cu126"
44-
- os: linux.g5.12xlarge.nvidia.gpu
45-
python-version: '3.10'
46-
python-tag: "py310"
50+
- is_pr: true
4751
cuda-tag: "cu128"
48-
- os: linux.g5.12xlarge.nvidia.gpu
49-
python-version: '3.11'
50-
python-tag: "py311"
51-
cuda-tag: "cu118"
52-
- os: linux.g5.12xlarge.nvidia.gpu
53-
python-version: '3.11'
54-
python-tag: "py311"
55-
cuda-tag: "cu126"
56-
- os: linux.g5.12xlarge.nvidia.gpu
57-
python-version: '3.11'
58-
python-tag: "py311"
52+
python:
53+
version: "3.9"
54+
- is_pr: true
5955
cuda-tag: "cu128"
60-
- os: linux.g5.12xlarge.nvidia.gpu
61-
python-version: '3.12'
62-
python-tag: "py312"
63-
cuda-tag: "cu118"
64-
- os: linux.g5.12xlarge.nvidia.gpu
65-
python-version: '3.12'
66-
python-tag: "py312"
67-
cuda-tag: "cu126"
68-
- os: linux.g5.12xlarge.nvidia.gpu
69-
python-version: '3.12'
70-
python-tag: "py312"
56+
python:
57+
version: "3.10"
58+
- is_pr: true
7159
cuda-tag: "cu128"
72-
- os: linux.g5.12xlarge.nvidia.gpu
73-
python-version: '3.13'
74-
python-tag: "py313"
75-
cuda-tag: "cu118"
76-
- os: linux.g5.12xlarge.nvidia.gpu
77-
python-version: '3.13'
78-
python-tag: "py313"
79-
cuda-tag: "cu126"
80-
- os: linux.g5.12xlarge.nvidia.gpu
81-
python-version: '3.13'
82-
python-tag: "py313"
60+
python:
61+
version: "3.11"
62+
- is_pr: true
8363
cuda-tag: "cu128"
64+
python:
65+
version: "3.12"
8466
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
8567
permissions:
8668
id-token: write
@@ -90,7 +72,7 @@ jobs:
9072
timeout: 30
9173
script: |
9274
ldd --version
93-
conda create -y --name build_binary python=${{ matrix.python-version }}
75+
conda create -y --name build_binary python=${{ matrix.python.version }}
9476
conda info
9577
python --version
9678
conda run -n build_binary python --version
@@ -110,7 +92,7 @@ jobs:
11092
pip install -r requirements.txt
11193
conda run -n build_binary \
11294
python setup.py bdist_wheel \
113-
--python-tag=${{ matrix.python-tag }}
95+
--python-tag=${{ matrix.python.tag }}
11496
conda run -n build_binary \
11597
python -c "import torchrec"
11698
echo "torch.distributed succeeded"

.github/workflows/unittest_ci_cpu.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,31 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
include:
26-
- os: linux.2xlarge
27-
python-version: 3.9
28-
python-tag: "py39"
29-
- os: linux.2xlarge
30-
python-version: '3.10'
31-
python-tag: "py310"
32-
- os: linux.2xlarge
33-
python-version: '3.11'
34-
python-tag: "py311"
35-
- os: linux.2xlarge
36-
python-version: '3.12'
37-
python-tag: "py312"
38-
- os: linux.2xlarge
39-
python-version: '3.13'
40-
python-tag: "py313"
25+
os:
26+
- linux.2xlarge
27+
python:
28+
- version: "3.9"
29+
tag: "py39"
30+
- version: "3.10"
31+
tag: "py310"
32+
- version: "3.11"
33+
tag: "py311"
34+
- version: "3.12"
35+
tag: "py312"
36+
- version: "3.13"
37+
tag: "py313"
38+
is_pr:
39+
- ${{ github.event_name == 'pull_request' }}
40+
exclude:
41+
- is_pr: true
42+
python:
43+
version: "3.10"
44+
- is_pr: true
45+
python:
46+
version: "3.11"
47+
- is_pr: true
48+
python:
49+
version: "3.12"
4150
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
4251
permissions:
4352
id-token: write
@@ -47,7 +56,7 @@ jobs:
4756
timeout: 15
4857
script: |
4958
ldd --version
50-
conda create -y --name build_binary python=${{ matrix.python-version }}
59+
conda create -y --name build_binary python=${{ matrix.python.version }}
5160
conda info
5261
python --version
5362
conda run -n build_binary python --version
@@ -67,7 +76,7 @@ jobs:
6776
pip install -r requirements.txt
6877
conda run -n build_binary \
6978
python setup.py bdist_wheel \
70-
--python-tag=${{ matrix.python-tag }}
79+
--python-tag=${{ matrix.python.tag }}
7180
conda run -n build_binary \
7281
python -c "import torchrec"
7382
echo "torch.distributed succeeded"

0 commit comments

Comments
 (0)