MCPcopy Create free account

hub / github.com/kyegomez/BitNet / functions

Functions143 in github.com/kyegomez/BitNet

↓ 4 callersMethod__init__
( self, num_tokens: int, sequence_length: int, config: MambaConfig, re
bitnet/bit_mamba.py:488
↓ 4 callersMethod__init__
Initialize the RMSNorm normalization layer. Args: dim (int): The dimension of the input tensor. eps (float,
bitnet/bit_llama.py:34
↓ 4 callersFunctionbitnet_model
A fixture to create an instance of BitNetTransformer model
tests/tests.py:144
↓ 3 callersMethod__init__
(self, heads, dim)
bitnet/one_bit_vision_transformers.py:35
↓ 2 callersMethod__init__
(self, dim: int, dropout: int = 0.1)
bitnet/bit_moe.py:23
↓ 2 callersMethod__init__
(self, dim, affine=True)
bitnet/bit_transformer.py:30
↓ 2 callersFunctioncycle
(loader)
train.py:24
↓ 2 callersFunctiondecode_tokens
(tokens)
train.py:33
↓ 2 callersMethodforward
Forward pass through the RMSNorm layer. Args: x (torch.Tensor): The input tensor. Returns: torch.Te
bitnet/bit_llama.py:64
↓ 2 callersFunctionget_package_version
()
setup.py:159
↓ 2 callersFunctionpair
(t)
bitnet/one_bit_vision_transformers.py:12
↓ 2 callersMethodpscan
(A, X)
bitnet/bit_mamba.py:30
↓ 2 callersFunctionrepeat_kv
torch.repeat_interleave(x, dim=2, repeats=n_rep)
bitnet/bit_llama.py:163
↓ 2 callersFunctionreplace_linears_in_hf
Replaces all instances of nn.Linear in the given model with BitLinear15b. Args: model (nn.Module): The model to modify. Returns
bitnet/replace_hf.py:6
↓ 2 callersMethodstep
(self, x, caches)
bitnet/bit_mamba.py:533
↓ 1 callersMethod__init__
( self, dim_in: int, dim_out: int, activation: Callable, mult_bias: bo
bitnet/bit_ffn.py:30
↓ 1 callersMethod_norm
Apply the RMSNorm normalization to the input tensor. Args: x (torch.Tensor): The input tensor. Returns:
bitnet/bit_llama.py:51
↓ 1 callersMethod_reset_parameters
(self)
bitnet/bit_attention.py:253
↓ 1 callersFunctionactivation_quant
Per token quantization to 8bits. No grouping is needed for quantization Args: x (Tensor): _description_ Returns: _type_: _de
bitnet/bit_lora.py:14
↓ 1 callersFunctionactivation_quant
Per token quantization to 8bits. No grouping is needed for quantization Args: x (Tensor): _description_ Returns: _type_: _de
bitnet/bitlinear.py:6
↓ 1 callersFunctionactivation_quant
Per token quantization to 8bits. No grouping is needed for quantization Args: x (Tensor): _description_ Returns: _type_: _de
bitnet/bit_linear_new.py:6
↓ 1 callersFunctionappend_nvcc_threads
(nvcc_extra_args)
setup.py:82
↓ 1 callersFunctionapply_rotary_emb
Apply rotary embeddings to input tensors using the given frequency tensor. This function applies rotary embeddings to the given query 'xq' a
bitnet/bit_llama.py:131
↓ 1 callersMethodbackward
Flows the gradient from the output to the input. Returns two new tensors. Args: ctx : A_in : (B, L, D, N), X : (B, D, L,
bitnet/bit_mamba.py:103
↓ 1 callersFunctioncheck_if_cuda_home_none
(global_option: str)
setup.py:70
↓ 1 callersMethoddecode_tokens
Decodes a sequence of tokens into a string.
bitnet/inference.py:52
↓ 1 callersFunctiondefault
(val, d)
bitnet/bit_ffn.py:9
↓ 1 callersFunctionexists
(val)
bitnet/at.py:9
↓ 1 callersMethodgenerate
Generates autoregressive sequences based on the given start tokens. Args: start_tokens (torch.Tensor): The initial token
bitnet/at.py:53
↓ 1 callersFunctionget_cuda_bare_metal_version
(cuda_dir)
setup.py:59
↓ 1 callersFunctionget_platform
Returns the platform name as used in wheel filenames.
setup.py:44
↓ 1 callersFunctionget_wheel_url
()
setup.py:170
↓ 1 callersFunctioninit_zero_
(tensor)
bitnet/bit_ffn.py:13
↓ 1 callersFunctionl2norm
(t, dim=-1)
bitnet/bit_transformer.py:11
↓ 1 callersFunctionposemb_sincos_2d
(h, w, dim, temperature: int = 10000, dtype=torch.float32)
bitnet/one_bit_vision_transformers.py:16
↓ 1 callersFunctionprecompute_freqs_cis
Precompute the frequency tensor for complex exponentials (cis) with given dimensions. This function calculates a frequency tensor with compl
bitnet/bit_llama.py:79
↓ 1 callersFunctionreshape_for_broadcast
Reshape frequency tensor for broadcasting it with another tensor. This function reshapes the frequency tensor to have the same shape as the
bitnet/bit_llama.py:106
↓ 1 callersFunctionscaled_dot_product_gqa
Scaled dot product attention with support for grouped queries. Einstein notation: - b: batch size - n / s: sequence length - h: numbe
bitnet/bit_attention.py:10
↓ 1 callersMethodselective_scan
(self, x, delta, A, B, C, D)
bitnet/bit_mamba.py:317
↓ 1 callersMethodselective_scan_seq
(self, x, delta, A, B, C, D)
bitnet/bit_mamba.py:342
↓ 1 callersMethodssm
(self, x)
bitnet/bit_mamba.py:288
↓ 1 callersMethodssm_step
(self, x, h)
bitnet/bit_mamba.py:438
↓ 1 callersFunctiontop_k
(logits, thres=0.9)
bitnet/at.py:27
↓ 1 callersFunctionweight_quant
(w: Tensor)
bitnet/bit_lora.py:7
↓ 1 callersFunctionweight_quant
(w: Tensor)
bitnet/bitlinear.py:20
↓ 1 callersFunctionweight_quant
(w: Tensor)
bitnet/bit_linear_new.py:20
Method__getitem__
(self, index)
train.py:61
Method__init__
(self, data, seq_len)
train.py:56
Method__init__
(self, dim: int, eps: float = 1e-5)
bitnet/bit_mamba.py:14
Method__init__
(self, config: MambaConfig)
bitnet/bit_mamba.py:168
Method__init__
(self, config: MambaConfig)
bitnet/bit_mamba.py:197
Method__init__
( self, dim: int, # D num_tokens: int, sequence_length: int, depth: i
bitnet/bit_mamba.py:567
Method__init__
( self, embed_dim: int, query_heads: int = 8, kv_heads: int = 4, dropo
bitnet/bit_attention.py:169
Method__init__
(self, dim, hidden_dim)
bitnet/one_bit_vision_transformers.py:49
Method__init__
(self, dim, depth, heads, dim_head, mlp_dim)
bitnet/one_bit_vision_transformers.py:63
Method__init__
( self, *, image_size, patch_size, num_classes, dim, d
bitnet/one_bit_vision_transformers.py:110
Method__init__
Initialize the Attention module. Args: args (ModelArgs): Model configuration parameters. Attributes:
bitnet/bit_llama.py:178
Method__init__
Initialize the FeedForward module. Args: dim (int): Input dimension. hidden_dim (int): Hidden dimension of t
bitnet/bit_llama.py:314
Method__init__
Initialize a TransformerBlock. Args: layer_id (int): Identifier for the layer. args (ModelArgs): Model confi
bitnet/bit_llama.py:358
Method__init__
Initialize a Transformer model. Args: params (ModelArgs): Model configuration parameters. Attributes:
bitnet/bit_llama.py:420
Method__init__
(self, rank: int = 4, lora_alpha: int = 1, *args, **kwargs)
bitnet/bit_lora.py:50
Method__init__
(self, dim, num_experts, top_k)
bitnet/bit_moe.py:56
Method__init__
(self, dim: int, num_experts: int, top_k: int = 2)
bitnet/bit_moe.py:93
Method__init__
( self, dim: int, dim_out: Optional[int] = None, mult: int = 4, glu: b
bitnet/bit_ffn.py:77
Method__init__
( self, dim: int, heads: int, depth: int, ff_mult: int = 2, *args, **kwargs )
bitnet/bit_transformer.py:58
Method__init__
( self, dim: int, depth: int, num_tokens: int, heads: int = 8,
bitnet/bit_transformer.py:118
Method__init__
Parameters ---------- device : str, optional The device to run the model on ('cpu' or 'cuda'). By default, 'cuda'
bitnet/inference.py:29
Method__init__
(self, net, max_seq_len=2048, pad_value=0)
bitnet/at.py:45
Method__len__
(self)
train.py:66
Method__post_init__
(self)
bitnet/bit_mamba.py:160
Functiondecode_token
(token)
train.py:29
Methoddecode_token
Decodes a token into a character.
bitnet/inference.py:47
Functioneval_decorator
(fn)
bitnet/at.py:13
Methodforward
(self, x)
bitnet/bit_mamba.py:20
Methodforward
Applies the parallel scan operation, as defined above. Returns a new tensor. Args: A_in : (B, L, D, N) X_in
bitnet/bit_mamba.py:75
Methodforward
(self, x)
bitnet/bit_mamba.py:174
Methodforward
(self, x)
bitnet/bit_mamba.py:260
Methodforward
(self, x)
bitnet/bit_mamba.py:512
Methodforward
(self, x)
bitnet/bit_mamba.py:640
Methodforward
( self, query: Tensor, key: Tensor, value: Tensor, need_weights: bool
bitnet/bit_attention.py:274
Methodforward
(self, x)
bitnet/one_bit_vision_transformers.py:40
Methodforward
(self, x)
bitnet/one_bit_vision_transformers.py:58
Methodforward
(self, x)
bitnet/one_bit_vision_transformers.py:74
Methodforward
(self, img)
bitnet/one_bit_vision_transformers.py:157
Methodforward
Forward pass of the attention module. Args: x (torch.Tensor): Input tensor. start_pos (int): Starting positi
bitnet/bit_llama.py:253
Methodforward
(self, x)
bitnet/bit_llama.py:353
Methodforward
Perform a forward pass through the TransformerBlock. Args: x (torch.Tensor): Input tensor. start_pos (int):
bitnet/bit_llama.py:392
Methodforward
Perform a forward pass through the Transformer model. Args: tokens (torch.Tensor): Input token indices. star
bitnet/bit_llama.py:464
Methodforward
Forward pass of the BitLora layer. Args: x (Tensor): The input tensor. Returns: Tensor: The output
bitnet/bit_lora.py:63
Methodforward
Forward pass of the BitLinear layer. Args: x (Tensor): The input tensor. Returns: Tensor: The outpu
bitnet/bitlinear.py:42
Methodforward
(self, x)
bitnet/bit_moe.py:32
Methodforward
Forward pass of the NoisyTopkRouter module. Args: mh_output (torch.Tensor): The output tensor from the multihead self at
bitnet/bit_moe.py:62
Methodforward
(self, x)
bitnet/bit_moe.py:99
Methodforward
(self, x: Tensor)
bitnet/bit_ffn.py:53
Methodforward
Forward pass of the BitFeedForward module. Args: x (torch.Tensor): The input tensor. Returns: torch
bitnet/bit_ffn.py:125
Methodforward
(self, x)
bitnet/bit_transformer.py:35
Methodforward
(self, x: Tensor, *args, **kwargs)
bitnet/bit_transformer.py:82
Methodforward
(self, x)
bitnet/bit_transformer.py:142
Methodforward
Forward pass of the BitLinear layer. Args: x (Tensor): The input tensor. Returns: Tensor: The outpu
bitnet/bit_linear_new.py:42
Methodforward
(self, x, **kwargs)
bitnet/at.py:104
next →1–100 of 143, ranked by callers