Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/microsoft/BitNet
/ functions
Functions
397 in github.com/microsoft/BitNet
⨍
Functions
397
◇
Types & classes
61
↓ 39 callers
Method
astype
(self, data_type: DataType)
utils/convert.py:707
↓ 30 callers
Method
write
(self)
utils/convert-hf-to-gguf-bitnet.py:199
↓ 25 callers
Method
load
(model_plus: ModelPlus)
utils/convert.py:372
↓ 24 callers
Method
encode
Encodes a string into a list of token IDs. Args: s (str): The input string to be encoded. bos (bool): W
gpu/tokenizer.py:95
↓ 21 callers
Method
load
(model_plus: ModelPlus)
utils/convert-ms-to-gguf-bitnet.py:372
↓ 18 callers
Function
run_command
Run a system command and ensure it succeeds.
setup_env.py:92
↓ 10 callers
Function
get_model_name
()
setup_env.py:87
↓ 8 callers
Method
astype
(self, data_type: DataType)
utils/convert-ms-to-gguf-bitnet.py:707
↓ 8 callers
Method
close
(self)
utils/convert.py:1210
↓ 7 callers
Method
find_hparam
(self, keys: Sequence[str], optional: bool = False)
utils/convert-hf-to-gguf-bitnet.py:71
↓ 7 callers
Method
find_hparam
(self, keys: Sequence[str], optional: bool = False)
utils/generate-dummy-bitnet-model.py:143
↓ 6 callers
Function
quant_weight_fp16
(weight)
gpu/convert_checkpoint.py:29
↓ 6 callers
Function
quant_weight_int8
(weight)
gpu/convert_checkpoint.py:23
↓ 5 callers
Method
forward_with_attn_bias
( self, token_values: torch.Tensor, attn_bias: AttnBias, cache: list[Layer
gpu/model.py:269
↓ 4 callers
Method
__init__
( self, dim: int, head_dim: int, n_heads: int, n_kv_heads: int,
gpu/model.py:88
↓ 4 callers
Method
get_tensors
(self)
utils/convert-hf-to-gguf-bitnet.py:82
↓ 4 callers
Function
system_info
()
setup_env.py:84
↓ 3 callers
Method
_set_vocab_gpt2
(self)
utils/convert-hf-to-gguf-bitnet.py:366
↓ 3 callers
Function
convert_int8_to_int2
(weight)
gpu/convert_checkpoint.py:34
↓ 3 callers
Method
decode
Decodes a list of token IDs into a string. Args: t (List[int]): The list of token IDs to be decoded. Retu
gpu/tokenizer.py:158
↓ 3 callers
Method
map_tensor_name
(self, name: str, try_suffixes: Sequence[str] = (".weight", ".bias"))
utils/convert-hf-to-gguf-bitnet.py:110
↓ 3 callers
Method
restore_config
Restore original configuration file
utils/tune_gemm_config.py:32
↓ 3 callers
Function
run_command
(command_list, cwd=None, check=True)
utils/convert-helper-bitnet.py:9
↓ 3 callers
Method
set_gguf_parameters
(self)
utils/convert-hf-to-gguf-bitnet.py:116
↓ 2 callers
Method
_set_vocab_sentencepiece
(self)
utils/convert-hf-to-gguf-bitnet.py:376
↓ 2 callers
Method
add_meta_arch
(self, params: Params)
utils/convert-ms-to-gguf-bitnet.py:1150
↓ 2 callers
Method
add_meta_arch
(self, params: Params)
utils/convert.py:1076
↓ 2 callers
Method
add_meta_special_vocab
(self, svocab: gguf.SpecialVocab)
utils/convert-ms-to-gguf-bitnet.py:1219
↓ 2 callers
Method
add_meta_special_vocab
(self, svocab: gguf.SpecialVocab)
utils/convert.py:1150
↓ 2 callers
Method
add_meta_vocab
(self, vocab: Vocab)
utils/convert-ms-to-gguf-bitnet.py:1208
↓ 2 callers
Method
add_meta_vocab
(self, vocab: Vocab)
utils/convert.py:1138
↓ 2 callers
Function
bounded_parallel_map
Parallel map, but with backpressure. If the caller doesn't call `next` fast enough, this will stop calling `func` at some point rather than l
utils/convert-ms-to-gguf-bitnet.py:1076
↓ 2 callers
Function
bounded_parallel_map
Parallel map, but with backpressure. If the caller doesn't call `next` fast enough, this will stop calling `func` at some point rather than l
utils/convert.py:1002
↓ 2 callers
Function
check_vocab_size
(params: Params, vocab: BaseVocab, pad_vocab: bool = False)
utils/convert-ms-to-gguf-bitnet.py:1111
↓ 2 callers
Function
check_vocab_size
(params: Params, vocab: BaseVocab, pad_vocab: bool = False)
utils/convert.py:1037
↓ 2 callers
Method
close
(self)
utils/convert-ms-to-gguf-bitnet.py:1279
↓ 2 callers
Function
convert
(name: str)
utils/convert-ms-to-gguf-bitnet.py:872
↓ 2 callers
Function
convert
(name: str)
utils/convert.py:872
↓ 2 callers
Function
convert_weight_int8_to_int2
(weight)
gpu/pack_weight.py:76
↓ 2 callers
Method
count_model_parts
(dir_model: Path, prefix: str)
utils/convert-hf-to-gguf-bitnet.py:212
↓ 2 callers
Method
count_model_parts
(dir_model: Path, prefix: str)
utils/generate-dummy-bitnet-model.py:284
↓ 2 callers
Method
create_quick_dataset
Create a temporary dataset with only the first N characters for quick testing.
utils/test_perplexity.py:91
↓ 2 callers
Function
do_dump_model
(model_plus: ModelPlus)
utils/convert-ms-to-gguf-bitnet.py:1637
↓ 2 callers
Function
do_dump_model
(model_plus: ModelPlus)
utils/convert.py:1492
↓ 2 callers
Method
encode_header
(self, message: Message)
gpu/tokenizer.py:209
↓ 2 callers
Method
end_phase
Terminate the current phase.
gpu/stats.py:36
↓ 2 callers
Method
generate_config
Generate new configuration file with simplified format
utils/tune_gemm_config.py:37
↓ 2 callers
Method
get_token_score
(self, token_id: int)
utils/convert-ms-to-gguf-bitnet.py:661
↓ 2 callers
Method
get_token_score
(self, token_id: int)
utils/convert.py:661
↓ 2 callers
Method
get_token_type
(self, token_id: int, token_text: bytes, special_ids: set[int])
utils/convert-ms-to-gguf-bitnet.py:653
↓ 2 callers
Method
get_token_type
(self, token_id: int, token_text: bytes, special_ids: set[int])
utils/convert.py:653
↓ 2 callers
Function
lazy_load_file
(path: Path)
utils/convert-ms-to-gguf-bitnet.py:1061
↓ 2 callers
Function
lazy_load_file
(path: Path)
utils/convert.py:987
↓ 2 callers
Method
load_hparams
(dir_model)
utils/convert-hf-to-gguf-bitnet.py:221
↓ 2 callers
Method
load_hparams
(dir_model)
utils/generate-dummy-bitnet-model.py:293
↓ 2 callers
Method
match_model_tensor_name
(self, name: str, key: gguf.MODEL_TENSOR, bid: int | None, suffix: str = ".weight")
utils/convert-hf-to-gguf-bitnet.py:97
↓ 2 callers
Function
permute
(weights: NDArray, n_head: int, n_head_kv: int)
utils/convert-ms-to-gguf-bitnet.py:694
↓ 2 callers
Function
permute
(weights: NDArray, n_head: int, n_head_kv: int)
utils/convert.py:694
↓ 2 callers
Method
permute
(weights: Tensor, n_head: int, n_head_kv: int | None)
utils/convert-hf-to-gguf-bitnet.py:862
↓ 2 callers
Function
permute_lazy
(lazy_tensor: LazyTensor, n_head: int, n_head_kv: int)
utils/convert.py:924
↓ 2 callers
Function
permute_part_lazy
(lazy_tensor: LazyTensor, n_part: int, n_head: int, n_head_kv: int)
utils/convert.py:930
↓ 2 callers
Method
phase
Start a new phase, and terminate the current one, if one is ongoing.
gpu/stats.py:50
↓ 2 callers
Function
process_tl1
(weight, BM, BY, bm, by, M, K)
utils/generate-dummy-bitnet-model.py:498
↓ 2 callers
Method
rebuild_project
Rebuild project
utils/tune_gemm_config.py:52
↓ 2 callers
Method
register
(cls, *names: str)
utils/convert-hf-to-gguf-bitnet.py:226
↓ 2 callers
Method
run_perplexity_test
Run perplexity test on a single dataset.
utils/test_perplexity.py:116
↓ 2 callers
Method
set_gguf_parameters
(self)
utils/generate-dummy-bitnet-model.py:188
↓ 2 callers
Function
transform_to_tl1
(x: np.ndarray)
utils/convert-hf-to-gguf-bitnet.py:662
↓ 2 callers
Function
transform_to_tl2
(x: np.ndarray)
utils/convert-hf-to-gguf-bitnet.py:668
↓ 2 callers
Method
write_meta
(self)
utils/convert-ms-to-gguf-bitnet.py:1240
↓ 2 callers
Method
write_meta
(self)
utils/convert.py:1171
↓ 1 callers
Function
B_global_16x32_to_shared_load_16x32_layout
stride * 8 * (tx // HALF_WARP_expr) + (tx % 8) * stride + 16 * ((tx % HALF_WARP_expr) // 8)
gpu/pack_weight.py:5
↓ 1 callers
Method
_create_special_vocab
(self, vocab: BaseVocab, model_parent_path: Path)
utils/convert-ms-to-gguf-bitnet.py:1576
↓ 1 callers
Method
_create_special_vocab
(self, vocab: BaseVocab, model_parent_path: Path)
utils/convert.py:1431
↓ 1 callers
Method
_create_vocab_by_path
(self, vocab_types: list[str])
utils/convert-ms-to-gguf-bitnet.py:1586
↓ 1 callers
Method
_create_vocab_by_path
(self, vocab_types: list[str])
utils/convert.py:1441
↓ 1 callers
Method
_get_part_names
(self)
utils/convert-hf-to-gguf-bitnet.py:245
↓ 1 callers
Method
_get_part_names
(self)
utils/generate-dummy-bitnet-model.py:317
↓ 1 callers
Method
_is_model_safetensors
(self)
utils/convert-hf-to-gguf-bitnet.py:242
↓ 1 callers
Method
_is_model_safetensors
(self)
utils/generate-dummy-bitnet-model.py:314
↓ 1 callers
Method
_set_vocab_llama_hf
(self)
utils/convert-hf-to-gguf-bitnet.py:441
↓ 1 callers
Method
_set_vocab_sentencepiece
(self)
utils/generate-dummy-bitnet-model.py:431
↓ 1 callers
Method
_split_whitespaces_or_nonwhitespaces
Splits the string `s` so that each substring contains no more than `max_consecutive_slice_len` consecutive whitespaces or consecuti
gpu/tokenizer.py:172
↓ 1 callers
Method
add_tensor_info
(self, name: str, tensor: LazyTensor)
utils/convert-ms-to-gguf-bitnet.py:1222
↓ 1 callers
Method
add_tensor_info
(self, name: str, tensor: LazyTensor)
utils/convert.py:1153
↓ 1 callers
Method
added_tokens
(self)
utils/convert-ms-to-gguf-bitnet.py:481
↓ 1 callers
Method
added_tokens
(self)
utils/convert-ms-to-gguf-bitnet.py:552
↓ 1 callers
Method
added_tokens
(self)
utils/convert-ms-to-gguf-bitnet.py:666
↓ 1 callers
Method
added_tokens
(self)
utils/convert.py:481
↓ 1 callers
Method
added_tokens
(self)
utils/convert.py:552
↓ 1 callers
Method
added_tokens
(self)
utils/convert.py:666
↓ 1 callers
Method
all_tokens
(self)
utils/convert-ms-to-gguf-bitnet.py:416
↓ 1 callers
Method
all_tokens
(self)
utils/convert.py:416
↓ 1 callers
Method
all_tokens
(self)
utils/convert.py:680
↓ 1 callers
Method
backup_config
Backup current configuration file
utils/tune_gemm_config.py:27
↓ 1 callers
Method
benchmark_model
Benchmark model Args: output_suffix: Output file suffix (lowercase format, e.g., q6_k) Returns:
utils/quantize_embeddings.py:127
↓ 1 callers
Function
bf16_to_fp32
(bf16_arr: np.ndarray[Any, np.dtype[np.uint16]])
utils/convert-ms-to-gguf-bitnet.py:718
↓ 1 callers
Function
bf16_to_fp32
(bf16_arr: np.ndarray[Any, np.dtype[np.uint16]])
utils/convert.py:718
↓ 1 callers
Function
bitnet_int8xint2_linear
(input0, input1, s, ws, ret)
gpu/test.py:15
↓ 1 callers
Function
bitnet_int8xint2_linear
(input0, input1, s, ws)
gpu/model.py:21
next →
1–100 of 397, ranked by callers