Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 25ab932

Browse files
authored
Revive pytest (#18)
* enabling pytest, this will need to be extended over time * caching miniconda
1 parent e775ff9 commit 25ab932

File tree

2 files changed

+108
-76
lines changed

2 files changed

+108
-76
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ jobs:
2222
echo 'IMEX_SHA<<EOF' >> $GITHUB_ENV
2323
cat imex_version.txt >> $GITHUB_ENV
2424
echo 'EOF' >> $GITHUB_ENV
25-
- name: Echo IMEX SHA
26-
run: echo ${{ env.IMEX_SHA }}
2725
- name: Checkout IMEX
2826
uses: actions/checkout@v3
2927
with:
3028
repository: intel-innersource/frameworks.ai.mlir.mlir-extensions
3129
token: ${{ secrets.PATIMEX }}
3230
path: third_party/imex
3331
ref: ${{ env.IMEX_SHA }}
34-
- name: Setup LLVM Cache Vars
35-
run: |
36-
echo 'LLVM_SHA<<EOF' >> $GITHUB_ENV
37-
cat third_party/imex/build_tools/llvm_version.txt >> $GITHUB_ENV
38-
echo 'EOF' >> $GITHUB_ENV
39-
- name: Echo LLVM SHA
40-
run: echo ${{ env.LLVM_SHA }}
32+
- name: Cache miniconda
33+
id: cache-miniconda
34+
uses: actions/cache@v3
35+
env:
36+
MINICONDA_CACHE_NUMBER: 1 # Increase to reset cache
37+
with:
38+
path: third_party/install/miniconda/**
39+
key: ${{ runner.os }}-miniconda-${{ env.MINICONDA_CACHE_NUMBER }}-${{ hashFiles('conda-env.yml') }}
4140
- name: Miniconda
41+
if: steps.cache-miniconda.outputs.cache-hit != 'true'
4242
run: |
4343
mkdir -p "$GITHUB_WORKSPACE"/third_party/install
4444
cd "$GITHUB_WORKSPACE"/third_party
@@ -49,10 +49,21 @@ jobs:
4949
export PATH=$GITHUB_WORKSPACE/third_party/install/miniconda/bin:${PATH}
5050
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
5151
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate
52-
which conda
53-
which python
54-
conda create -q -n ddpt -c intel -c defaults pybind11 numpy cmake ninja impi-devel libstdcxx-ng mpi4py pytest scipy tbb-devel
5552
cd -
53+
conda env create -f conda-env.yml
54+
conda clean -a -y
55+
# conda create -q -n ddpt -c intel -c defaults pybind11 numpy cmake ninja impi-devel libstdcxx-ng mpi4py pytest scipy tbb-devel
56+
- name: Setup miniconda
57+
if: steps.cache-miniconda.outputs.cache-hit == 'true'
58+
run: |
59+
echo "$GITHUB_WORKSPACE/third_party/install/miniconda/bin" >> $GITHUB_PATH
60+
echo "$GITHUB_WORKSPACE/third_party/install/miniconda/condabin" >> $GITHUB_PATH
61+
export PATH=$GITHUB_WORKSPACE/third_party/install/miniconda/bin:${PATH}
62+
- name: Setup LLVM Cache Var
63+
run: |
64+
echo 'LLVM_SHA<<EOF' >> $GITHUB_ENV
65+
cat third_party/imex/build_tools/llvm_version.txt >> $GITHUB_ENV
66+
echo 'EOF' >> $GITHUB_ENV
5667
- name: Cache LLVM-MLIR
5768
id: cache-llvm-mlir
5869
uses: actions/cache@v3
@@ -87,9 +98,6 @@ jobs:
8798
cp bin/count $GITHUB_WORKSPACE/third_party/install/llvm-mlir/bin/
8899
cp bin/not $GITHUB_WORKSPACE/third_party/install/llvm-mlir/bin/
89100
popd
90-
ls $GITHUB_WORKSPACE/third_party/install/llvm-mlir/
91-
ls third_party/install/llvm-mlir/
92-
93101
- name: Cache IMEX
94102
id: cache-imex-mlir
95103
uses: actions/cache@v3
@@ -101,7 +109,6 @@ jobs:
101109
- name: Build IMEX
102110
if: steps.cache-imex-mlir.outputs.cache-hit != 'true'
103111
run: |
104-
which python
105112
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
106113
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate ddpt
107114
mkdir -p third_party/build/imex
@@ -110,7 +117,18 @@ jobs:
110117
cmake --build . -j ${np} || exit 1
111118
cmake --install . --prefix=$GITHUB_WORKSPACE/third_party/install/imex || exit 1
112119
popd
113-
ls $GITHUB_WORKSPACE/third_party/install/imex
114-
ls third_party/install/imex
120+
- name: Build DDPT
121+
run: |
122+
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
123+
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate ddpt
124+
MLIRROOT=$GITHUB_WORKSPACE/third_party/install/llvm-mlir IMEXROOT=$GITHUB_WORKSPACE/third_party/install/imex python setup.py install
125+
- name: Test DDPT (pytest)
126+
run: |
127+
. $GITHUB_WORKSPACE/third_party/install/miniconda/etc/profile.d/conda.sh
128+
. $GITHUB_WORKSPACE/third_party/install/miniconda/bin/activate ddpt
129+
export DDPT_IDTR_SO=build/lib.linux-x86_64-cpython-*/ddptensor/libidtr.so
130+
export DDPT_CRUNNER_SO="$GITHUB_WORKSPACE"/third_party/install/llvm-mlir/lib/libmlir_c_runner_utils.so
131+
pytest test
132+
# DDPT_FORCE_DIST=1 pytest test
115133
- run: |
116134
echo "This job's status is ${{ job.status }}."

conda-env.yml

Lines changed: 72 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,87 @@
1-
name: ddpt2
1+
name: ddpt
22
channels:
33
- intel
44
- defaults
55
dependencies:
66
- _libgcc_mutex=0.1=main
7-
- _openmp_mutex=4.5=1_gnu
7+
- _openmp_mutex=5.1=1_gnu
88
- attrs=21.4.0=pyhd3eb1b0_0
9-
- bzip2=1.0.8=h7b6447c_0
10-
- c-ares=1.18.1=h7f8727e_0
11-
- ca-certificates=2022.2.1=h06a4308_0
12-
- certifi=2021.10.8=py38h06a4308_2
9+
- bzip2=1.0.8=hb9a14ef_9
10+
- c-ares=1.19.0=h5eee18b_0
11+
- ca-certificates=2023.01.10=h06a4308_0
12+
- certifi=2022.12.7=py39h06a4308_0
13+
- cffi=1.15.1=py39h74dc2b5_0
14+
- cfgv=3.3.1=py39h06a4308_0
1315
- cmake=3.22.1=h1fce559_0
14-
- dpcpp-cpp-rt=2022.0.1=h06a4308_3633
15-
- dpcpp_cpp_rt=2022.0.1=intel_3633
16-
- expat=2.4.4=h295c915_0
17-
- fortran_rt=2022.0.1=intel_3633
18-
- impi-devel=2021.5.0=intel_497
19-
- impi_rt=2021.5.0=intel_497
16+
- distlib=0.3.6=py39h06a4308_0
17+
- dpcpp-cpp-rt=2023.1.0=intel_46305
18+
- dpcpp_cpp_rt=2023.1.0=intel_46305
19+
- expat=2.4.9=h6a678d5_0
20+
- filelock=3.6.0=pyhd3eb1b0_0
21+
- fortran_rt=2023.1.0=intel_46305
22+
- icc_rt=2023.1.0=intel_46305
23+
- identify=2.5.5=py39h06a4308_0
24+
- impi-devel=2021.9.0=intel_43482
25+
- impi_rt=2021.9.0=intel_43482
2026
- iniconfig=1.1.1=pyhd3eb1b0_0
21-
- intel-cmplr-lib-rt=2022.0.1=h06a4308_3633
22-
- intel-cmplr-lic-rt=2022.0.1=h06a4308_3633
23-
- intel-fortran-rt=2022.0.1=h06a4308_3633
24-
- intel-opencl-rt=2022.0.1=h06a4308_3633
25-
- intel-openmp=2022.0.1=h06a4308_3633
26-
- intelpython=2022.0.0=0
27+
- intel-cmplr-lib-rt=2023.1.0=intel_46305
28+
- intel-cmplr-lic-rt=2023.1.0=intel_46305
29+
- intel-fortran-rt=2023.1.0=intel_46305
30+
- intel-opencl-rt=2023.1.0=intel_46305
31+
- intel-openmp=2023.1.0=intel_46305
32+
- intelpython=2023.1.0=1
2733
- krb5=1.19.2=hac12032_0
28-
- ld_impl_linux-64=2.35.1=h7274673_9
29-
- libcurl=7.80.0=h0b77cf5_0
34+
- libcurl=7.84.0=h91b91d3_1
3035
- libedit=3.1.20210910=h7f8727e_0
3136
- libev=4.33=h7f8727e_1
32-
- libffi=3.3=he6710b0_2
33-
- libgcc-ng=9.3.0=h5101ec6_17
34-
- libgomp=9.3.0=h5101ec6_17
37+
- libffi=3.3=14
38+
- libgcc-ng=11.2.0=h1234567_1
39+
- libgomp=11.2.0=h1234567_1
3540
- libnghttp2=1.46.0=hce63b2e_0
36-
- libssh2=1.9.0=h1ba5d50_1
37-
- libstdcxx-ng=9.3.0=hd4cf53a_17
38-
- libuv=1.40.0=h7b6447c_0
39-
- lz4-c=1.9.3=h295c915_1
40-
- mkl=2022.0.1=h06a4308_117
41-
- mkl-include=2022.0.1=h06a4308_117
42-
- mkl-service=2.4.0=py38h4119f30_11
43-
- mkl_fft=1.3.1=py38h8344fd8_7
44-
- mkl_random=1.2.2=py38h4ac99d2_7
45-
- mkl_umath=0.1.1=py38h03fa629_17
46-
- mpi4py=3.0.3=py38h4a7690d_11
47-
- ncurses=6.3=h7f8727e_2
48-
- numpy=1.21.2=py38hec4e512_7
49-
- numpy-base=1.21.2=py38h40791c5_7
50-
- openssl=1.1.1m=h7f8727e_0
51-
- packaging=21.3=pyhd3eb1b0_0
52-
- pip=21.2.4=py38h06a4308_0
53-
- pluggy=1.0.0=py38h06a4308_0
41+
- libssh2=1.10.0=h8f2d780_0
42+
- libstdcxx-ng=11.2.0=h1234567_1
43+
- libuv=1.40.0=h7b6447c_2
44+
- lz4-c=1.9.4=h6a678d5_0
45+
- mkl=2023.1.0=intel_46342
46+
- mkl-service=2.4.0=py39h75d02e3_15
47+
- mkl_fft=1.3.5=py39h28f0b46_11
48+
- mkl_random=1.2.2=py39h0b06908_51
49+
- mkl_umath=0.1.1=py39h450dca2_61
50+
- mpi4py=3.1.4=py39h618b5fa_0
51+
- ncurses=6.4=h6a678d5_0
52+
- ninja=1.10.2=py39hff7bd54_0
53+
- nodeenv=1.7.0=py39h06a4308_0
54+
- numpy=1.23.5=py39h52df89b_7
55+
- numpy-base=1.23.5=py39ha03f565_7
56+
- openssl=1.1.1t=h7f8727e_0
57+
- packaging=22.0=py39h06a4308_0
58+
- pip=23.0.1=py39h06a4308_0
59+
- platformdirs=2.5.2=py39h06a4308_0
60+
- pluggy=1.0.0=py39h06a4308_1
61+
- pre-commit=3.2.1=py39h06a4308_0
62+
- pre_commit=3.2.1=hd3eb1b0_0
5463
- py=1.11.0=pyhd3eb1b0_0
55-
- pybind11=2.9.1=py38hae6d005_0
56-
- pyparsing=3.0.4=pyhd3eb1b0_0
57-
- pytest=6.2.5=py38h06a4308_2
58-
- python=3.8.12=h12debd9_0
59-
- readline=8.1.2=h7f8727e_1
64+
- pybind11=2.10.4=py39hdb19cb5_0
65+
- pybind11-global=2.10.4=py39hdb19cb5_0
66+
- pycparser=2.21=pyhd3eb1b0_0
67+
- pytest=7.1.2=py39h06a4308_0
68+
- python=3.9.16=h2722d68_1
69+
- pyyaml=6.0=py39h5eee18b_1
70+
- readline=8.2=h5eee18b_0
6071
- rhash=1.4.1=h3c74f83_1
61-
- scipy=1.6.2=py38ha2f9938_5
62-
- setuptools=58.0.4=py38h06a4308_0
72+
- scipy=1.7.3=py39h4ca98da_8
73+
- setuptools=65.6.3=py39h06a4308_0
6374
- six=1.16.0=pyhd3eb1b0_1
64-
- sqlite=3.38.0=hc218d9a_0
65-
- tbb=2021.5.0=hd09550d_0
66-
- tbb-devel=2021.5.0=hd09550d_0
67-
- tbb4py=2021.5.0=py38hd09550d_0
68-
- tk=8.6.11=h1ccaba5_0
69-
- toml=0.10.2=pyhd3eb1b0_0
70-
- wheel=0.37.1=pyhd3eb1b0_0
71-
- xz=5.2.5=h7b6447c_0
72-
- zlib=1.2.11=h7f8727e_4
73-
- zstd=1.5.0=ha4553b6_1
75+
- sqlite=3.41.1=h5eee18b_0
76+
- tbb=2021.9.0=intel_43484
77+
- tbb-devel=2021.9.0=intel_43484
78+
- tbb4py=2021.9.0=py39_intel_43484
79+
- tk=8.6.12=h1ccaba5_0
80+
- tomli=2.0.1=py39h06a4308_0
81+
- ukkonen=1.0.1=py39hdb19cb5_0
82+
- virtualenv=20.17.1=py39_0
83+
- wheel=0.38.4=py39h06a4308_0
84+
- xz=5.2.8=h5eee18b_0
85+
- yaml=0.2.5=h7b6447c_0
86+
- zlib=1.2.13=h5eee18b_0
87+
- zstd=1.5.2=ha4553b6_2

0 commit comments

Comments
 (0)