Skip to content

Commit e4125e9

Browse files
metal lowbit ops: ci
1 parent 81a2813 commit e4125e9

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

.github/workflows/torchao_experimental_test.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'gh/**'
1212

1313
jobs:
14-
test:
14+
test-cpu-ops:
1515
strategy:
1616
matrix:
1717
runner: [macos-14]
@@ -56,3 +56,53 @@ jobs:
5656
sh build_and_run_tests.sh
5757
rm -rf /tmp/cmake-out
5858
popd
59+
60+
test-mps-ops:
61+
strategy:
62+
matrix:
63+
runner: [macos-m1-stable]
64+
runs-on: ${{matrix.runner}}
65+
steps:
66+
- name: Print machine info
67+
run: |
68+
uname -a
69+
if [ $(uname -s) == Darwin ]; then
70+
sysctl machdep.cpu.brand_string
71+
sysctl machdep.cpu.core_count
72+
fi
73+
- name: Checkout repo
74+
uses: actions/checkout@v3
75+
with:
76+
submodules: true
77+
- name: Create conda env
78+
run: |
79+
conda create -yn test-mps-ops-env python=3.11
80+
- name: Activate conda env
81+
run: |
82+
conda activate test-mps-ops-env
83+
- name: Install torch
84+
run: |
85+
pip install torch --index-url "https://download.pytorch.org/whl/nightly/cpu"
86+
- name: Print torch version
87+
run: |
88+
python -c "import torch; print(torch.__version__)"
89+
- name: Install requirements
90+
run: |
91+
pip install cmake
92+
pip install parameterized
93+
pip install pyyaml
94+
- name: Print pip freeze
95+
run: |
96+
pip freeze
97+
- name: Print current directory
98+
run: |
99+
python -c "import os; print(os.getcwd())"
100+
- name: Build ao with experimental mps ops
101+
run: |
102+
USE_CPP=1 TORCHAO_BUILD_EXPERIMENTAL_MPS=1 pip install .
103+
- name: Run mps tests
104+
run: |
105+
pushd torchao/experimental/ops/mps/test
106+
python test_lowbit.py
107+
python test_quantizer.py
108+
popd

0 commit comments

Comments
 (0)