MCPcopy Index your code

hub / github.com/EleutherAI/gpt-neox / functions

Functions652 in github.com/EleutherAI/gpt-neox

↓ 65 callersFunctionprint_rank_0
If distributed is initialized print only on rank 0.
megatron/__init__.py:17
↓ 64 callersMethodsize
(self, index)
megatron/data/indexed_dataset.py:204
↓ 63 callersMethodget
Retrieves a single item from the dataset with the option to only return a portion of the item. get(idx) is the same as [idx] but get(
megatron/data/indexed_dataset.py:522
↓ 25 callersFunctionget_key
Search for a given key in a NeoX yaml. normalizes underscores -> hyphens
tools/convert_to_hf.py:60
↓ 24 callersMethodupdate_value
updates a property value if the key already exists Problem: a previously non-existing property can be added to the class instance wi
megatron/neox_arguments/template.py:28
↓ 19 callersMethodupdate
(self)
megatron/gradient_noise_scale/gradient_noise_scale.py:201
↓ 17 callersFunctiontb_wandb_log
( key, value, iteration_no, use_wandb, tensorboard_writer=None, all_ranks=False )
megatron/logging.py:360
↓ 17 callersMethodwrite
(self, sizes, doc_idx)
megatron/data/indexed_dataset.py:371
↓ 13 callersMethodexists
(path)
megatron/data/indexed_dataset.py:208
↓ 12 callersMethodfrom_pretrained
Instantiate a PreTrainedBertModel from a pre-trained model file. Download and cache the pre-trained model file if needed.
megatron/tokenizer/gpt2_tokenization.py:97
↓ 11 callersMethoddecode
(self, tokens)
megatron/tokenizer/gpt2_tokenization.py:314
↓ 11 callersFunctionget_model_parallel_world_size
Return world size for the model parallel group.
megatron/mpu/initialize.py:193
↓ 11 callersFunctionget_root_directory
()
tests/common.py:97
↓ 10 callersFunctionrun_neox_args_load_test
(yaml_files)
tests/neox_args/test_neoxargs_load.py:23
↓ 10 callersMethodstart
Start the timer.
megatron/utils.py:233
↓ 9 callersFunctionget_configs_with_path
(configs)
tests/common.py:105
↓ 9 callersFunctionget_model_parallel_group
Get the model parallel group the caller rank belongs to.
megatron/mpu/initialize.py:169
↓ 8 callersFunction_initialize_affine_weight_cpu
Initialize affine weight for model parallel. Build the master weight on all processes and scatter the relevant chunk.
megatron/mpu/layers.py:52
↓ 8 callersFunction_initialize_affine_weight_gpu
Initialize affine weight for model parallel on GPU.
megatron/mpu/layers.py:41
↓ 8 callersFunctionadd_to_logging
(name)
megatron/logging.py:131
↓ 8 callersFunctionexists
(x)
megatron/model/utils.py:69
↓ 8 callersMethodfrom_ymls
instantiates NeoXArgs while reading values from yml files paths_to_yml_files: list of paths to yml files overwrite_values:
megatron/neox_arguments/arguments.py:165
↓ 8 callersFunctionget_model_parallel_rank
Return my rank for the model parallel group.
megatron/mpu/initialize.py:207
↓ 8 callersFunctionparametrize
Generates a random sample of max_tests length of all possible combinations of values in `params_to_test`. In `params_to_test` you can ei
tests/common.py:301
↓ 8 callersMethodstop
Stop the timer.
megatron/utils.py:240
↓ 7 callersFunctiondata_file_path
(prefix_path)
megatron/data/indexed_dataset.py:121
↓ 7 callersMethodencode
(self, text)
megatron/tokenizer/gpt2_tokenization.py:311
↓ 7 callersMethodlog
Log a group of timers.
megatron/utils.py:297
↓ 6 callersMethod__init__
(self, vocab_file)
megatron/tokenizer/tokenizer.py:227
↓ 6 callersFunction_key
(i)
megatron/optimizers.py:177
↓ 6 callersFunctiondivide
Ensure that numerator is divisible by the denominator and return the division value.
megatron/mpu/utils.py:29
↓ 6 callersFunctionget_fp32_allreduce
Get the fp32 allreduce flag
megatron/mpu/initialize.py:289
↓ 6 callersFunctionget_normalized_weights_and_num_samples
( weights: List[float], num_samples: int )
megatron/data/data_utils.py:173
↓ 6 callersFunctionindex_file_path
(prefix_path)
megatron/data/indexed_dataset.py:117
↓ 6 callersFunctionis_mp_rank_0
True if mp rank == 0
megatron/utils.py:133
↓ 6 callersMethodwrite
(self, data)
megatron/logging.py:47
↓ 5 callersMethod_check_and_set
Auxiliary function for checking the values in the checkpoint and setting them.
megatron/learning_rates.py:111
↓ 5 callersMethodconsume_deepy_args
entry point for deepy.py configuring and consuming command line arguments. We can use `--wandb_group` / `--wandb_team` to overwrite
megatron/neox_arguments/arguments.py:240
↓ 5 callersMethodconvert_key_value_to_command_line_arg
(k, v)
megatron/neox_arguments/arguments.py:442
↓ 5 callersMethodget_parent_class_value_dict
takes a sequence of parent classes and returns corresponding values (with defaults set)
megatron/neox_arguments/arguments.py:577
↓ 5 callersMethodload_state_dict
(self, sd)
megatron/learning_rates.py:126
↓ 5 callersFunctionmodel_setup
(yaml_list=None, param_dict=None, clear_data=True)
tests/common.py:241
↓ 5 callersMethodtokenize
(self, text: str)
megatron/tokenizer/tokenizer.py:247
↓ 5 callersMethodwidth_mult
(self)
megatron/mpu/layers.py:673
↓ 4 callersMethod__init__
(self, norm_class, hidden_size, eps)
megatron/model/transformer.py:775
↓ 4 callersFunctionbuild_tokenizer
Initialize tokenizer.
megatron/tokenizer/tokenizer.py:31
↓ 4 callersMethodencode
(self, text)
tools/preprocess_data.py:49
↓ 4 callersFunctionget_norm
(neox_args)
megatron/model/norms.py:19
↓ 4 callersMethodinference_mode
Sets up the model for inference by turning on k/v caching (if specified) and setting `parallel output` of the final layer to false, s
megatron/model/utils.py:109
↓ 4 callersFunctionload_partitions
Returns a list containing all weights in a given layer from a model (across MP partitions)
tools/convert_to_hf.py:42
↓ 4 callersFunctionread_longs
(f, n)
megatron/data/indexed_dataset.py:88
↓ 4 callersFunctionrecursive_setattr
Recursively set attributes on a pytorch module or an iterable of modules. If an assert_type is provided, it will assert that the type of the
megatron/model/utils.py:192
↓ 4 callersMethodreset
Reset timer.
megatron/utils.py:247
↓ 4 callersFunctionrotate_half
(x)
megatron/model/positional_embeddings.py:69
↓ 4 callersFunctionsave_checkpoint
Save a model checkpoint.
megatron/checkpointing.py:208
↓ 4 callersFunctionsetup_model_and_optimizer
Setup model and optimizer.
megatron/training.py:589
↓ 4 callersMethodstate_dict
(self)
megatron/learning_rates.py:100
↓ 4 callersMethodupdate_values
Updates multiple values in self if the keys already exists
megatron/neox_arguments/template.py:46
↓ 4 callersFunctionwrite_longs
(f, a)
megatron/data/indexed_dataset.py:94
↓ 3 callersMethod__init__
( self, neox_args, input_size, output_size, bias=True, input_i
megatron/mpu/layers.py:587
↓ 3 callersFunction_gather
Gather tensors and concatinate along the last dimension.
megatron/mpu/mappings.py:79
↓ 3 callersFunction_reduce
All-reduce the the input tensor across model parallel group.
megatron/mpu/mappings.py:29
↓ 3 callersFunction_split
Split the tensor along its last dimension and keep the corresponding slice.
megatron/mpu/mappings.py:51
↓ 3 callersMethodattention
( self, query_layer, key_layer, value_layer, layer_past, attention_mask )
megatron/model/transformer.py:315
↓ 3 callersFunctionbias_dropout_add
( x: Tensor, bias: Tensor, residual: Optional[Tensor], prob: float, training: bool )
megatron/model/fused_bias_dropout.py:28
↓ 3 callersFunctionbuild_dataset
(index, name)
megatron/data/data_utils.py:120
↓ 3 callersFunctionbuild_the_dataset
Build train/valid/test datasets.
megatron/data/data_utils.py:54
↓ 3 callersMethodbuild_tokenizer
(self)
megatron/neox_arguments/arguments.py:146
↓ 3 callersFunctionclear_test_dirs
()
tests/common.py:114
↓ 3 callersMethodconfigure_distributed_args
Configures distributed training arguments from local variables set by deepspeed launcher.
megatron/neox_arguments/arguments.py:656
↓ 3 callersMethodconsume_neox_args
Deepspeed launcher needs to pass the arguments for `pretrain_gpt2.py` across to all machines. In order not to have any problems with
megatron/neox_arguments/arguments.py:395
↓ 3 callersFunctionconvert
convert a NeoX checkpoint to a HF model format. should perform model-parallel merging correctly but only supports features allowed by HF GPT-N
tools/convert_to_hf.py:136
↓ 3 callersMethoddetokenize
(self, token_ids)
megatron/tokenizer/tokenizer.py:253
↓ 3 callersMethoddevice
(self)
eval_tasks/eval_adapter.py:123
↓ 3 callersMethodelapsed
Calculate the elapsed time.
megatron/utils.py:252
↓ 3 callersFunctionevaluate_and_print_results
Helper function to evaluate and dump results on screen.
megatron/training.py:927
↓ 3 callersFunctionforward_model
Runs model.forward(model_inputs) We need to create a wrapper for this function because deepspeed pipe parallel modules operate differently t
megatron/text_generation_utils.py:123
↓ 3 callersFunctiongenerate_samples_from_prompt
Generates samples from raw text and returns them in a dictionary. neox_args: NeoXArgs. model: a Megatron model text: either a single
megatron/text_generation_utils.py:395
↓ 3 callersFunctionget_batch
Generate batch from context tokens. Attention mask and position ids are created. Returned tensors will be on CUDA. neox_args: NeoXArgs.
megatron/text_generation_utils.py:34
↓ 3 callersFunctionget_data_parallel_group
Get the data parallel group the caller rank belongs to.
megatron/mpu/initialize.py:175
↓ 3 callersFunctionget_files
(pth)
tools/inspect_checkpoints.py:204
↓ 3 callersFunctionget_trainable
(model)
megatron/mup_substitute.py:152
↓ 3 callersFunctioninit_wandb
(neox_args)
megatron/utils.py:151
↓ 3 callersFunctioninitialize_megatron
Set initialize distributed and set autoresume and random seeds. `allow_no_cuda` should not be set unless using megatron for cpu only data proc
megatron/initialize.py:34
↓ 3 callersFunctionmake_data_loader
Build dataloader given an input dataset.
megatron/data/data_utils.py:29
↓ 3 callersFunctionprint_split_stats
(name, index)
megatron/data/data_utils.py:107
↓ 3 callersFunctionrun_train_test
(yaml_list=None, param_dict=None)
tests/model/test_model_train.py:140
↓ 3 callersMethodto_sequential
Transforms the PipelineModule to a plain nn.Sequential module :return:
megatron/model/gpt2_model.py:338
↓ 3 callersFunctiontrain_step
Single training step.
megatron/training.py:670
↓ 3 callersMethodwidth_mult
(self)
megatron/mpu/layers.py:488
↓ 3 callersFunctionwrapper
()
tests/model/test_model_train.py:68
↓ 2 callersMethod__init__
(self, num_heads, mp_size=1, mp_rank=1)
megatron/model/positional_embeddings.py:96
↓ 2 callersMethod__init__
( self, neox_args, init_method, output_layer_init_method, layer_number
megatron/model/gmlp.py:92
↓ 2 callersMethod__init__
(self, path)
megatron/data/indexed_dataset.py:138
↓ 2 callersMethod_batch
extracts samples only pertaining to this worker's batch
megatron/data/samplers.py:159
↓ 2 callersMethod_do_init
(self, path, skip_warmup)
megatron/data/indexed_dataset.py:478
↓ 2 callersFunction_get
(name)
megatron/model/init_functions.py:175
↓ 2 callersFunction_get_batch
Support function for get_batch / get_batch pipe (to avoid code repetition)
megatron/training.py:265
↓ 2 callersFunction_max_reduce_except_dim
(tensor, dim)
megatron/optimizers.py:205
↓ 2 callersMethod_set_parallel_output
(self, value)
megatron/model/gpt2_model.py:304
next →1–100 of 652, ranked by callers