Skip to content

Commit 173d9bf

Browse files
metal lowbit ops: ci (#1825)
1 parent d8af7d7 commit 173d9bf

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

.github/workflows/torchao_experimental_test.yml

Lines changed: 52 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,54 @@ 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+
source activate base
83+
conda activate test-mps-ops-env
84+
- name: Install torch
85+
run: |
86+
pip install torch --index-url "https://download.pytorch.org/whl/nightly/cpu"
87+
- name: Print torch version
88+
run: |
89+
python -c "import torch; print(torch.__version__)"
90+
- name: Install requirements
91+
run: |
92+
pip install cmake
93+
pip install parameterized
94+
pip install pyyaml
95+
- name: Print pip freeze
96+
run: |
97+
pip freeze
98+
- name: Print current directory
99+
run: |
100+
python -c "import os; print(os.getcwd())"
101+
- name: Build ao with experimental mps ops
102+
run: |
103+
USE_CPP=1 TORCHAO_BUILD_EXPERIMENTAL_MPS=1 pip install .
104+
- name: Run mps tests
105+
run: |
106+
pushd torchao/experimental/ops/mps/test
107+
python test_lowbit.py
108+
python test_quantizer.py
109+
popd

0 commit comments

Comments
 (0)