Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/EleutherAI/gpt-neox
/ functions
Functions
652 in github.com/EleutherAI/gpt-neox
⨍
Functions
652
◇
Types & classes
103
↓ 1 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
megatron/tokenizer/gpt2_tokenization.py:50
↓ 1 callers
Method
calculate_batch_parameters
( dp_world_size, train_batch=None, micro_batch=None, grad_acc=None )
megatron/neox_arguments/arguments.py:684
↓ 1 callers
Method
calculate_derived
Derives additional configuration values necessary for training from the current config
megatron/neox_arguments/arguments.py:744
↓ 1 callers
Method
check
(self, skipped)
megatron/utils.py:353
↓ 1 callers
Method
check_batch_parameters
(dp_world_size, train_batch, micro_batch, grad_acc)
megatron/neox_arguments/arguments.py:724
↓ 1 callers
Function
check_checkpoint_args
Ensure fixed arguments for a model are the same for the input arguments and the one retrieved from checkpoint.
megatron/checkpointing.py:39
↓ 1 callers
Function
check_forward_pass
(neox_args, model, checkpoint_logits, inference)
megatron/checkpointing.py:99
↓ 1 callers
Function
common_entries
(*dcts)
tools/inspect_checkpoints.py:87
↓ 1 callers
Function
compare
(args: Namespace)
tools/inspect_checkpoints.py:265
↓ 1 callers
Function
compile_helper
Compile helper function at runtime. Make sure this is invoked on a single process.
megatron/data/data_utils.py:483
↓ 1 callers
Function
configure_sparse_attention
(neox_args, attention_type, num_attention_heads, mpu)
megatron/model/utils.py:221
↓ 1 callers
Method
convert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
megatron/tokenizer/gpt2_tokenization.py:275
↓ 1 callers
Function
copy_to_model_parallel_region
(input_)
megatron/mpu/mappings.py:179
↓ 1 callers
Function
count_gpus
()
tests/common.py:64
↓ 1 callers
Function
create_config
take in a loaded yaml from NeoX and assign relevant values to HF config. Returns: GPTNeoXConfig() object
tools/convert_to_hf.py:75
↓ 1 callers
Function
cross_entropy
From pretrain_gpt2:forward_step()
megatron/model/gpt2_model.py:52
↓ 1 callers
Method
data_iterator
iterates through data and handles wrap around
megatron/data/samplers.py:149
↓ 1 callers
Function
delete_old_checkpoints
(save_dir, n_to_keep)
megatron/checkpointing.py:140
↓ 1 callers
Function
destroy_model_parallel
Set the groups to none.
megatron/mpu/initialize.py:269
↓ 1 callers
Function
dict_repr
(d)
tests/common.py:349
↓ 1 callers
Method
download
downloads dataset
tools/corpora.py:120
↓ 1 callers
Method
dtype
(self)
megatron/data/indexed_dataset.py:445
↓ 1 callers
Method
enable_logging
enable Tee logs based on the configured logdir
megatron/neox_arguments/arguments.py:611
↓ 1 callers
Method
end_document
(self)
megatron/data/indexed_dataset.py:298
↓ 1 callers
Function
ensure_directory_exists
Build filename's path if it does not already exists.
megatron/checkpointing.py:117
↓ 1 callers
Function
evaluate
Evaluation. neox_args: NeoX Arguments forward_step_fn: function with args `neox_args, timers, data_iterator & model that w
megatron/training.py:849
↓ 1 callers
Method
exists
Checks if the dataset is present
tools/corpora.py:116
↓ 1 callers
Function
expand_attention_types
Expands an `attention_config` list in the following format: [ [['attention_type_1', ..., `attention_type_n`], 12] ]
megatron/utils.py:311
↓ 1 callers
Function
filter_logits
Filters the logits using top_k / top_p, filling any filtered vocab items with filter_value (defaults to -inf). This function has been mostly
megatron/text_generation_utils.py:78
↓ 1 callers
Method
finalize
(self, index_file)
megatron/data/indexed_dataset.py:321
↓ 1 callers
Function
finish_mpu_init
()
megatron/initialize.py:47
↓ 1 callers
Method
flash_attention
(self, query_layer, key_layer, value_layer)
megatron/model/transformer.py:418
↓ 1 callers
Method
flatten_grads
(self)
megatron/gradient_noise_scale/gradient_noise_scale.py:84
↓ 1 callers
Method
forward
(ctx, inputs, mask, scale)
megatron/model/fused_softmax.py:65
↓ 1 callers
Method
forward
(self, input_ids, position_ids, tokentype_ids=None)
megatron/model/word_embeddings.py:134
↓ 1 callers
Method
forward_fused_softmax
(self, input, mask)
megatron/model/fused_softmax.py:170
↓ 1 callers
Function
forward_step
Forward step.
megatron/training.py:336
↓ 1 callers
Method
forward_torch_softmax
(self, input, mask)
megatron/model/fused_softmax.py:184
↓ 1 callers
Function
gather_from_model_parallel_region
(input_)
megatron/mpu/mappings.py:191
↓ 1 callers
Function
generate_samples_input_from_file
Generates samples from an input file and writes them to an output file. Reads prompts from neox_args.sample_input_file and writes completion
megatron/text_generation_utils.py:548
↓ 1 callers
Function
generate_samples_interactive
Generates samples unconditionially (no prompt) and yields them in a dictionary. neox_args: NeoXArgs. model: a Megatron model maximu
megatron/text_generation_utils.py:702
↓ 1 callers
Function
generate_samples_unconditional
Generates samples unconditionially (no prompt) and yields them in a dictionary. neox_args: NeoXArgs. model: a Megatron model number
megatron/text_generation_utils.py:636
↓ 1 callers
Function
get_args
()
prepare_data.py:28
↓ 1 callers
Function
get_args
()
tools/preprocess_data.py:64
↓ 1 callers
Function
get_attn_mask
Get triangular attention mask for a given sequence length / device.
megatron/utils.py:66
↓ 1 callers
Function
get_batch
Generate a batch
megatron/training.py:284
↓ 1 callers
Method
get_batch_per_block
(sq, sk, b, np)
megatron/model/fused_softmax.py:202
↓ 1 callers
Function
get_bias_dropout_add
(training)
megatron/model/fused_bias_dropout.py:37
↓ 1 callers
Function
get_flops
(neox_args, model, iter_time_s)
megatron/logging.py:81
↓ 1 callers
Function
get_git_commit_hash
Gets the git commit hash of your current repo (if it exists)
megatron/neox_arguments/neox_args.py:42
↓ 1 callers
Method
get_heads_range
(global_n_heads, rank, world_size)
megatron/mpu/layers.py:309
↓ 1 callers
Function
get_init_methods
(args)
megatron/model/init_functions.py:166
↓ 1 callers
Function
get_learning_rate_scheduler
Build the learning rate scheduler.
megatron/training.py:553
↓ 1 callers
Method
get_lr
Learning rate decay functions from: https://openreview.net/pdf?id=BJYwwY9ll pg. 4
megatron/learning_rates.py:63
↓ 1 callers
Function
get_master_port
()
tests/common.py:53
↓ 1 callers
Function
get_model
Build the model.
megatron/training.py:369
↓ 1 callers
Function
get_noise_scale_logger
(neox_args)
megatron/utils.py:365
↓ 1 callers
Function
get_optimizer
Set up the optimizer.
megatron/training.py:437
↓ 1 callers
Function
get_parallel_checkpoint_name
(path)
tools/merge_mp_partitions.py:124
↓ 1 callers
Function
get_params_for_weight_decay_optimization
Divide params into with-weight-decay and without-weight-decay groups. Layernorms and biases will have no weight decay but the rest will.
megatron/model/utils.py:27
↓ 1 callers
Function
get_shared_fnames
(files_1, files_2)
tools/inspect_checkpoints.py:241
↓ 1 callers
Function
get_test_configs_with_path
(configs: list)
tests/common.py:109
↓ 1 callers
Function
get_topology
()
megatron/mpu/initialize.py:249
↓ 1 callers
Function
get_total_params
(model)
megatron/utils.py:385
↓ 1 callers
Function
get_train_valid_test_split_
Get dataset splits from comma or '/' separated string list.
megatron/data/data_utils.py:146
↓ 1 callers
Function
has_method
(o, name)
megatron/training.py:62
↓ 1 callers
Function
human_readable_flops
(num)
megatron/logging.py:64
↓ 1 callers
Function
infer_dataset_impl
(path)
megatron/data/indexed_dataset.py:35
↓ 1 callers
Function
init_method_normal
Init method based on N(0, sigma).
megatron/model/init_functions.py:24
↓ 1 callers
Method
init_specs
(self)
megatron/model/gpt2_model.py:166
↓ 1 callers
Method
initialize_embedding
(self)
megatron/model/word_embeddings.py:203
↓ 1 callers
Method
initialize_tensorboard_writer
(self)
megatron/neox_arguments/arguments.py:149
↓ 1 callers
Method
initializer
(self)
tools/preprocess_data.py:45
↓ 1 callers
Method
insert_layers
inserts the layers in `layers` into the pipe model at `idx`.
megatron/model/gpt2_model.py:134
↓ 1 callers
Method
is_kernel_available
(self, mask, b, np, sq, sk)
megatron/model/fused_softmax.py:148
↓ 1 callers
Function
json_iterator
(input_dir, text_key="text")
megatron/tokenizer/train_tokenizer.py:41
↓ 1 callers
Function
lazy_model
(hidden_size)
megatron/training.py:128
↓ 1 callers
Function
load_fused_kernels
()
megatron/fused_kernels/__init__.py:32
↓ 1 callers
Function
load_jsonl
Read list of objects from a JSON lines file.
megatron/tokenizer/train_tokenizer.py:28
↓ 1 callers
Function
main
()
deepy.py:22
↓ 1 callers
Function
main
Generate text/sample model
generate.py:29
↓ 1 callers
Function
main
()
evaluate.py:34
↓ 1 callers
Function
main
()
tools/merge20b.py:267
↓ 1 callers
Function
main
()
tools/merge_mp_partitions.py:186
↓ 1 callers
Function
main
()
tools/preprocess_data.py:170
↓ 1 callers
Function
main
()
tools/inspect_checkpoints.py:295
↓ 1 callers
Function
maybe_download_gpt2_tokenizer_data
(tokenizer_type, data_dir)
tools/corpora.py:288
↓ 1 callers
Function
merge
(input_dir, output_dir)
tools/merge20b.py:236
↓ 1 callers
Function
merge_model_weights
(input_checkpoint_path, output_checkpoint_path)
tools/merge20b.py:73
↓ 1 callers
Function
modify_config
(input_config_path, output_config_path, output_dir)
tools/merge20b.py:34
↓ 1 callers
Function
modify_model_states
(input_model_state_path, output_model_state_path)
tools/merge20b.py:62
↓ 1 callers
Function
mup_coord_check
(neox_args, timers, lr_scheduler, train_data_iterator)
megatron/training.py:124
↓ 1 callers
Method
mup_reinitialize_weights
(self, neox_args)
megatron/mpu/layers.py:700
↓ 1 callers
Function
mup_weights_reinit
(neox_args, model)
megatron/training.py:60
↓ 1 callers
Function
natural_sort
(l)
tools/inspect_checkpoints.py:42
↓ 1 callers
Function
natural_sort
(l)
megatron/utils.py:204
↓ 1 callers
Function
obtain_resource_pool
Get dict of `resource_pool[hostname] = [list of GPU ranks]` using hostfile, include and exclude args. Modified from: `deepspeed.launcher.runn
megatron/utils.py:183
↓ 1 callers
Function
pad_batch
pads context lengths in context_tokens with pad_id to equal neox_args.seq_length, and returns the padded batch and the new lengths. cont
megatron/text_generation_utils.py:55
↓ 1 callers
Function
pairwise
s -> (s0,s1), (s1,s2), (s2, s3), ...
configs/gen_docs.py:14
↓ 1 callers
Function
parallel_lm_logits
LM logits using word embedding weights.
megatron/model/transformer.py:786
← previous
next →
201–300 of 652, ranked by callers