Use in-place ops in _quantize_affine_float8 to reduce peak memory (#4068) #4155
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run TorchAO Experimental MPS Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'gh/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'gh/**' | |
| jobs: | |
| test-mps-ops: | |
| name: test-mps-ops | |
| uses: pytorch/test-infra/.github/workflows/macos_job.yml@main | |
| with: | |
| runner: macos-m1-stable | |
| python-version: '3.11' | |
| submodules: 'recursive' | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| timeout: 90 | |
| script: | | |
| set -eux | |
| echo "::group::Install Torch" | |
| ${CONDA_RUN} pip install torch --index-url "https://download.pytorch.org/whl/nightly/cpu" | |
| echo "::endgroup::" | |
| echo "::group::Install requirements" | |
| ${CONDA_RUN} pip install -r dev-requirements.txt | |
| echo "::endgroup::" | |
| echo "::group::Install experimental MPS ops" | |
| ${CONDA_RUN} USE_CPP=1 TORCHAO_BUILD_EXPERIMENTAL_MPS=1 pip install . --no-build-isolation | |
| echo "::endgroup::" | |
| echo "::group::Run lowbit tests" | |
| ${CONDA_RUN} python -m pytest torchao/experimental/ops/mps/test/test_lowbit.py | |
| echo "::endgroup::" | |
| echo "::group::Run quantizer tests" | |
| ${CONDA_RUN} python -m pytest torchao/experimental/ops/mps/test/test_quantizer.py | |
| echo "::endgroup::" |