Skip to content
Open
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: 7 additions & 0 deletions bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ def matmul_4bit(
out: Optional[torch.Tensor] = None,
bias: Optional[torch.Tensor] = None,
):
"""Apply a linear transformation to `A` using the packed 4-bit weights `B`.

On CUDA, the input shape, GPU architecture, and dtype influence whether the
operation uses a fused kernel or dequantizes the weights before calling
`torch.nn.functional.linear`. Floating-point rounding can differ between
these paths, including when a change in batch size switches kernels.
"""
if quant_state is None:
raise ValueError("quant_state is required")
if len(quant_state.shape) != 2:
Expand Down
4 changes: 4 additions & 0 deletions docs/source/reference/nn/linear4bit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@

[[autodoc]] bitsandbytes.nn.Params4bit
- __init__

## matmul_4bit

[[autodoc]] bitsandbytes.matmul_4bit