Skip to content

Commit c0f2283

Browse files
authored
Merge pull request #345 from ARM-software/ci
Add unit tests to ci
2 parents 874ddb7 + d05956e commit c0f2283

6 files changed

Lines changed: 32 additions & 4 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ jobs:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767

6868
- name: Run smoke tests
69-
run: docker run --rm toolsolutions-pytorch:latest ./test.sh
69+
run: docker run --rm toolsolutions-pytorch:latest ./test-examples.sh
70+
71+
- name: Run unit tests
72+
run: docker run --rm toolsolutions-pytorch:latest ./run_unit_tests.sh
7073

7174
# This job adds a check named "Precommit-status" that represents overall
7275
# workflow status and can be used in branch rulesets
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
ComputeLibrary/
22
pytorch/
3+
!pytorch/test
4+
!pytorch/test/**
5+
!pytorch/.ci/docker/requirements-ci.txt
36
*.log
47
.*_build_container_id

ML-Frameworks/pytorch-aarch64/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ RUN pip install "$(basename "$TORCH_WHEEL")" --no-deps \
103103
RUN pip install "$(basename "$TORCH_AO_WHEEL")" --no-deps \
104104
&& rm "$(basename "$TORCH_AO_WHEEL")"
105105

106-
# Setup Examples
106+
# Setup Examples and tests
107107
COPY examples/ /home/$DOCKER_USER/
108+
COPY pytorch/test /home/$DOCKER_USER/pytorch/test
108109

109110
# Move build into final image as a single layer.
110111
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:22.04
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -e
2+
3+
# *******************************************************************************
4+
# Copyright 2025 Arm Limited and affiliates.
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
# *******************************************************************************
19+
20+
OMP_NUM_THREADS=16 python pytorch/test/test_mkldnn.py
21+
OMP_NUM_THREADS=16 python pytorch/test/test_transformers.py

ML-Frameworks/pytorch-aarch64/examples/test.sh renamed to ML-Frameworks/pytorch-aarch64/examples/test-examples.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ done
3131

3232
# Check an example with some of the flags from REAMDE.md > "General optimization
3333
# guidelines" There is no verbatim example for this
34-
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libtcmalloc.so.4 IDEEP_CACHE_MATMUL_REORDERS=1 \
35-
LRU_CACHE_CAPACITY=256 DNNL_DEFAULT_FPMATH_MODE=BF16 ${examples[0]}
34+
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libtcmalloc.so.4 DNNL_DEFAULT_FPMATH_MODE=BF16 ${examples[0]}

ML-Frameworks/pytorch-aarch64/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
certifi==2024.8.30
55
charset-normalizer~=3.4.0
66
datasets~=3.4.1
7+
expecttest==0.3.0 # From unit tests
78
filelock~=3.16.1
89
fsspec==2024.9.0
910
huggingface_hub==0.27.0

0 commit comments

Comments
 (0)