Skip to content

[benchmarks] Add inference-only roofline for float8 #1457

[benchmarks] Add inference-only roofline for float8

[benchmarks] Add inference-only roofline for float8 #1457

name: Run Regression Tests (aarch64)
on:
push:
branches:
- main
- 'gh/**'
pull_request:
branches:
- main
- 'gh/**'
jobs:
test-cpu-ops:
strategy:
matrix:
runner: [macos-14, linux.arm64.2xlarge]
runs-on: ${{matrix.runner}}
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.10"
miniconda-version: "latest"
activate-environment: venv
- name: Install requirements mac
if: runner.os == 'macOS'
run: |
conda activate venv
# Install executorch first because it installs its own version
# of torch and torchao, which we do not want to use
pip install executorch
pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall
pip install -r dev-requirements.txt
USE_CPP=1 TORCHAO_BUILD_KLEIDIAI=1 pip install .
- name: Install requirements linux
if: runner.os == 'Linux'
run: |
conda activate venv
pip install coremltools
pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall
pip install -r dev-requirements.txt
BUILD_TORCHAO_EXPERIMENTAL=1 TORCHAO_BUILD_CPU_AARCH64=1 TORCHAO_BUILD_KLEIDIAI=1 TORCHAO_ENABLE_ARM_NEON_DOT=1 TORCHAO_PARALLEL_BACKEND=OPENMP pip install .
- name: Run python tests
run: |
conda activate venv
pytest -s test/quantization/test_int8_dynamic_activation_intx_weight_config_v1.py
pytest -s test/quantization/quantize_/workflows/intx/test_intx_opaque_tensor.py
pytest -s test/prototype/test_embedding.py
pytest -s test/prototype/test_int8_lut_tensor.py
pytest -s test/prototype/test_tensor_conversion.py
pytest -s test/prototype/test_groupwise_lowbit_weight_lut_quantizer.py
pytest -s test/prototype/test_parq.py
- name: torchao/csrc/cpu - build and run C++ tests
if: runner.os == 'macOS'
run: |
conda activate venv
pushd torchao/csrc/cpu
sh build_and_run_tests.sh
rm -rf cmake-out
popd
- name: torchao/csrc/cpu - build benchmarks
if: runner.os == 'macOS'
run: |
conda activate venv
pushd torchao/csrc/cpu
sh build_and_run_benchmarks.sh build_only
rm -rf cmake-out
popd
- name: torchao/csrc/cpu - build shared_kernels with ExecuTorch
if: runner.os == 'macOS'
run: |
conda activate venv
pushd torchao/csrc/cpu
sh build_shared_kernels.sh executorch
rm -rf 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: |
# conda run -n test-mps-ops-env pip install torch --index-url "https://download.pytorch.org/whl/nightly/cpu"
# - name: Print torch version
# run: |
# conda run -n test-mps-ops-env python -c "import torch; print(torch.__version__)"
# - name: Install requirements
# run: |
# source activate base
# conda activate test-mps-ops-env
# pip install -r dev-requirements.txt
# pip install pyyaml importlib-metadata
# - name: Print pip freeze
# run: |
# conda run -n test-mps-ops-env pip freeze
# - name: Print current directory
# run: |
# conda run -n test-mps-ops-env python -c "import os; print(os.getcwd())"
# - name: Build ao with experimental mps ops
# run: |
# source activate base
# conda activate test-mps-ops-env
# USE_CPP=1 TORCHAO_BUILD_EXPERIMENTAL_MPS=1 pip install .
# - name: Run mps tests
# run: |
# pushd torchao/experimental/ops/mps/test
# conda run -n test-mps-ops-env python test_lowbit.py
# conda run -n test-mps-ops-env python test_quantizer.py
# popd