Skip to content

Lint fixes test/quantization #1359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include = [
"torchao/sparsity/**/*.py",
"torchao/prototype/low_bit_optim/**.py",
"test/float8/**/*.py",
"test/quantization/test_observer.py",
"test/quantization/**/*.py",
"test/dtypes/**/*.py",
"test/prototype/low_bit_optim/**.py",
"torchao/utils.py",
Expand Down
15 changes: 9 additions & 6 deletions test/quantization/test_galore_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import pytest

# Skip entire test if triton is not available, otherwise CI failure
try:
import triton
except ImportError:
pytest.skip("triton is not installed", allow_module_level=True)

from bitsandbytes.functional import create_dynamic_map, quantize_blockwise, dequantize_blockwise
try: # noqa: F401
import triton # noqa: F401
except ImportError: # noqa: F401
pytest.skip("triton is not installed", allow_module_level=True) # noqa: F401
import torch
from bitsandbytes.functional import (
create_dynamic_map,
dequantize_blockwise,
quantize_blockwise,
)

from torchao.prototype.galore.kernels import (
triton_dequant_blockwise,
Expand Down
8 changes: 6 additions & 2 deletions test/quantization/test_marlin_qqq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import unittest

import pytest
import torch
Expand All @@ -19,9 +20,12 @@
choose_qparams_and_quantize_affine_qqq,
)
from torchao.utils import TORCH_VERSION_AT_LEAST_2_5, is_fbcode
import unittest

@unittest.skipIf(is_fbcode(), "Skipping the test in fbcode since we don't have TARGET file for kernels")

@unittest.skipIf(
is_fbcode(),
"Skipping the test in fbcode since we don't have TARGET file for kernels",
)
class TestMarlinQQQ(TestCase):
def setUp(self):
super().setUp()
Expand Down
Loading
Loading