diff --git a/.github/workflows/float8_test.yml b/.github/workflows/float8_test.yml index 915c5872b2..b96e533537 100644 --- a/.github/workflows/float8_test.yml +++ b/.github/workflows/float8_test.yml @@ -1,14 +1,10 @@ -name: Run Float8 Tests +name: Run Float8 Tests Nightly on: - push: - branches: - - main - - 'gh/**' - pull_request: - branches: - - main - - 'gh/**' + schedule: + # 3.27 am PST every day + - cron: "27 11 * * *" + workflow_dispatch: concurrency: group: float8_test-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} @@ -53,3 +49,8 @@ jobs: pip install -r dev-requirements.txt pip install . pytest test/float8 --verbose -s + pytest test/dtypes/test_affine_quantized_float.py --verbose -s + # Float8nocompile tests + cd torchao/prototype/float8nocompile + pytest kernels/ --verbose -s + pytest test/train_test.py --verbose -s diff --git a/test/dtypes/test_affine_quantized_float.py b/test/dtypes/test_affine_quantized_float.py index 78004c6f5e..410ab9f42a 100644 --- a/test/dtypes/test_affine_quantized_float.py +++ b/test/dtypes/test_affine_quantized_float.py @@ -147,7 +147,10 @@ def test_fp8_linear_variants( ) def test_invalid_granularity(self): with pytest.raises(ValueError, match="Invalid granularity specification"): - float8_dynamic_activation_float8_weight(granularity="invalid") + model = ToyLinearModel(64, 64).eval().to(torch.float32).to("cuda") + quantize_( + model, float8_dynamic_activation_float8_weight(granularity="invalid") + ) @unittest.skipIf( not is_sm_at_least_89(), "Requires GPU with compute capability >= 8.9" @@ -157,7 +160,13 @@ def test_mismatched_granularity(self): ValueError, match="Different granularities for activation and weight are not supported", ): - float8_dynamic_activation_float8_weight(granularity=(PerTensor(), PerRow())) + model = ToyLinearModel(64, 64).eval().to(torch.float32).to("cuda") + quantize_( + model, + float8_dynamic_activation_float8_weight( + granularity=(PerTensor(), PerRow()) + ), + ) @unittest.skipIf( not is_sm_at_least_89(), "Requires GPU with compute capability >= 8.9" @@ -166,9 +175,16 @@ def test_unsupported_granularity(self): class UnsupportedGranularity: pass - with pytest.raises(ValueError, match="Invalid granularity types"): - float8_dynamic_activation_float8_weight( - granularity=(UnsupportedGranularity(), UnsupportedGranularity()) + with pytest.raises( + ValueError, + match="Invalid granularity types:", + ): + model = ToyLinearModel(64, 64).eval().to(torch.float32).to("cuda") + quantize_( + model, + float8_dynamic_activation_float8_weight( + granularity=(UnsupportedGranularity(), UnsupportedGranularity()) + ), ) @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available")