MCPcopy Create free account

hub / github.com/SandAI-org/MAGI-1 / functions

Functions318 in github.com/SandAI-org/MAGI-1

↓ 19 callersFunctionprint_rank_0
(message)
inference/common/logger.py:46
↓ 15 callersFunctiondivide
(numerator, denominator)
inference/common/common_utils.py:26
↓ 15 callersMethodwait
(self)
inference/infra/parallelism/context_parallel.py:93
↓ 13 callersMethod__init__
(self, model_config: ModelConfig, engine_config: EngineConfig, layer_number: int, input_size: int = None)
inference/model/dit/dit_module.py:509
↓ 10 callersFunctionenv_is_true
(env_name: str)
inference/common/common_utils.py:22
↓ 9 callersFunctionget_nccl_options
Set the NCCL process group options. Args: pg_name (str): process group name nccl_comm_cfgs (dict): nccl communicator configuratio
inference/infra/distributed/parallel_state.py:67
↓ 9 callersMethodget_ranks
Get rank group by input token. Arguments: token (str): Specify the ranks type that want to get. If we want
inference/infra/distributed/parallel_state.py:221
↓ 8 callersMethodindex_dot
Converts a list of indices into a single index, representing the position in a multi-dimensional space. This method takes a list of
inference/infra/parallelism/tile_parallel.py:154
↓ 7 callersMethodload
(self, image_path)
comfyui/comfy_nodes.py:95
↓ 7 callersFunctionpp_scheduler
Get the current PPScheduler instance. Returns: PPScheduler: The current PPScheduler instance. Raises: AssertionError: If the
inference/infra/parallelism/pipeline_parallel.py:113
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0)
inference/model/vae/vae_module.py:208
↓ 6 callersFunctionprint_per_rank
(message)
inference/common/logger.py:42
↓ 6 callersFunctionscatter_to_context_parallel_region
Split the tensor along its first dimension and keep the corresponding slice.
inference/infra/parallelism/context_parallel.py:29
↓ 5 callersFunctionall_to_all_input_split
Scatter head_number and gather seq_len, for example: input: (seq_len, cp * hn, hd) output: (seq_len * cp, hn, hd) NOTE: seq_len of in
inference/infra/parallelism/context_parallel.py:381
↓ 5 callersFunctioncso_communication
( input: torch.Tensor, cp_world_size: int, cp_split_sizes: List[int], comm_type: str = None )
inference/infra/parallelism/context_parallel.py:603
↓ 5 callersMethodforward
( self, x, t, y, caption_dropout_mask=None, xattn_mask=None,
inference/model/dit/dit_model.py:363
↓ 5 callersMethodmode
(self)
inference/model/vae/vae_module.py:756
↓ 4 callersFunctionget_pp_rank
Return my rank for the pipeline model parallel group.
inference/infra/distributed/parallel_state.py:521
↓ 4 callersFunctionget_pp_world_size
Return world size for the pipeline model parallel group.
inference/infra/distributed/parallel_state.py:511
↓ 4 callersMethodindex_undot
Converts a single index into a list of indices, representing the position in a multi-dimensional space. This method takes an integer
inference/infra/parallelism/tile_parallel.py:131
↓ 3 callersMethod_create_nested_config
(cls, config_dict: dict, config_name: str, config_cls)
inference/common/config.py:124
↓ 3 callersMethod_run
(self, prompt: str, prefix_video: torch.Tensor, output_path: str)
inference/pipeline/pipeline.py:45
↓ 3 callersMethodfrom_pretrained
(cls, pretrained_model_name_or_path, *args, **kwargs)
inference/model/vae/vae_model.py:353
↓ 3 callersMethodgather_frames
Gathers frame data from all ranks in a distributed environment. This method collects frames from all ranks and combines them into a
inference/infra/parallelism/tile_parallel.py:67
↓ 3 callersMethodget_attn_and_xattn_base
( query: torch.Tensor, key: torch.Tensor, value: torch.Tensor, core_attn_func:
inference/infra/parallelism/context_parallel.py:550
↓ 3 callersMethodget_batch_size_and_chunk_token_nums
Const Method
inference/pipeline/video_generate.py:360
↓ 3 callersMethodget_timestep
Const Method
inference/pipeline/video_generate.py:323
↓ 3 callersMethodisend_next
Asynchronously send a tensor to the next pipeline and return the send handle. Args: tensor (torch.Tensor): The tensor to be sent.
inference/infra/parallelism/pipeline_parallel.py:37
↓ 3 callersFunctionprefix_product
(a: List[int], init=1)
inference/infra/distributed/parallel_state.py:137
↓ 3 callersMethodsample
(self)
inference/model/vae/vae_module.py:734
↓ 2 callersMethod_check_missing_fields
(cls, config_dict: dict, required_fields: list)
inference/common/config.py:117
↓ 2 callersFunction_pad_special_token
(special_token: torch.Tensor, txt_feat: torch.Tensor, attn_mask: torch.Tensor = None)
inference/pipeline/prompt_process.py:92
↓ 2 callersMethodadjust_key_and_value_for_inference
( self, key_and_value: torch.Tensor, inference_params: InferenceParams, meta_args: ModelMetaArgs )
inference/model/dit/dit_module.py:933
↓ 2 callersFunctionapply_rot_embed
(x: torch.Tensor, sin_emb, cos_emb)
inference/model/vae/vae_module.py:146
↓ 2 callersFunctionbias_modulate_add
( x: torch.Tensor, residual: torch.Tensor, condition_map: torch.Tensor, gate: torch.Tensor, post_norm: tor
inference/model/dit/dit_module.py:292
↓ 2 callersMethodclean_caption
(self, caption)
inference/model/t5/t5_model.py:167
↓ 2 callersFunctioncp_update_cross_attn_qkv_range
Update cross_attn_params for cross_attn in context parallel. Input: cross_attn_params: PackedCrossAttnParams. Packed sequence parame
inference/infra/parallelism/context_parallel.py:134
↓ 2 callersMethodcross_attention
( self, mixed_qqkv: torch.Tensor, key_value_states: torch.Tensor, cross_attn_p
inference/model/dit/dit_module.py:1098
↓ 2 callersMethoddecode
Decode the input tensor. Args: chunk (torch.Tensor): Input tensor with shape (N, C, T, H, W). vae (VideoToken
inference/pipeline/video_process.py:155
↓ 2 callersFunctiondecompose
This function solve the math problem below: There is an equation: index = sum(idx[i] * stride[i]) And
inference/infra/distributed/parallel_state.py:147
↓ 2 callersFunctiondist_init
Initialize torch.distributed and core model parallel.
inference/infra/distributed/dist_utils.py:27
↓ 2 callersFunctiondiv_clamp_to
(x: torch.Tensor, scale: torch.Tensor)
inference/model/dit/dit_module.py:364
↓ 2 callersFunctionencode_prefix_video
(prefix_video, fps, vae_ckpt, scale_factor, parallel_group)
inference/pipeline/video_process.py:278
↓ 2 callersFunctionfind_dit_model
(model)
inference/pipeline/video_generate.py:243
↓ 2 callersMethodforward_velocity
(self, infer_idx: int, cur_denoise_step: int)
inference/pipeline/video_generate.py:585
↓ 2 callersFunctionfreq_bands
( num_bands: int, temperature: float = 10000.0, step: int = 2, device: Optional[torch.device] = None )
inference/model/dit/dit_module.py:591
↓ 2 callersMethodfrom_json
(cls, json_path: str)
inference/common/config.py:141
↓ 2 callersFunctiongather_from_context_parallel_region
Gather tensors and concatinate along the first dimension.
inference/infra/parallelism/context_parallel.py:56
↓ 2 callersMethodgenerate_denoise_status_and_sequences
Const Method
inference/pipeline/video_generate.py:551
↓ 2 callersMethodgenerate_kv_range_for_uncondition
(self, uncond_x)
inference/model/dit/dit_model.py:92
↓ 2 callersFunctiongenerate_per_chunk
( model: torch.nn.Module, prefix_video: torch.Tensor, caption_embs: torch.Tensor, emb_masks: torch.Tensor
inference/pipeline/video_generate.py:757
↓ 2 callersFunctionget_cp_group
Get the context parallel group the caller rank belongs to.
inference/infra/distributed/parallel_state.py:499
↓ 2 callersFunctionget_dit
Build and load VideoDiT model
inference/model/dit/dit_model.py:641
↓ 2 callersFunctionget_dp_group
Get the data parallel group the caller rank belongs to.
inference/infra/distributed/parallel_state.py:475
↓ 2 callersMethodget_k
(self, mixed_qqkv: torch.Tensor, cos_emb: torch.Tensor, sin_emb: torch.Tensor)
inference/model/dit/dit_module.py:970
↓ 2 callersFunctionget_pp_group
Get the pipeline model parallel group the caller rank belongs to.
inference/infra/distributed/parallel_state.py:469
↓ 2 callersFunctionget_tp_group
Get the tensor model parallel group the caller rank belongs to.
inference/infra/distributed/parallel_state.py:455
↓ 2 callersFunctionget_txt_embeddings
(prompt: str, config: MagiConfig)
inference/pipeline/prompt_process.py:181
↓ 2 callersMethodget_v
(self, mixed_qqkv: torch.Tensor)
inference/model/dit/dit_module.py:987
↓ 2 callersMethodget_vae
Load a pretrained VAE model. Args: vae_ckpt (str): Path to the pretrained VAE checkpoint. Returns:
inference/pipeline/video_process.py:51
↓ 2 callersFunctioninner_product
(a: List[int], b: List[int])
inference/infra/distributed/parallel_state.py:144
↓ 2 callersMethodirecv_prev
Asynchronously receive a tensor from the previous pipeline and return the receive handle. Args: buffer (torch.Tensor): The buffer
inference/infra/parallelism/pipeline_parallel.py:51
↓ 2 callersFunctionpad_special_token
(special_token_keys: List[str], caption_embs: torch.Tensor, emb_masks: torch.Tensor)
inference/pipeline/prompt_process.py:104
↓ 2 callersFunctionpixel_freq_bands
( num_bands: int, max_freq: float = 224.0, linear_bands: bool = True, device: Optional[torch.device] = Non
inference/model/dit/dit_module.py:581
↓ 2 callersFunctionpost_chunk_process
(chunk: torch.Tensor, config: MagiConfig)
inference/pipeline/video_process.py:376
↓ 2 callersFunctionprepare_prompt_embeddings
(prompts: List[str], model_cache_dir, model_device, model_max_length)
inference/pipeline/prompt_process.py:148
↓ 2 callersFunctionprocess_image
(image_path: str, config: MagiConfig)
inference/pipeline/video_process.py:314
↓ 2 callersFunctionprocess_prefix_video
(prefix_video_path: str, config: MagiConfig)
inference/pipeline/video_process.py:326
↓ 2 callersMethodqueue_irecv_prev
Put the asynchronously received tensor and handle into the receive queue. Args: shape (torch.Size): The shape of the tensor to re
inference/infra/parallelism/pipeline_parallel.py:77
↓ 2 callersFunctionresize_pos_embed
(posemb, src_shape, target_shape)
inference/model/vae/vae_module.py:401
↓ 2 callersFunctionrot
(x)
inference/model/vae/vae_module.py:142
↓ 2 callersFunctionsave_video_to_disk
(video: torch.Tensor, save_path: str, fps: int)
inference/pipeline/video_process.py:258
↓ 2 callersFunctionset_random_seed
Set random seed. Args: seed (int): Seed to be used.
inference/common/common_utils.py:31
↓ 2 callersMethodsplit_tile_list
Splits the given tile size into a list of sizes that each rank should handle. This method takes into account the number of ranks in
inference/infra/parallelism/tile_parallel.py:27
↓ 2 callersMethodtile_processor
Property representing the tiled encoder or decoder. Returns: TileProcessor: The tiled encoder or decoder.
inference/model/vae/vae_model.py:107
↓ 2 callersFunctionupdate_packed_seq_params_for_cuda_graph
(cross_attn_params: PackedCrossAttnParams, xattn_mask: torch.Tensor)
inference/infra/parallelism/context_parallel.py:100
↓ 1 callersMethod_allocate_key_and_value_memory
Allocate memory to store kv cache during inference.
inference/model/dit/dit_module.py:800
↓ 1 callersFunction_build_dit_model
Builds the model
inference/model/dit/dit_model.py:600
↓ 1 callersMethod_create_config_from_dict
(cls, config_dict: dict)
inference/common/config.py:130
↓ 1 callersMethod_full_adjust_key_and_value
Saves the generated key and value tensors to the end of the buffers in inference_params. Returns the full size keys and values from t
inference/model/dit/dit_module.py:891
↓ 1 callersMethod_get_layer_offset
(self)
inference/model/dit/dit_module.py:1281
↓ 1 callersFunction_high_precision_promoter
(module: VideoDiTModel)
inference/model/dit/dit_model.py:621
↓ 1 callersFunction_process_null_embeddings
( null_caption_embedding: torch.Tensor, null_emb_masks: torch.Tensor, infer_chunk_num: int )
inference/pipeline/video_generate.py:67
↓ 1 callersFunction_process_txt_embeddings
( caption_embs: torch.Tensor, emb_masks: torch.Tensor, null_emb: torch.Tensor, infer_chunk_num: int, clean
inference/pipeline/video_generate.py:48
↓ 1 callersFunction_split_state_dict_for_pp
(weight_dict: OrderedDict, model_config: ModelConfig)
inference/infra/checkpoint/checkpointing.py:116
↓ 1 callersFunction_t5
(model_cache_dir, model_device, model_max_length)
inference/pipeline/prompt_process.py:132
↓ 1 callersFunctionall_to_all_output_split
Scatter seq_len and gather head_number, for example: input: (seq_len * cp, hn, hd) output: (seq_len, cp * hn, hd) NOTE: seq_len of ou
inference/infra/parallelism/context_parallel.py:404
↓ 1 callersMethodattn_linear_proj
(self, core_attn_out: torch.Tensor, cross_attn_out: torch.Tensor)
inference/model/dit/dit_module.py:1332
↓ 1 callersMethodattn_post_process
( self, core_attn_out: torch.Tensor, cross_attn_out: torch.Tensor, residual: t
inference/model/dit/dit_module.py:1320
↓ 1 callersMethodbasic_clean
(text)
inference/model/t5/t5_model.py:162
↓ 1 callersMethodblend_h
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
inference/infra/parallelism/tile_parallel.py:246
↓ 1 callersMethodblend_t
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
inference/infra/parallelism/tile_parallel.py:230
↓ 1 callersMethodblend_v
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
inference/infra/parallelism/tile_parallel.py:238
↓ 1 callersFunctionbuild_fourier_pos_embed
Args: feat_shape: Feature shape for embedding. bands: Pre-calculated frequency bands. num_bands: Number of frequency ban
inference/model/vae/vae_module.py:73
↓ 1 callersFunctionbuild_fourier_pos_embed
Args: feat_shape: Feature shape for embedding. bands: Pre-calculated frequency bands. num_bands: Number of frequency ban
inference/model/dit/dit_module.py:599
↓ 1 callersFunctionbuild_rotary_pos_embed
Args: feat_shape: Spatial shape of the target tensor for embedding. bands: Optional pre-generated frequency bands dim: O
inference/model/vae/vae_module.py:153
↓ 1 callersFunctionbuild_rotary_pos_embed
Args: feat_shape: Spatial shape of the target tensor for embedding. bands: Optional pre-generated frequency bands dim: O
inference/model/dit/dit_module.py:670
↓ 1 callersFunctioncache_rotary_emb
(feat_shape, device='cuda', dim=64, dtype=torch.bfloat16, max_res=512, ref_feat_shape=(4, 16, 16))
inference/model/vae/vae_module.py:249
↓ 1 callersMethodcaption_drop
Drops labels to enable classifier-free guidance. caption.shape = (N, 1, cap_len, C)
inference/model/dit/dit_module.py:126
↓ 1 callersMethodcaption_drop_single_token
(self, caption_dropout_mask)
inference/model/dit/dit_module.py:138
next →1–100 of 318, ranked by callers