Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/zai-org/CodeGeeX
/ functions
Functions
1,098 in github.com/zai-org/CodeGeeX
⨍
Functions
1,098
◇
Types & classes
154
↳
Endpoints
1
↓ 138 callers
Method
size
(self, index)
codegeex/megatron/data/indexed_dataset.py:219
↓ 129 callers
Method
get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
codegeex/megatron/model/distributed.py:41
↓ 103 callers
Function
print_rank_0
If distributed is initialized, print only on rank 0.
codegeex/megatron/__init__.py:28
↓ 92 callers
Function
get_args
Return arguments.
codegeex/megatron/global_vars.py:36
↓ 66 callers
Method
exists
(path)
codegeex/megatron/data/indexed_dataset.py:223
↓ 36 callers
Method
start
Start the timer.
codegeex/megatron/global_vars.py:201
↓ 35 callers
Method
write
Write timers to a tensorboard writer
codegeex/megatron/global_vars.py:248
↓ 29 callers
Method
stop
Stop the timer.
codegeex/megatron/global_vars.py:208
↓ 24 callers
Function
get_tokenizer
Return tokenizer.
codegeex/megatron/global_vars.py:54
↓ 20 callers
Method
read
(self, *args, **kwargs)
codegeex/benchmark/execution.py:444
↓ 19 callers
Method
eval
(self)
codegeex/mindspore/src/metrics.py:53
↓ 18 callers
Method
write
(self, sizes, doc_idx)
codegeex/megatron/data/indexed_dataset.py:384
↓ 17 callers
Function
add_to_logging
(name)
codegeex/megatron/training.py:652
↓ 17 callers
Function
load_checkpoint
Load a model checkpoint and return the iteration. strict (bool): whether to strictly enforce that the keys in :attr:`state_dict` of the ch
codegeex/megatron/checkpointing.py:301
↓ 15 callers
Method
decode
(self, tokens)
codegeex/mindspore/src/tokenization_jieba.py:75
↓ 15 callers
Method
detokenize
(self, token_ids)
codegeex/megatron/tokenizer/tokenizer.py:146
↓ 15 callers
Function
get_num_microbatches
()
codegeex/megatron/global_vars.py:42
↓ 15 callers
Function
get_timers
Return timers.
codegeex/megatron/global_vars.py:72
↓ 14 callers
Function
get_tensor_model_parallel_world_size
Return world size for the tensor model parallel group.
codegeex/megatron/mpu/initialize.py:241
↓ 14 callers
Method
log
Log a group of timers.
codegeex/megatron/global_vars.py:258
↓ 14 callers
Method
state_dict
(self)
codegeex/megatron/learning_rates.py:127
↓ 13 callers
Function
_broadcast_nz
broadcast_nz
codegeex/mindspore/scripts/layer_norm.py:312
↓ 12 callers
Method
encode
(self, text)
codegeex/mindspore/src/tokenization_jieba.py:71
↓ 12 callers
Function
get_args
train function for PanguAlpha
codegeex/mindspore/src/utils.py:461
↓ 12 callers
Function
get_tensor_model_parallel_rank
Return my rank for the tensor model parallel group.
codegeex/megatron/mpu/initialize.py:276
↓ 12 callers
Function
set_parse
r""" Set config according to the mode
codegeex/mindspore/src/pangu_alpha_config.py:80
↓ 11 callers
Function
is_last_rank
()
codegeex/megatron/__init__.py:37
↓ 10 callers
Function
_compare
(arg_name, old_arg_name=None)
codegeex/megatron/checkpointing.py:48
↓ 10 callers
Method
add
Allocate a chunk of memory from the buffer to tensor and copy the values.
codegeex/megatron/memory.py:90
↓ 10 callers
Function
get_model_chunk_id
Helper method to get the model chunk ID given the iteration number.
codegeex/megatron/schedules.py:213
↓ 10 callers
Function
get_tensor_model_parallel_group
Get the tensor model parallel group the caller rank belongs to.
codegeex/megatron/mpu/initialize.py:201
↓ 10 callers
Method
load_state_dict
Customized load.
codegeex/torch/codegeex_model.py:730
↓ 10 callers
Method
readlines
(self, *args, **kwargs)
codegeex/benchmark/execution.py:450
↓ 9 callers
Method
__init__
( self, hidden_size, )
codegeex/torch/codegeex_model.py:21
↓ 9 callers
Method
__init__
( self, hidden_size, )
codegeex/oneflow/codegeex_model.py:22
↓ 9 callers
Method
__init__
( self, hidden_size, )
codegeex/paddle/codegeex_model.py:20
↓ 9 callers
Function
_communicate
Communicate tensors between stages. Used as helper method in other communication methods that are used in megatron/schedules.py. Takes the fo
codegeex/megatron/p2p_communication.py:24
↓ 9 callers
Method
pad
(self)
codegeex/megatron/tokenizer/tokenizer.py:164
↓ 9 callers
Method
tokenize
(self, text)
codegeex/megatron/tokenizer/tokenizer.py:143
↓ 8 callers
Method
__init__
(self, backbone, generate=False, pad_token=6, seq_length=2048)
codegeex/mindspore/src/pangu_alpha.py:561
↓ 8 callers
Method
cumsum
(sequence, weights)
codegeex/mindspore/src/sat_dataset.py:136
↓ 8 callers
Method
dtype
(self)
codegeex/megatron/data/indexed_dataset.py:447
↓ 8 callers
Function
get_token_stream
( model, context_tokens, return_scores: bool = False, prompt_length: int = Non
codegeex/megatron/code_generation_utils.py:841
↓ 8 callers
Method
load_state_dict
(self, sd)
codegeex/megatron/learning_rates.py:155
↓ 8 callers
Function
print_datetime
Note that this call will sync across all ranks.
codegeex/megatron/training.py:70
↓ 7 callers
Method
_add_symbol
(self, sym: str, count: int)
codegeex/mindspore/src/code_tokenizer.py:103
↓ 7 callers
Function
build_train_valid_test_datasets
Build train, valid, and test datasets.
codegeex/megatron/data/prompt_dataset.py:31
↓ 7 callers
Function
data_file_path
(prefix_path)
codegeex/megatron/data/indexed_dataset.py:136
↓ 7 callers
Method
decode_code
(self, input_ids)
codegeex/mindspore/src/code_tokenizer.py:161
↓ 7 callers
Function
print_rank_last
If distributed is initialized, print only on last rank.
codegeex/megatron/__init__.py:41
↓ 6 callers
Method
__init__
(self, backbone, generate=False, pad_token=6, seq_length=2048)
codegeex/mindspore/src/pangu_alpha_fp16_predict.py:576
↓ 6 callers
Function
_ensure_var_is_not_initialized
Make sure the input variable is not None.
codegeex/megatron/global_vars.py:187
↓ 6 callers
Method
add
Track the rng state.
codegeex/megatron/mpu/random.py:172
↓ 6 callers
Method
clear
Clear the internal evaluation result.
codegeex/mindspore/src/metrics.py:40
↓ 6 callers
Function
download_data
Download the dataset from the obs. src_data_url (Str): should be the dataset path in the obs tgt_data_path (Str): the local d
codegeex/mindspore/src/utils.py:587
↓ 6 callers
Method
encode_code
(self, code: str)
codegeex/mindspore/src/code_tokenizer.py:149
↓ 6 callers
Function
evaluate_and_print_results
Helper function to evaluate and dump results on screen.
codegeex/megatron/training.py:1090
↓ 6 callers
Function
get_ltor_masks_and_position_ids
Build masks and position id for left to right model.
codegeex/megatron/utils.py:145
↓ 6 callers
Function
get_pipeline_model_parallel_world_size
Return world size for the pipeline model parallel group.
codegeex/megatron/mpu/initialize.py:256
↓ 6 callers
Function
index_file_path
(prefix_path)
codegeex/megatron/data/indexed_dataset.py:132
↓ 6 callers
Function
initialize_megatron
Set global variables, initialize distributed, and set autoresume and random seeds. `allow_no_cuda` should not be set unless using megatron for
codegeex/megatron/initialize.py:44
↓ 6 callers
Method
load_state_dict
Customized load.
codegeex/megatron/model/language_model.py:214
↓ 6 callers
Method
set_state_dict
Customized load.
codegeex/paddle/codegeex_model.py:729
↓ 6 callers
Method
state_dict
(self, destination=None, prefix="", keep_vars=False)
codegeex/megatron/model/module.py:188
↓ 5 callers
Method
__init__
( self, init_method, output_layer_init_method, scale: int = 4, )
codegeex/megatron/model/transformer.py:64
↓ 5 callers
Method
_check_and_set
Auxiliary function for checking the values in the checkpoint and setting them.
codegeex/megatron/learning_rates.py:140
↓ 5 callers
Function
_set_cuda_rng_state
Sets the random number generator state of the current GPU. Argumentss: new_state (torch.ByteTensor): The desired state This function
codegeex/megatron/mpu/random.py:78
↓ 5 callers
Function
backward_step
Backward step through passed-in output tensor. If last stage, output_tensor_grad is None, otherwise gradient of loss with respect to stage's
codegeex/megatron/schedules.py:72
↓ 5 callers
Function
build_pretraining_data_loader
Buld dataloader given an input dataset.
codegeex/megatron/data/data_samplers.py:24
↓ 5 callers
Function
cyclic_iter
(iter)
codegeex/megatron/training.py:1214
↓ 5 callers
Function
divide
Ensure that numerator is divisible by the denominator and return the division value.
codegeex/megatron/mpu/utils.py:27
↓ 5 callers
Function
forward_step
Forward step for passed-in model. If first stage, input tensor is obtained from data_iterator, otherwise passed-in input_tensor is used.
codegeex/megatron/schedules.py:43
↓ 5 callers
Function
get_checkpoint_name
A unified checkpoint name.
codegeex/megatron/checkpointing.py:82
↓ 5 callers
Function
get_cuda_rng_tracker
Get cuda rng tracker.
codegeex/megatron/mpu/random.py:215
↓ 5 callers
Method
load_state_dict
Customized load.
codegeex/oneflow/codegeex_model.py:823
↓ 5 callers
Function
save_checkpoint
Save a model checkpoint.
codegeex/megatron/checkpointing.py:110
↓ 5 callers
Method
step
Set lr for all parameters groups.
codegeex/megatron/learning_rates.py:116
↓ 5 callers
Function
stream_jsonl
Parses each jsonl line and yields it as a dictionary
codegeex/data/data_utils.py:67
↓ 4 callers
Function
_transpose_first_dim
(t, num_splits, num_splits_first, model)
codegeex/megatron/checkpointing.py:205
↓ 4 callers
Function
compress_int4_weight
(weight: torch.Tensor)
codegeex/kernels/__init__.py:37
↓ 4 callers
Method
elapsed
Calculate the elapsed time.
codegeex/megatron/global_vars.py:220
↓ 4 callers
Method
forward
(self, hidden_states)
codegeex/megatron/model/transformer.py:93
↓ 4 callers
Method
from_pretrained
Instantiate a PreTrainedBertModel from a pre-trained model file. Download and cache the pre-trained model file if needed.
codegeex/megatron/tokenizer/gpt2_tokenization.py:101
↓ 4 callers
Function
generate_increment
Text generation for incremental inference Inputs: model: the model for inferencing origin_inputs: the original inputs based
codegeex/mindspore/src/generate_finetune.py:78
↓ 4 callers
Function
get_element_from_dict_by_path
Get element from dictionary by path. If element is not present, recursively add empty dictionaries. Args: d (dict): the dictionary to
codegeex/megatron/convert_ckpt_parallel.py:33
↓ 4 callers
Function
get_pipeline_model_parallel_rank
Return my rank for the pipeline model parallel group.
codegeex/megatron/mpu/initialize.py:291
↓ 4 callers
Function
get_tensorboard_writer
Return tensorboard writer. It can be None so no need to check if it is initialized.
codegeex/megatron/global_vars.py:60
↓ 4 callers
Function
init_method_normal
Init method based on N(0, sigma).
codegeex/megatron/model/utils.py:22
↓ 4 callers
Function
pad_batch
(batch, pad_id, args)
codegeex/megatron/code_generation_utils.py:540
↓ 4 callers
Function
quantize
Replace fp16 linear with quantized linear
codegeex/quantization/quantize.py:196
↓ 4 callers
Function
read_longs
(f, n)
codegeex/megatron/data/indexed_dataset.py:90
↓ 4 callers
Method
reshape_to_2d
r"""reshape nd tensor to 2d, if n <= 2, keep original shape.
codegeex/mindspore/src/pangu_alpha.py:419
↓ 4 callers
Method
reshape_to_2d
r"""reshape nd tensor to 2d, if n <= 2, keep original shape.
codegeex/mindspore/src/pangu_alpha_fp16_predict.py:422
↓ 4 callers
Method
state_dict_for_save_checkpoint
For easy load.
codegeex/torch/codegeex_model.py:717
↓ 4 callers
Method
state_dict_for_save_checkpoint
For easy load.
codegeex/megatron/model/language_model.py:196
↓ 4 callers
Method
state_dict_for_save_checkpoint
For easy load.
codegeex/oneflow/codegeex_model.py:810
↓ 4 callers
Method
state_dict_for_save_checkpoint
For easy load.
codegeex/paddle/codegeex_model.py:716
↓ 4 callers
Function
time_limit
(seconds: float)
codegeex/benchmark/execution.py:409
↓ 4 callers
Method
tokenize
Tokenize a string.
codegeex/mindspore/src/tokenization_jieba.py:59
↓ 4 callers
Function
update_num_microbatches
(consumed_samples, consistency_check=True)
codegeex/megatron/global_vars.py:50
next →
1–100 of 1,098, ranked by callers