-
Notifications
You must be signed in to change notification settings - Fork 14
102 lines (86 loc) · 3.07 KB
/
torch-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: TorchScript tests
on:
push:
branches: [main]
pull_request:
# Check all PR
concurrency:
group: torch-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
tests:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Torch ${{ matrix.torch-version }}
container: ${{ matrix.container }}
strategy:
matrix:
include:
- os: ubuntu-22.04
torch-version: 1.12.*
python-version: "3.9"
cargo-test-flags: --release
- os: ubuntu-22.04
torch-version: 2.3.*
python-version: "3.12"
cargo-test-flags: --release
do-valgrind: true
- os: ubuntu-20.04
container: ubuntu:20.04
extra-name: ", cmake 3.16"
torch-version: 2.5.*
python-version: "3.12"
cargo-test-flags: ""
cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g
- os: macos-14
torch-version: 2.3.*
python-version: "3.12"
cargo-test-flags: --release
- os: windows-2019
# Torch 2.3.0 is broken on Windows, and 2.2 has https://github.com/pytorch/pytorch/issues/118862
torch-version: 2.1.*
python-version: "3.11"
cargo-test-flags: --release
steps:
- name: install dependencies in container
if: matrix.container == 'ubuntu:20.04'
run: |
apt update
apt install -y software-properties-common
apt install -y cmake make gcc g++ git curl
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git safe directory
if: matrix.container == 'ubuntu:20.04'
run: git config --global --add safe.directory /__w/featomic/featomic
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
# we get torch from pip to run the C++ test
- name: setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install valgrind
if: matrix.do-valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.8.2"
- name: Setup sccache environnement variables
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
- name: run TorchScript C++ tests
run: cargo test --package featomic-torch ${{ matrix.cargo-test-flags }}
env:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
FEATOMIC_TORCH_TEST_VERSION: ${{ matrix.torch-version }}
CXXFLAGS: ${{ matrix.cxx-flags }}