MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 1 callersFunctionrecv_from_prev_pipeline_rank_
Receive from previous pipeline stage and update the input buffer inplace.
megatron/inference/text_generation/communication.py:13
↓ 1 callersFunctionreduce_aux_losses_tracker_across_ranks
Collect and reduce the auxiliary losses across ranks.
megatron/core/transformer/moe/moe_utils.py:693
↓ 1 callersFunctionreformat_prompt_retro
(query, neighbours, dataset_name, ft_neighbours, \ max_output_len, tokenizer, max_se
tools/retro/sft/dataset_conv.py:267
↓ 1 callersFunctionreformat_prompt_short
(query, neighbours, dataset_name, ft_neighbours, \ max_output_len, tokenizer, max_se
tools/retro/sft/dataset_conv.py:399
↓ 1 callersFunctionreformulate_single_nd_flattened_tensor
Reformulates shapes of a single N-D flattened ShardedTensor. We need to define a pair of transformations: - turn N-D ShardedTensor with origi
megatron/core/dist_checkpointing/strategies/resharding.py:184
↓ 1 callersFunctionregex_match
Test if a regex pattern is contained within a text.
tasks/orqa/unsupervised/qa_utils.py:142
↓ 1 callersFunctionregister_default_common_strategies
Register default common strategies.
megatron/core/dist_checkpointing/strategies/common.py:27
↓ 1 callersFunctionregister_default_tensorstore_strategies
Register default strategies leveraging tensorstore.
megatron/core/dist_checkpointing/strategies/tensorstore.py:22
↓ 1 callersFunctionregister_default_torch_strategies
Register default strategies related to PyT Distributed backend.
megatron/core/dist_checkpointing/strategies/torch.py:87
↓ 1 callersFunctionregister_default_zarr_strategies
Register default strategies related to Zarr backend.
megatron/core/dist_checkpointing/strategies/zarr.py:57
↓ 1 callersFunctionregister_pipeline_terminator
(pipeline: jetclient.JETPipeline)
tests/test_utils/python_scripts/launch_jet_workload.py:24
↓ 1 callersMethodrelease
(self)
megatron/training/dist_signal_handler.py:76
↓ 1 callersFunctionreload_mergeable_ranks
Reload our tokenizer JSON file and convert it to Tiktoken format.
megatron/training/tokenizer/tokenizer.py:610
↓ 1 callersFunctionremove_articles
(text)
tools/retro/text_generation/evaluate.py:18
↓ 1 callersFunctionremove_articles
(text)
tasks/orqa/unsupervised/qa_utils.py:160
↓ 1 callersMethodremove_codes
Remove added codes after adding to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/indexes/faiss_par_add.py:176
↓ 1 callersFunctionremove_embeddings
Remove embeddings after training. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/build.py:169
↓ 1 callersFunctionremove_incomplete_non_persistent_checkpoints
Remove non-persistent checkpoint directories that exceed the latest known valid iteration as indicated by `latest_checkpointed_iteration.txt`
megatron/training/checkpointing.py:548
↓ 1 callersFunctionremove_punc
(text)
tools/retro/text_generation/evaluate.py:24
↓ 1 callersFunctionremove_punc
(text)
tasks/orqa/unsupervised/qa_utils.py:166
↓ 1 callersFunctionremove_sharded_tensors
determine the appropriate sharding strategy and delegate removal to the sharded strategy
megatron/core/dist_checkpointing/serialization.py:282
↓ 1 callersMethodremove_sharded_tensors
Remove all tensors whose key starts with key_prefix
megatron/core/dist_checkpointing/strategies/base.py:172
↓ 1 callersMethodreplace_tensors
Replace all tensors inside arg, kwargs with zeroed copies.
megatron/core/transformer/cuda_graphs.py:641
↓ 1 callersMethodreplay_graph_capture
Replay the fwd cuda graph with autograd.
megatron/core/transformer/cuda_graphs.py:569
↓ 1 callersFunctionreq_file
(filename)
setup.py:31
↓ 1 callersMethodrequires_global_app_metadata
Whether a given strict option requires global metadata for validation.
megatron/core/dist_checkpointing/validation.py:93
↓ 1 callersMethodrequires_returning_mismatch_keys
Whether a given strict option results in extra return value from the `load` function.
megatron/core/dist_checkpointing/validation.py:103
↓ 1 callersMethodreset
This method is called to reset the metrics state of the instance It is generally called from within elapsed() after extracting per rank metri
megatron/core/utils.py:909
↓ 1 callersMethodreset
Forget all data.
megatron/core/rerun_state_machine.py:925
↓ 1 callersMethodreset
Reset metadata in bucket group in preparation for the next iteration of training.
megatron/core/distributed/param_and_grad_buffer.py:145
↓ 1 callersMethodreset
(self)
megatron/core/inference/utils.py:16
↓ 1 callersMethodreset_parameters
(self)
megatron/legacy/model/fused_layer_norm.py:69
↓ 1 callersMethodreset_parameters
(self)
megatron/core/fusions/fused_layer_norm.py:122
↓ 1 callersFunctionretrieval_loss
(model, dataloader)
tasks/orqa/supervised/eval_utils.py:125
↓ 1 callersMethodretrieve_write_results
Turn the latest dict including write results from `self.results_queue` into a single results lists. Includes error check.
megatron/core/dist_checkpointing/strategies/filesystem_async.py:308
↓ 1 callersMethodretro_decoder_cross_attention
Cross attention for Retro decoder. Notation: ns : Sequence length. bs : Batch size. d : Hidden size.
megatron/legacy/model/transformer.py:1054
↓ 1 callersMethodretro_encoder_cross_attention
Cross attention for Retro encoder. Notation: ns : Sequence length. bs : Batch size. d : Hidden size.
megatron/legacy/model/transformer.py:987
↓ 1 callersFunctionretro_generate
Given prompts and input parameters, run inference and return: tokens: prompts plus the generated tokens. lengths: length of the prompt +
tools/retro/text_generation/retro_api.py:142
↓ 1 callersFunctionretro_generate_tokens_probs_and_return_on_first_stage
Main token generation function. Args: model: no interleaving is supported. tokens: prompt tokens extended to be of size [b, max-s
tools/retro/text_generation/retro_generation.py:20
↓ 1 callersMethodreturn_layer_name_and_number
Helper function to return layer name and number Given an input layer e.g decoder.layers.2.self_attention.linear_qkv.weight, this funct
megatron/core/export/trtllm/trtllm_layers.py:47
↓ 1 callersMethodrouting
Top-k routing function Args: logits (torch.Tensor): Logits tensor after gating. Returns: probs (torch.Tensor
megatron/core/transformer/moe/router.py:283
↓ 1 callersMethodrouting
Top-k routing function Args: logits (torch.Tensor): Logits tensor after gating. Returns: probs (torch.Tensor
megatron/core/transformer/moe/router.py:473
↓ 1 callersMethodrun
(self, url, port)
megatron/inference/text_generation_server.py:230
↓ 1 callersMethodrun_engine
Main functionality to run inference Runs the engine until there are no requests in the queue. Args: dynamic_generation (
megatron/core/inference/engines/mcore_engine.py:91
↓ 1 callersMethodrun_gpu_forward
(self, recompute_granularity, use_transformer_engine)
tests/unit_tests/transformer/test_retro_attention.py:113
↓ 1 callersMethodrun_realtime_tests
Performs a consistency check. This function makes sure that tensors across devices are the same during an experiment. This is often n
megatron/core/transformer/attention.py:531
↓ 1 callersMethodrun_realtime_tests
Performs a consistency check. This function makes sure that tensors across devices are the same during an experiment. This is often n
megatron/core/transformer/attention.py:1102
↓ 1 callersMethodrun_realtime_tests
Performs a consistency check. This function makes sure that tensors across devices are the same during an experiment. This is often n
megatron/core/transformer/attention.py:1503
↓ 1 callersMethodsaturation
Saturation distortion.
tasks/vision/segmentation/transforms.py:75
↓ 1 callersMethodsave
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/fully_parallel.py:84
↓ 1 callersMethodsave_block
Save block of codes to disk. Args: config (RetroPreprocessingConfig): Retro preprocessing config. block (dict): Range
megatron/core/datasets/retro/index/indexes/faiss_par_add.py:70
↓ 1 callersFunctionsave_block_db
Save block of chunked tokens to disk. These blocks are later used for training and adding to the vector index. Args: block (dict): Ra
megatron/core/datasets/retro/db/build.py:252
↓ 1 callersMethodsave_checkpoint
Initialize params, forward pass data, and save checkpoint.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:384
↓ 1 callersMethodsave_common
Save common part of the state dict.
megatron/core/dist_checkpointing/strategies/base.py:181
↓ 1 callersFunctionsave_config
Save copy of config within retro project dir.
tools/retro/preprocess_data.py:216
↓ 1 callersFunctionsave_config
Save given config to checkpoint directory. Args: config: checkpoint config checkpoint_dir: checkpoint directory Returns:
megatron/core/dist_checkpointing/core.py:65
↓ 1 callersFunctionsave_dataloader_state
Saves dataloader state if the dataloader supports it. Currently, this is only used by Megatron Energon dataloader (multimodal) to store its state
megatron/training/checkpointing.py:649
↓ 1 callersFunctionsave_indexed_dataset_infos
Save dataset order & meta-info. Args: project_dir (str): Path to Retro project dir. indexed_dataset_infos (List[Dict]): List of m
megatron/core/datasets/retro/db/utils.py:78
↓ 1 callersMethodsave_parameter_state
Save the distributed parameter states of all optimizers to a file. Args: filename (str): path to save parameter state to.
megatron/core/optimizer/optimizer.py:1072
↓ 1 callersMethodsave_shard
Save the block data that was created this in this process
megatron/legacy/data/realm_index.py:75
↓ 1 callersMethodsave_sharded_objects
Save sharded objects from the state dict.
megatron/core/dist_checkpointing/strategies/base.py:185
↓ 1 callersFunctionsave_state_dict_async_finalize
Finalization of save_state_dict_async_plan. The input arguments are the same as the save_state_dict_async_plan output, the `write_result
megatron/core/dist_checkpointing/strategies/state_dict_saver.py:128
↓ 1 callersFunctionsave_state_dict_async_plan
First stage of saving a state dict to storage. This is an async adjustment of torch.distributed.checkpoint.state_dict_saver. In order to
megatron/core/dist_checkpointing/strategies/state_dict_saver.py:24
↓ 1 callersMethodscale_gradients
Scale all gradients inside the buffers by `scaling_factor`.
megatron/core/distributed/data_parallel_base.py:45
↓ 1 callersFunctionscaled_init_method_normal
Init method based on N(0, sigma/sqrt(2*num_layers).
megatron/core/utils.py:278
↓ 1 callersFunctionscatter_to_tensor_model_parallel_region
Wrapper for autograd function: forward: RS, backward: AG <last dim>
megatron/core/tensor_parallel/mappings.py:477
↓ 1 callersMethodschedule_async_call
Spawn a process with `async_fn` as the target. This method must be called on all ranks. Args: async_fn (Callable, option
megatron/core/dist_checkpointing/strategies/async_utils.py:79
↓ 1 callersFunctionschedule_async_save
Schedule the async save request. Args: async_request (AsyncRequest): the async save request.
megatron/training/async_utils.py:19
↓ 1 callersMethodsearch_mips_index
Get the top-k blocks by the index distance metric. :param reconstruct: if True: return a [num_queries x k x embed_dim]
megatron/legacy/data/realm_index.py:206
↓ 1 callersFunctionsegmentation
()
tasks/vision/segmentation/finetune_segformer.py:51
↓ 1 callersFunctionsegmentation
()
tasks/vision/segmentation/finetune_setr.py:20
↓ 1 callersFunctionselect_prompts_based_on_similarity
Select samples based on the similarity
tasks/msdp/preprocessing.py:324
↓ 1 callersFunctionsend_backward_recv_forward
Wrapper for p2p_communication.send_backward_recv_forward used with non-interleaving schedule.
megatron/core/pipeline_parallel/schedules.py:1596
↓ 1 callersFunctionsend_do_beam_search
()
megatron/inference/endpoints/common.py:16
↓ 1 callersFunctionsend_forward_recv_backward
Wrapper for p2p_communication.send_forward_recv_backward used with non-interleaving schedule.
megatron/core/pipeline_parallel/schedules.py:1579
↓ 1 callersFunctionsend_to_next_pipeline_rank
Send output to the next pipeline stage.
megatron/inference/text_generation/communication.py:28
↓ 1 callersMethodseq_aux_loss_load_balancing
Apply loss-based load balancing to the logits tensor.
megatron/core/transformer/moe/router.py:182
↓ 1 callersFunctionset_attn_state
Set self-attention params.
tools/checkpoint/loader_mixtral_hf.py:75
↓ 1 callersFunctionset_attn_state
Set self-attention params.
tools/checkpoint/loader_llama_mistral.py:326
↓ 1 callersFunctionset_build_dependency
( workload_manifests: List[jetclient.JETWorkloadManifest], )
tests/test_utils/python_scripts/common.py:52
↓ 1 callersFunctionset_checkpoint_version
(value)
megatron/training/checkpointing.py:65
↓ 1 callersFunctionset_current_microbatch
Set the current microbatch.
megatron/core/pipeline_parallel/schedules.py:161
↓ 1 callersMethodset_epoch
(self, epoch)
megatron/legacy/data/data_samplers.py:121
↓ 1 callersFunctionset_input_tensor
(input_tensor)
tests/unit_tests/pipeline_parallel/test_schedules.py:69
↓ 1 callersMethodset_input_tensor
See megatron.legacy.model.transformer.set_input_tensor()
megatron/legacy/model/t5_model.py:112
↓ 1 callersMethodset_is_first_microbatch
Sets the is_first_microbatch flag if it exists and config.fp8==True. When this flag is set, TE modules will update their fp8 parameter cache.
megatron/core/transformer/module.py:90
↓ 1 callersMethodset_layer
(self, model, layer_idx, params)
tools/checkpoint/schema_base.py:84
↓ 1 callersFunctionset_layer_state
Set transformer layer params.
tools/checkpoint/loader_mixtral_hf.py:116
↓ 1 callersFunctionset_layer_state
Set transformer layer params.
tools/checkpoint/loader_llama_mistral.py:370
↓ 1 callersMethodset_loss_scale
set the scale of the aux loss. Args: scale (torch.Tensor): The scale value to set. Please ensure that the scale passed in
megatron/core/transformer/moe/moe_utils.py:222
↓ 1 callersFunctionset_mlp_state
Set MLP params.
tools/checkpoint/loader_mixtral_hf.py:98
↓ 1 callersFunctionset_mlp_state
Set MLP params.
tools/checkpoint/loader_llama_mistral.py:357
↓ 1 callersFunctionset_postprocess_state
Set output layer & norm params.
tools/checkpoint/loader_mixtral_hf.py:70
↓ 1 callersFunctionset_postprocess_state
Set output layer & norm params.
tools/checkpoint/loader_llama_mistral.py:319
↓ 1 callersFunctionset_preprocess_state
Set embedding params.
tools/checkpoint/loader_mixtral_hf.py:65
↓ 1 callersFunctionset_preprocess_state
Set embedding params.
tools/checkpoint/loader_llama_mistral.py:313
↓ 1 callersMethodset_special_tokens
Add a list of additional tokens to the encoder. The additional tokens are indexed starting from the last index of the current
megatron/training/tokenizer/gpt2_tokenization.py:184
↓ 1 callersFunctionset_upcycling_args
(enable_grouped_gemm, ep)
tests/unit_tests/transformer/moe/test_upcycling.py:102
↓ 1 callersFunctionsetup_logging
Sets the default logging level based on cmdline args and env vars. Precedence: 1. Command line argument `--logging-level` 2. Env var `ME
megatron/training/initialize.py:464
↓ 1 callersMethodsetup_method
(self, method, use_cpu_initialization=False, swiglu=True)
tests/unit_tests/transformer/moe/test_grouped_mlp.py:224
← previousnext →1,801–1,900 of 4,219, ranked by callers