Skip to content
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
7 changes: 0 additions & 7 deletions bitsandbytes/nn/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,6 @@ def from_prequantized(

return self

@classmethod
def __torch_function__(cls, func, types, args=(), kwargs=None):
if kwargs is None:
kwargs = {}
with torch._C.DisableTorchFunctionSubclass():
return func(*args, **kwargs)

def _quantize(self, device):
w = self.data.contiguous().to(device)
w_4bit, quant_state = bnb.functional.quantize_4bit(
Expand Down
5 changes: 1 addition & 4 deletions tests/test_linear4bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,7 @@ def test_params4bit_real_serialization(device, quant_type, blocksize, compress_s
@pytest.mark.parametrize("mode", ["default", "reduce-overhead"], ids=id_formatter("mode"))
@pytest.mark.skipif(torch.__version__ < (2, 4), reason="Not supported in torch < 2.4")
def test_linear4bit_torch_compile(device, quant_type, compute_dtype, compress_statistics, bias, fullgraph, mode):
if device == "cpu" and quant_type == "fp4":
pytest.skip("FP4 is not supported for CPU")

if fullgraph and torch.__version__ < (2, 8):
if fullgraph and torch.__version__ < (2, 8, 0, "dev"):
pytest.skip("fullgraph mode requires torch 2.8 or higher")

if device == "cuda" and platform.system() == "Windows":
Expand Down