MCPcopy Create free account

hub / github.com/bitsandbytes-foundation/bitsandbytes / functions

Functions720 in github.com/bitsandbytes-foundation/bitsandbytes

↓ 51 callersMethodto
(self, device)
bitsandbytes/functional.py:580
↓ 51 callersMethodto
( self: T, device: Optional[int | device] = ..., dtype: Optional[dtype | str] = ...,
bitsandbytes/nn/modules.py:411
↓ 30 callersFunctionis_supported_on_hpu
Check if the given quant_type, dtype and quant_storage are supported on HPU.
tests/helpers.py:106
↓ 17 callersMethodbackward
(ctx, grad_output)
bitsandbytes/autograd/_functions.py:365
↓ 14 callersMethodstep
Performs a single optimization step. Args: closure (callable, optional): A closure that reevaluates the model and
bitsandbytes/optim/lars.py:206
↓ 13 callersMethodstate_dict
Return optimizer state, wrapping quantization tensors for FSDP compatibility. FSDP's full_optim_state_dict gathers all tensor states across r
bitsandbytes/optim/optimizer.py:161
↓ 10 callersMethod__init__
Args: num_embeddings (`int`): The number of unique embeddings (vocabulary size). embedding_dim (`int`
bitsandbytes/nn/modules.py:139
↓ 10 callersFunctionget_ptr
Gets the memory address of the first element of a tenso Args: A (`Optional[Tensor]`): A PyTorch tensor. Returns: `Optional[c
bitsandbytes/functional.py:405
↓ 9 callersMethodas_dict
returns dict of tensors and strings to use in serialization via _save_to_state_dict() param: packed -- returns dict[str, torch.Tensor
bitsandbytes/functional.py:545
↓ 9 callersFunctionreplace_parameter_4bit
Replace a module parameter with a 4-bit quantized version using parametrization. This function quantizes an existing parameter in a PyTorch
bitsandbytes/nn/parametrize.py:62
↓ 8 callersMethod__new__
( cls, data: Optional[torch.Tensor] = None, requires_grad=False, # quantized weights
bitsandbytes/nn/modules.py:214
↓ 8 callersFunction_cuda_device_of
(a: torch.Tensor)
bitsandbytes/functional.py:82
↓ 7 callersFunctionget_cuda_bnb_library_path
Get the path to the best matching CUDA/ROCm BNB native library for the given specs. When no override is set, selects from packaged libraries
bitsandbytes/cextension.py:22
↓ 7 callersMethodload_state_dict
Load an optimizer state. Arguments: state_dict (`dict`): An optimizer state (should be returned from a call to `s
bitsandbytes/optim/optimizer.py:192
↓ 6 callersMethod__init__
( self, params: Iterable[torch.nn.Parameter], lr: float = 1e-3, betas: tuple[f
bitsandbytes/optim/ademamix.py:108
↓ 6 callersMethodget_config
(self, gindex, pindex, group)
bitsandbytes/optim/optimizer.py:343
↓ 5 callersMethod__init__
Base Lion optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. l
bitsandbytes/optim/lion.py:9
↓ 5 callersMethod__init__
Base AdamW optimizer. Arguments: params (`torch.Tensor`): The input parameters to optimize.
bitsandbytes/optim/adamw.py:10
↓ 5 callersMethod__init__
Base Adam optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. l
bitsandbytes/optim/adam.py:10
↓ 5 callersFunction_get_4bit_code
(quant_type: str, device: torch.device)
bitsandbytes/backends/utils.py:69
↓ 5 callersMethodcuda
(self, device: Optional[int | device | str] = None, non_blocking: bool = False)
bitsandbytes/nn/modules.py:400
↓ 5 callersMethodfrom_dict
unpacks components of state_dict into QuantState where necessary, convert into strings, torch.dtype, ints, etc. qs_dict: bas
bitsandbytes/functional.py:494
↓ 5 callersMethodget_instance
(cls)
bitsandbytes/optim/optimizer.py:44
↓ 4 callersFunctionall_issues
(data: dict)
agents/query_issues.py:167
↓ 4 callersMethodfill_qmap
(self)
bitsandbytes/optim/optimizer.py:157
↓ 4 callersFunctionis_on_gpu
Verifies that the input tensors are all on the same device. An input tensor may also be marked as `paged`, in which case the device placement is
bitsandbytes/functional.py:351
↓ 4 callersFunctionprint_dedented
(text)
bitsandbytes/diagnostics/utils.py:11
↓ 4 callersMethodto
(self, *args, **kwargs)
bitsandbytes/nn/modules.py:1165
↓ 3 callersMethod__init__
Base LARS optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. l
bitsandbytes/optim/lars.py:12
↓ 3 callersMethod__init__
(self, initial_data)
bitsandbytes/optim/optimizer.py:21
↓ 3 callersMethod__init__
(self, device, dtype)
tests/test_parametrize.py:106
↓ 3 callersFunction_convert_weight_packed_for_cpu_inverse
packed_weight: [N, K/2] uint8, output of `_convert_weight_packed_for_cpu` (final_qweight) quant_state: QuantState that was modified by `_co
bitsandbytes/functional.py:1730
↓ 3 callersFunction_dequantize_4bit_compute
( A_flat: torch.Tensor, absmax: torch.Tensor, code: torch.Tensor, blocksize: int, shape: S
bitsandbytes/backends/default/ops.py:263
↓ 3 callersFunction_get_kernel
()
bitsandbytes/backends/mps/ops.py:36
↓ 3 callersFunction_get_tensor_stream
(tensor: Tensor)
bitsandbytes/functional.py:393
↓ 3 callersFunction_register_parametrization_hooks
(module: nn.Module, param_name: str)
bitsandbytes/nn/parametrize.py:143
↓ 3 callersFunctionassert_most_approx_close
(a, b, rtol=1e-3, atol=1e-3, max_error_count=0)
tests/test_optim.py:19
↓ 3 callersFunctioncreate_optimizer
Create a bnb optimizer by name.
examples/xpu/paged_xpu_training.py:84
↓ 3 callersFunctiondequant_8bit_blockwise_kernel_util
( a_ptr, offsets, code_ptr, absmax_ptr, mask, BLOCK_SIZE: tl.constexpr, )
bitsandbytes/backends/triton/kernels_8bit_quant.py:180
↓ 3 callersFunctiondequantize_blockwise
Dequantize a tensor in blocks of values. The input tensor is dequantized by dividing it into blocks of `blocksize` values. The the absolute m
bitsandbytes/functional.py:689
↓ 3 callersFunctiondiv_up
csrc/cpu_ops.h:58
↓ 3 callersFunctionextract_signatures
Extract error types, library names, and technical terms. These are specific, discriminative terms — not general words like 'cuda' which appea
agents/query_issues.py:285
↓ 3 callersFunctionformat_compact
One-line summary of an issue.
agents/query_issues.py:171
↓ 3 callersMethodget_context
(self, device)
bitsandbytes/functional.py:65
↓ 3 callersFunctionget_cuda_version_tuple
Get CUDA/HIP version as a tuple of (major, minor).
bitsandbytes/cuda_specs.py:28
↓ 3 callersMethodget_instance
(cls)
bitsandbytes/utils.py:80
↓ 3 callersMethodget_state_buffer
(self, p, dtype=torch.float32)
bitsandbytes/optim/optimizer.py:374
↓ 3 callersFunctionget_torch_dtype
(name)
examples/xpu/paged_xpu_training.py:142
↓ 3 callersFunctionget_torch_dtype
(name)
examples/cpu/cpu_training.py:148
↓ 3 callersMethodis_initialized
(self)
bitsandbytes/utils.py:63
↓ 3 callersFunctionprepare_data
Load and tokenize a small subset of Alpaca.
examples/xpu/paged_xpu_training.py:65
↓ 3 callersFunctionprepare_data
(tokenizer, dataset_name, max_length, num_samples=200)
examples/cpu/cpu_training.py:73
↓ 3 callersFunctionquantize_8bit_blockwise_kernel_util
( a, code_ptr, CODE_SIZE: tl.constexpr, BLOCK_SIZE: tl.constexpr, N_PER_TH: tl.constexpr,
bitsandbytes/backends/triton/kernels_8bit_quant.py:137
↓ 3 callersMethodreset
(self)
tests/test_functional.py:97
↓ 3 callersMethodrun
(self)
setup.py:21
↓ 3 callersMethodto
( self: T, device: Optional[int | device] = ..., dtype: Optional[dtype | str] = ...,
bitsandbytes/nn/modules.py:772
↓ 3 callersMethodvectorwise_quant
Reference implementation
tests/test_functional.py:369
↓ 2 callersMethod__getstate__
(self)
bitsandbytes/nn/modules.py:244
↓ 2 callersMethod__init__
(self, lib: ct.CDLL)
bitsandbytes/cextension.py:87
↓ 2 callersMethod__init__
Base LAMB optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. l
bitsandbytes/optim/lamb.py:9
↓ 2 callersMethod__init__
Base SGD optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. lr
bitsandbytes/optim/sgd.py:9
↓ 2 callersMethod__init__
Base Adagrad optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize.
bitsandbytes/optim/adagrad.py:9
↓ 2 callersMethod__init__
Base RMSprop optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize.
bitsandbytes/optim/rmsprop.py:9
↓ 2 callersMethod__setstate__
(self, state)
bitsandbytes/nn/modules.py:250
↓ 2 callersFunction_dequantize_4bit_impl
( A: torch.Tensor, absmax: torch.Tensor, blocksize: int, quant_type: str, shape: Sequence[
bitsandbytes/backends/mps/ops.py:145
↓ 2 callersFunction_dequantize_4bit_impl
( A: torch.Tensor, absmax: torch.Tensor, blocksize: int, quant_type: str, dtype: torch.dty
bitsandbytes/backends/cuda/ops.py:454
↓ 2 callersFunction_dequantize_blockwise_impl
( A: torch.Tensor, absmax: torch.Tensor, code: torch.Tensor, blocksize: int, dtype: torch.dtype, out: torc
bitsandbytes/backends/cuda/ops.py:358
↓ 2 callersFunction_find_cuda_libs
Return a {(major, minor): Path} mapping for all packaged CUDA/ROCm library files.
bitsandbytes/cextension.py:139
↓ 2 callersFunction_get_4bit_quantize_bounds
(quant_type: str, device: torch.device)
bitsandbytes/backends/default/ops.py:226
↓ 2 callersMethod_reset
(self)
tests/test_parametrize.py:447
↓ 2 callersFunction_split_cuda_version
Split a compact CUDA/ROCm version string from a library filename into (major, minor). CUDA: major is always 2 digits (11, 12, 13...), e.g. '118'
bitsandbytes/cextension.py:127
↓ 2 callersMethodapply
csrc/cpu_ops.cpp:688
↓ 2 callersFunctionassert_all_approx_close
(a, b, rtol=1e-3, atol=1e-3, count=0, throw=True)
tests/test_functional.py:39
↓ 2 callersFunctionbf16_to_float
csrc/cpu_ops.h:146
↓ 2 callersFunctioncaplog_at_level
(caplog, level, logger_name)
tests/test_modules.py:14
↓ 2 callersFunctioncheck_matmul
(A, B, out, transposed_A, transposed_B, expected_type=torch.int8)
bitsandbytes/functional.py:1216
↓ 2 callersFunctioncleanup
Force cleanup of GPU memory.
examples/xpu/benchmark_paged_memory.py:74
↓ 2 callersFunctioncreate_dynamic_map
Creates the dynamic quantiztion map. The dynamic data type is made up of a dynamic exponent and fraction. As the exponent increase from
bitsandbytes/functional.py:296
↓ 2 callersFunctioncreate_model
Create a LLaMA model from config (no download needed).
examples/xpu/benchmark_paged_memory.py:52
↓ 2 callersFunctioncreate_optimizer
(model, name, lr)
examples/cpu/cpu_training.py:91
↓ 2 callersFunctiondequantize_4bit
Dequantizes a packed 4-bit quantized tensor. The input tensor is dequantized by dividing it into blocks of `blocksize` values. The absolute m
bitsandbytes/functional.py:992
↓ 2 callersFunctionelementwise_func
(func_name, A, B, value, prefetch=True)
bitsandbytes/functional.py:112
↓ 2 callersFunctionfind_related
Find issues related to target. Returns list of (score, issue, sig_overlap, token_overlap).
agents/query_issues.py:314
↓ 2 callersFunctionfix_4bit_weight_quant_state_from_module
(module: Union["Embedding4bit", "Linear4bit"])
bitsandbytes/nn/modules.py:487
↓ 2 callersFunctionfloat_to_bf16
csrc/cpu_ops.h:139
↓ 2 callersFunctionfloat_to_fp16
csrc/cpu_ops.h:153
↓ 2 callersFunctionformat_related_result
Format a single related-issue result.
agents/query_issues.py:345
↓ 2 callersFunctionfp16_to_float
csrc/cpu_ops.h:202
↓ 2 callersFunctionget_4bit_type
(typename, device=None, blocksize=64)
bitsandbytes/functional.py:772
↓ 2 callersFunctionget_accelerator
Return the torch accelerator module (torch.cuda / torch.xpu).
examples/xpu/benchmark_paged_memory.py:41
↓ 2 callersFunctionget_cuda_specs
Get CUDA/HIP specifications.
bitsandbytes/cuda_specs.py:55
↓ 2 callersMethodget_hvalue
(self, weight)
bitsandbytes/utils.py:66
↓ 2 callersMethodget_instance
(cls)
bitsandbytes/functional.py:59
↓ 2 callersFunctionhas_avx512bf16
Try calling native lib.has_avx512bf16_cpu(). Return False explicitly if symbol missing or call fails.
bitsandbytes/functional.py:1798
↓ 2 callersFunctionhas_avx512bf16
csrc/cpu_ops.h:350
↓ 2 callersFunctionhas_avx512f
csrc/cpu_ops.h:340
↓ 2 callersMethodinitialize
(self, model)
bitsandbytes/utils.py:50
↓ 2 callersMethodinitialize
(self)
bitsandbytes/functional.py:55
↓ 2 callersFunctionneon_bf16x4_to_f32
NEON-optimized BF16 to float conversion (4 values at a time)
csrc/cpu_ops.cpp:135
↓ 2 callersFunctionneon_f32_to_bf16x4
NEON-optimized float to BF16 conversion (4 values at a time, with rounding)
csrc/cpu_ops.cpp:143
next →1–100 of 720, ranked by callers