Skip to content

Commit 5909a5a

Browse files
Merge pull request #395 from Radu2k/improve-ci
[Feat] Improve CI
2 parents 55ce0bc + e2cee67 commit 5909a5a

3 files changed

Lines changed: 57 additions & 9 deletions

File tree

.github/workflows/pytorch.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ concurrency:
5858
permissions: read-all
5959

6060
jobs:
61-
build-and-test:
61+
build-image:
6262
strategy:
6363
matrix:
64-
config: [
65-
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 }
66-
]
67-
64+
config:
65+
[
66+
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 },
67+
{ name: c8g, label: ah-ubuntu_22_04-c8g_8x }
68+
]
6869
runs-on: ${{ matrix.config.label }}
6970
steps:
7071
- name: Checkout Tool-Solutions
@@ -81,7 +82,45 @@ jobs:
8182
env:
8283
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8384

84-
- name: Run smoke tests
85+
- name: Save image as a artifact
86+
run: docker save toolsolutions-pytorch:latest -o toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
87+
88+
- name: Upload build artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: toolsolutions-pytorch-image-${{ matrix.config.name }}
92+
path: toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
93+
compression-level: 9
94+
retention-days: 1
95+
96+
test:
97+
needs: build-image
98+
strategy:
99+
matrix:
100+
config:
101+
[
102+
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 },
103+
{ name: c8g, label: ah-ubuntu_22_04-c8g_8x }
104+
]
105+
onednn_fpmath_mode: [FP32, BF16]
106+
runs-on: ${{ matrix.config.label }}
107+
env:
108+
ONEDNN_DEFAULT_FPMATH_MODE: ${{ matrix.onednn_fpmath_mode }}
109+
110+
steps:
111+
- name: Download image artifact
112+
uses: actions/download-artifact@v5
113+
with:
114+
name: toolsolutions-pytorch-image-${{ matrix.config.name }}
115+
path: .
116+
117+
- name: Set up Docker
118+
uses: docker/setup-docker-action@v4
119+
120+
- name: Load Docker image
121+
run: docker load -i toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
122+
123+
- name: Run smoke tests for
85124
run: docker run --rm toolsolutions-pytorch:latest ./test-examples.sh
86125

87126
- name: Run unit tests

ML-Frameworks/pytorch-aarch64/build-wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ docker exec -t $TORCH_BUILD_CONTAINER bash -c "rm -rf $PYTORCH_ROOT/dist"
108108
# pytorch/.ci/aarch64_linux/aarch64_wheel_ci_build.py for this logic.
109109
build_date=$(cd $PYTORCH_HOST_DIR && git log --pretty=format:%cs -1 | tr -d '-')
110110
version=$(cat $PYTORCH_HOST_DIR/version.txt| tr -d [:space:] )
111-
OVERRIDE_PACKAGE_VERSION=${version%??}.dev$build_date
111+
OVERRIDE_PACKAGE_VERSION="${version%??}.dev${build_date}${TORCH_RELEASE_ID:+"+$TORCH_RELEASE_ID"}"
112112
# We unset MAX_JOBS from 12 (written to /tmp/env by populate_binary_env.sh) to
113113
# let any downstream functions to decide. Currently nproc when ninja is used,
114114
# but ideally we would let ninja make the right choice, but nproc is good enough

ML-Frameworks/pytorch-aarch64/examples/run_unit_tests.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,14 @@
1717
# limitations under the License.
1818
# *******************************************************************************
1919

20-
OMP_NUM_THREADS=16 python pytorch/test/test_mkldnn.py
21-
OMP_NUM_THREADS=16 python pytorch/test/test_transformers.py
20+
if [[ "${ONEDNN_DEFAULT_FPMATH_MODE:-}" == "BF16" ]]; then
21+
OMP_NUM_THREADS=16 python -m unittest pytorch/test/test_mkldnn.py -k lower_precision -k bf16 -k bfloat16 -k float16
22+
else
23+
OMP_NUM_THREADS=16 python -m unittest pytorch/test/test_mkldnn.py
24+
fi
25+
26+
if [[ "${ONEDNN_DEFAULT_FPMATH_MODE:-}" == "BF16" ]]; then
27+
OMP_NUM_THREADS=16 python -m unittest pytorch/test/test_transformers.py -k bfloat16 -k float16
28+
else
29+
OMP_NUM_THREADS=16 python -m unittest pytorch/test/test_transformers.py
30+
fi

0 commit comments

Comments
 (0)