MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

Method__lt__
Check if value of self is smaller than other's value Args: other (_ValueWithRank): The other object to compare with Retu
megatron/core/utils.py:665
Method__new__
Constructor Creates an instance of the class if not created Args: cls (Type['StragglerDetector']): The class type
megatron/core/utils.py:789
Method__new__
(cls, config: TransformerConfig, hidden_size: int, eps: float = 1e-5)
megatron/core/extensions/transformer_engine.py:68
Method__new__
( cls, config: TransformerConfig, hidden_size: int, eps: float = 1e-5,
megatron/core/transformer/torch_norm.py:14
Method__new__
(cls, tp=1, pp=1, ep=1)
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:62
Method__next__
__next__ method override adding replay capability.
megatron/core/rerun_state_machine.py:840
Method__post_init__
(self)
tools/retro/sft/dataset_conv.py:57
Method__post_init__
Python dataclass method that is used to modify attributes after initialization. See https://docs.python.org/3/library/dataclasses.html#post-in
megatron/core/model_parallel_config.py:336
Method__post_init__
(self)
megatron/core/dist_checkpointing/mapping.py:91
Method__post_init__
(self)
megatron/core/dist_checkpointing/mapping.py:548
Method__post_init__
(self)
megatron/core/dist_checkpointing/strategies/resharding.py:56
Method__post_init__
(self)
megatron/core/datasets/multimodal_dataset.py:28
Method__post_init__
Do asserts and set fields post init
megatron/core/datasets/t5_dataset.py:36
Method__post_init__
Do asserts and set fields post init
megatron/core/datasets/bert_dataset.py:23
Method__post_init__
Do asserts and set fields post init
megatron/core/datasets/blended_megatron_dataset_config.py:72
Method__post_init__
Do asserts and set fields post init
megatron/core/datasets/gpt_dataset.py:862
Method__post_init__
Do asserts and set fields post init
megatron/core/datasets/masked_dataset.py:49
Method__post_init__
Validate config attributes.
megatron/core/datasets/retro/query/multi_split_gpt_dataset.py:37
Method__post_init__
Validate Retro config.
megatron/core/datasets/retro/config/config.py:113
Method__post_init__
Validate Retro config.
megatron/core/models/retro/config.py:61
Method__post_init__
Python dataclass method that is used to modify attributes after initialization. See https://docs.python.org/3/library/dataclasses.html#post-in
megatron/core/transformer/transformer_config.py:412
Method__post_init__
Check the validity of the config.
megatron/core/optimizer/optimizer_config.py:135
Method__repr__
Define repr method for ImageNetPolicy class.
megatron/legacy/data/autoaugment.py:109
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:95
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:142
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:172
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:213
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:254
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:303
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:357
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:398
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:418
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:442
Method__repr__
(self)
tasks/vision/segmentation/metrics.py:520
Method__setitem__
(self, key: Tuple[int, str], value: Any)
megatron/core/optimizer/optimizer.py:911
Method__setstate
Unpickle method, used by torch.distributed.gather_object.
megatron/core/rerun_state_machine.py:960
Method__setstate__
Set the state during un-pickling Args: state (Tuple[str, bool, bool, Optional[S3Config]]): The state tuple
megatron/core/datasets/indexed_dataset.py:590
Method__str__
String representation of the object Returns: str: strigified object
megatron/core/utils.py:695
Method__str__
(self)
megatron/core/inference_params.py:30
Method__str__
(self)
megatron/core/dist_checkpointing/mapping.py:569
Method__str__
(self)
megatron/core/dist_checkpointing/strategies/base.py:108
Method__str__
Stringify the mapping. Returns: A string representation of this block path map.
megatron/core/datasets/retro/utils.py:330
Method__str__
(self)
megatron/core/optimizer/distrib_optimizer.py:82
Method_add_special_token
(t)
megatron/training/tokenizer/tokenizer.py:377
Method_add_to_trtllm_model_weights
Add the input weight to trtllm_model_weights Depending on split (Expert split/Tensor split/None) we split the input data and add accordin
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:117
Method_adjust_key_value_for_latent_forward_deprecated
Saves the generated key and value tensors to the end of the buffers in latent_forward_params. Returns the full size keys and values f
megatron/core/transformer/attention.py:763
Method_allocate_buffers_for_parameters
( input_params, data_parallel_group, gradient_scaling_factor )
megatron/core/distributed/distributed_data_parallel.py:103
Function_batched_p2p_ops
( *, tensor_send_prev: Optional[torch.Tensor], tensor_recv_prev: Optional[torch.Tensor], tenso
megatron/core/pipeline_parallel/p2p_communication.py:119
Function_bias_dropout_add
(x, bias, residual, prob)
megatron/legacy/model/transformer.py:847
Function_bias_dropout_add
(x_with_bias, residual, prob)
megatron/core/fusions/fused_bias_dropout.py:42
Method_build_fn
(key, tensor, replica_id, flattened_range)
tests/unit_tests/dist_checkpointing/test_serialization.py:335
Method_collate_fn
(self, batch_data)
tasks/orqa/unsupervised/nq.py:48
Method_collect_main_grad_data_for_unscaling
Note: this should be equivalent to the float-16 optimizer's method, but written differently, so the two should be combined.
megatron/core/optimizer/distrib_optimizer.py:1682
Method_compare
(srcs, tgts, names, parallelism)
megatron/core/transformer/attention.py:561
Method_compare
(srcs, tgts, names, parallelism)
megatron/core/transformer/attention.py:1132
Method_compare
(srcs, tgts, names, parallelism)
megatron/core/transformer/attention.py:1533
Function_compare_floats
Internal function that implements the default compare_func. Check the validate_result() method of the RerunStateMachine class for details.
megatron/core/rerun_state_machine.py:1114
Function_compute_language_model_loss
(self, labels, logits)
megatron/inference/algos/distillation.py:447
Function_convert_image_to_rgb
(image)
megatron/legacy/data/multimodal_dataset.py:16
Method_copy_main_params_to_model_params
Copy main params to model params. Since this step is followed by an all-gather through the DDP's grad buffer, this method is
megatron/core/optimizer/distrib_optimizer.py:1757
Method_copy_model_grads_to_main_grads
Copy model grads to main grads. Since this step follows a reduce-scatter through the DDP's grad buffer, this method is respo
megatron/core/optimizer/distrib_optimizer.py:1717
Method_copy_model_params_to_main_params
Copy model params to main params. During finetuning, this method is used to reload the main params from the model params. Th
megatron/core/optimizer/distrib_optimizer.py:1815
Function_cpp_extention_load_helper
(name, sources, extra_cuda_flags)
megatron/legacy/fused_kernels/__init__.py:37
Function_cross_entropy_forward_step
Simple forward step with cross-entropy loss.
tasks/finetune_utils.py:53
Function_cross_entropy_forward_step
Simple forward step with cross-entropy loss.
tasks/vision/classification/classification.py:53
Function_cross_entropy_forward_step
Simple forward step with cross-entropy loss.
tasks/vision/segmentation/finetune_segformer.py:109
Function_cross_entropy_forward_step
Simple forward step with cross-entropy loss.
tasks/vision/segmentation/finetune_setr.py:71
Function_disable_gc
Temporarily disables GC.
megatron/core/dist_checkpointing/strategies/filesystem_async.py:39
Method_does_param_require_new_bucket
Split shared embedding parameters into separate bucket if using distributed optimizer that makes use of reduce-scatters inste
megatron/core/distributed/param_and_grad_buffer.py:516
Method_fill_in_data
(t: Union[ShardedTensor, torch.Tensor])
megatron/core/dist_checkpointing/strategies/two_stage.py:234
Method_forward
(self, tokens, position_ids, attention_mask)
tools/run_vlm_text_generation.py:174
Method_forward
(self, model_inputs)
tools/bert_embedding/huggingface.py:25
Method_forward
Per-chunk bias-dropout-add. Args: x_with_bias (dict): Attention output and bias tuple. residual (Tensor): Transformer
megatron/core/models/retro/encoder_attention.py:119
Method_forward
Per-chunk bias-dropout-add. Args: x_with_bias (dict): Attention output and bias, along with other Retro relevant parameters.
megatron/core/models/retro/decoder_attention.py:226
Function_forward_step_func
(data_iterator, model)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:81
Function_forward_step_func
(data_iterator, model)
tests/unit_tests/export/trtllm/test_distributed_fp8.py:84
Method_get_device_from_generator
(self, gen: torch.Generator)
megatron/core/models/difflm/gpt_model.py:299
Method_get_model_and_main_params_data_float16
Get aligned list of model and main params.
megatron/core/optimizer/distrib_optimizer.py:1700
Method_get_param_groups
(self)
megatron/core/optimizer/optimizer.py:270
Method_get_state
(self)
megatron/core/optimizer/optimizer.py:259
Method_get_token_mask
Abstract method implementation 100% of the time, replace the token id with mask token id. Args: numpy_random_state (Rand
megatron/core/datasets/t5_dataset.py:320
Method_get_token_mask
Abstract method implementation 80% of the time, replace the token id with mask token id. 10% of the time, replace token id with a ran
megatron/core/datasets/bert_dataset.py:175
Method_handler
Thread function for the controller. It is a tcp-server that listens on a port. Uses HTTP protocol. If connected to it using curl, it
megatron/core/utils.py:1136
Function_init_weights
( module, n_layer, initializer_range=0.02, # Now only used for embedding layer. rescale_preno
megatron/core/ssm/mamba_block.py:31
Method_init_weights
(self, module)
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:412
Method_init_weights
(self, module)
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:403
Method_init_weights
(self, module)
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:412
Method_init_weights
(self, m)
megatron/legacy/model/vision/classification.py:72
Method_init_weights
(self, m)
megatron/legacy/model/vision/esvit_swin_backbone.py:580
Method_init_weights
(self, m)
megatron/legacy/model/vision/dino.py:105
Method_init_weights
(self, m)
megatron/legacy/model/vision/mit_backbone.py:31
Method_init_weights
(self, m)
megatron/legacy/model/vision/mit_backbone.py:86
Method_init_weights
(self, m)
megatron/legacy/model/vision/mit_backbone.py:143
Method_init_weights
(self, m)
megatron/legacy/model/vision/mit_backbone.py:180
Method_init_weights
(self, m)
megatron/legacy/model/vision/mit_backbone.py:260
Method_init_weights
(self, m)
megatron/legacy/model/vision/swin_backbone.py:552
Method_init_weights
Initialize the weights.
megatron/inference/algos/distillation.py:398
Method_initalize
(self, vocab_extra_ids)
megatron/training/tokenizer/tokenizer.py:526
Method_initalize
(self, vocab_extra_ids)
megatron/training/tokenizer/tokenizer.py:566
Method_key_config_attributes
Inherited method implementation Returns: List[str]: The key config attributes
megatron/core/datasets/t5_dataset.py:85
← previousnext →2,501–2,600 of 4,219, ranked by callers