Skip to content

Commit ef4d0e1

Browse files
authored
Move some experimental tests (#2965)
* Migrate tests from torchao/experimental * up
1 parent 10ba659 commit ef4d0e1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/torchao_experimental_test.yml renamed to .github/workflows/regression_test_aarch64.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run TorchAO Experimental Tests
1+
name: Run Regression Tests (aarch64)
22

33
on:
44
push:
@@ -44,17 +44,19 @@ jobs:
4444
if: runner.os == 'Linux'
4545
run: |
4646
conda activate venv
47+
pip install coremltools
4748
pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall
4849
pip install -r dev-requirements.txt
4950
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 .
5051
- name: Run python tests
5152
run: |
5253
conda activate venv
53-
pytest -s test/quantization/test_int8_dynamic_activation_intx_weight_config_v1.py
54-
pytest -s torchao/experimental/tests/test_embedding_xbit_quantizer.py
5554
pytest -s torchao/experimental/tests/test_quant_passes.py
56-
pytest -s test/prototype/test_dynamic_activation_lut.py
55+
pytest -s test/quantization/test_int8_dynamic_activation_intx_weight_config_v1.py
56+
pytest -s test/quantization/test_embedding_xbit_quantizer.py
5757
pytest -s test/quantization/quantize_/workflows/intx/test_intx_opaque_tensor.py
58+
pytest -s test/prototype/test_dynamic_activation_lut.py
59+
pytest -s test/prototype/test_groupwise_lowbit_weight_lut_quantizer.py
5860
- name: torchao/csrc/cpu - build and run C++ tests
5961
if: runner.os == 'macOS'
6062
run: |

torchao/experimental/tests/test_groupwise_lowbit_weight_lut_quantizer.py renamed to test/prototype/test_groupwise_lowbit_weight_lut_quantizer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
group_size_to_block_shapes,
2121
)
2222
from torchao.quantization.quant_api import quantize_
23+
from torchao.quantization.quantize_.workflows.intx.intx_opaque_tensor import (
24+
_is_kernel_library_loaded,
25+
)
2326

2427

28+
@unittest.skipIf(not _is_kernel_library_loaded(), "Need torchao lowbit kernels")
2529
class TestGroupwiseLowbitWeightLut(unittest.TestCase):
2630
"""
2731
Test suite for the GroupwiseLutWeight quantization scheme, updated for the

torchao/experimental/tests/test_embedding_xbit_quantizer.py renamed to test/quantization/test_embedding_xbit_quantizer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@
3232
MappingType,
3333
quantize_,
3434
)
35+
from torchao.quantization.quantize_.workflows.intx.intx_opaque_tensor import (
36+
_is_kernel_library_loaded,
37+
)
3538
from torchao.quantization.utils import compute_error
3639

3740

41+
@unittest.skipIf(not _is_kernel_library_loaded(), "Need torchao lowbit kernels")
3842
class TestEmbeddingQuantizer(unittest.TestCase):
3943
def test_accuracy(self):
4044
granularity = PerGroup(128)

0 commit comments

Comments
 (0)