Skip to content

Commit 9942f4f

Browse files
committed
Add unit tests to ci
1 parent 34440d7 commit 9942f4f

6 files changed

Lines changed: 35 additions & 3 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
- name: Run smoke tests
6969
run: docker run --rm toolsolutions-pytorch:latest ./test.sh
7070

71+
- name: Run unit tests
72+
run: docker run --rm toolsolutions-pytorch:latest bash ./run_unit_tests.sh
73+
7174
# This job adds a check named "Precommit-status" that represents overall
7275
# workflow status and can be used in branch rulesets
7376
status:
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ 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
109+
110+
RUN pip install -r requirements-unit.txt
108111

109112
# Llm examples depends on torchchat
110113
RUN sudo mkdir -p /home/ubuntu/gen_ai_utils/ && \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
expecttest==0.3.0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libtcmalloc.so.4 DNNL_DEFAULT_FPMATH_MODE=BF16 /
21+
python pytorch/test/test_mkldnn.py
22+
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libtcmalloc.so.4 DNNL_DEFAULT_FPMATH_MODE=BF16 /
23+
python pytorch/test/test_transformers.py

ML-Frameworks/pytorch-aarch64/examples/test.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]}

0 commit comments

Comments
 (0)