diff --git a/.github/workflows/torchao_experimental_test.yml b/.github/workflows/torchao_experimental_test.yml index e1511ffe9a..e22565793b 100644 --- a/.github/workflows/torchao_experimental_test.yml +++ b/.github/workflows/torchao_experimental_test.yml @@ -11,7 +11,7 @@ on: - 'gh/**' jobs: - test: + test-cpu-ops: strategy: matrix: runner: [macos-14] @@ -56,3 +56,54 @@ jobs: sh build_and_run_tests.sh rm -rf /tmp/cmake-out popd + + test-mps-ops: + strategy: + matrix: + runner: [macos-m1-stable] + runs-on: ${{matrix.runner}} + steps: + - name: Print machine info + run: | + uname -a + if [ $(uname -s) == Darwin ]; then + sysctl machdep.cpu.brand_string + sysctl machdep.cpu.core_count + fi + - name: Checkout repo + uses: actions/checkout@v3 + with: + submodules: true + - name: Create conda env + run: | + conda create -yn test-mps-ops-env python=3.11 + - name: Activate conda env + run: | + source activate base + conda activate test-mps-ops-env + - name: Install torch + run: | + pip install torch --index-url "https://download.pytorch.org/whl/nightly/cpu" + - name: Print torch version + run: | + python -c "import torch; print(torch.__version__)" + - name: Install requirements + run: | + pip install cmake + pip install parameterized + pip install pyyaml + - name: Print pip freeze + run: | + pip freeze + - name: Print current directory + run: | + python -c "import os; print(os.getcwd())" + - name: Build ao with experimental mps ops + run: | + USE_CPP=1 TORCHAO_BUILD_EXPERIMENTAL_MPS=1 pip install . + - name: Run mps tests + run: | + pushd torchao/experimental/ops/mps/test + python test_lowbit.py + python test_quantizer.py + popd