MCPcopy Create free account

hub / github.com/NVlabs/Sana / functions

Functions2,606 in github.com/NVlabs/Sana

Method_initialize_crossattn_cache
(self, batch_size, dtype, device)
diffusion/longsana/pipeline/sana_training_pipeline.py:588
Method_is_softmax_option_y_block
Return ``True`` iff ``block.attn`` is a softmax-attention camctrl variant (``_SoftmaxUCPESinglePathLiteLA`` or registered aliases). D
diffusion/model/nets/sana_multi_scale_video_camctrl.py:1562
Method_key_scale
Return the post-ReLU key scale used by frame-wise GDN.
diffusion/model/nets/sana_gdn_blocks.py:273
Method_make_blend_mask
Create a 2D spatial blend mask with linear ramps in overlap regions. Interior pixels get weight 1. Pixels in the overlap band of a non-edge
diffusion/model/ltx2/causal_vae.py:1872
Method_move_optimizer_to_device
Move optimizer state to the specified device.
diffusion/longsana/trainer/self_forcing_trainer.py:313
Function_normalize_poses_identity_unit_distance
Normalize the poses such that the ref0 camera is the identity and the ref1 camera is unit distance to the ref0 camera.
diffusion/utils/cam_utils.py:214
Method_offload_stage1_after_streaming_sample
()
inference_video_scripts/wm/inference_sana_wm.py:1859
Function_patched_init_tokenizer
()
diffusion/post_training/rewards.py:168
Function_phase_a_kv_kernel
( qkv_ptr, stride_b: tl.constexpr, stride_n: tl.constexpr, stride_3: tl.constexpr, stride_
diffusion/model/ops/fused_gdn_chunkwise.py:310
Function_phase_a_z_kernel
Z stream: uses K (no RoPE). Cheaper than KV — no V load, no RoPE compute, no K_pair derivation.
diffusion/model/ops/fused_gdn_chunkwise.py:424
Function_phase_b_dtile_kernel
( I_P_kv_ptr, A_ptr, I_P_z_ptr, B_ptr, decay_ptr, M_fwd_ptr, z_fwd_ptr, M_rev_
diffusion/model/ops/fused_gdn_chunkwise.py:943
Function_phase_b_kernel
( I_P_kv_ptr, A_ptr, I_P_z_ptr, B_ptr, decay_ptr, M_fwd_ptr, z_fwd_ptr, M_rev_
diffusion/model/ops/fused_gdn_chunkwise.py:636
Function_phase_c_kernel
( qkv_ptr, stride_b: tl.constexpr, stride_n: tl.constexpr, stride_3: tl.constexpr, stride_
diffusion/model/ops/fused_gdn_chunkwise.py:1166
Function_precompute_inv_rms
Compute 1/RMS for one component of QKV over the full C = H*D channel dim. Args: qkv: (B, N, 3, H, D) idx: 0 for Q, 1 for K, 2 for
diffusion/model/ops/fused_gdn.py:134
Function_prepare_softmax_main_qkv_post_rope
Project Q/K/V for the softmax main branch, apply norm and RoPE. Returns post-norm, post-RoPE, post-bf16 cast tensors without running SDPA, so
diffusion/model/nets/sana_gdn_camctrl_blocks.py:68
Method_progress
(message: str, phase: str = "prepare", **extra: object)
inference_video_scripts/wm/inference_sana_wm.py:1701
Function_prune_linear_layer
(layer, index, dim=0)
diffusion/post_training/rewards.py:148
Method_record_section
(self, name: str, start: torch.cuda.Event, end: torch.cuda.Event)
diffusion/refiner/diffusers_ltx2_refiner.py:2208
Method_register_forward_hook
(self, module)
diffusion/utils/misc.py:348
Function_rms_norm_2d_bwd_dx_fused
( DX, # pointer to the input gradient DY, # pointer to the output gradient DW, # pointer to the
diffusion/model/dc_ae/efficientvit/models/nn/triton_rms_norm.py:70
Function_rms_norm_2d_fwd_fused
( X, # pointer to the input Y, # pointer to the output W, # pointer to the weights B, # po
diffusion/model/dc_ae/efficientvit/models/nn/triton_rms_norm.py:25
Method_scale_timesteps
(self, t)
diffusion/model/respace.py:479
Function_sdpa_unmasked_with_pad
Run ``F.scaled_dot_product_attention(q, k, v)`` with FA-friendly head_dim padding. FlashAttention-2 only supports head_dim in {32, 64, 128, 256}.
diffusion/model/nets/sana_gdn_camctrl_blocks.py:139
Method_should_switch_prompt
(self, chunk_start_frame: int, chunk_size: int)
diffusion/longsana/model/streaming_sana_long.py:143
Method_split_generators
(self, dl_manager: datasets.download.DownloadManager)
scripts/inference_geneval.py:136
Method_split_generators
(self, dl_manager: datasets.download.DownloadManager)
scripts/inference_sana_sprint_geneval.py:135
Function_stage1_forward_long_nvfp4
(_self, *args, **kwargs)
inference_video_scripts/wm/inference_sana_wm.py:322
Method_threshold_sample
"Dynamic thresholding: At each sampling step we set s to a certain percentile absolute pixel value in xt0 (the prediction of x_0 at t
diffusion/scheduler/lcm_scheduler.py:252
Method_unpack_latents_additional_layers
(latents, height, width, frame)
diffusion/model/nets/sana_multi_scale_video.py:525
Functionablation_sampler
( net, latents, class_labels=None, cfg_scale=None, feat=None, randn_like=torch.randn_l
diffusion/model/edm_sample.py:88
Methodadd_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, timeste
diffusion/scheduler/lcm_scheduler.py:410
Methodadd_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, timeste
diffusion/scheduler/sa_solver_diffusers.py:913
Methodadd_noise
Diffusion forward corruption process. Input: - clean_latent: the clean latent with shape [B*T, C, H, W] - noi
diffusion/scheduler/longlive_flow_euler_sampler.py:146
Methodadd_noise
Compute the noised input xt = alpha_t * x + sigma_t * noise. Args: x: A `torch.Tensor` with shape `(batch_size, *shape)`
diffusion/model/dpm_solver.py:1484
Methodadd_noise
Diffusion forward corruption process. Input: - clean_latent: the clean latent with shape [B*T, C, H, W] - noi
diffusion/longsana/utils/scheduler.py:140
Methodadd_params
Add all parameters of module to the params list. The parameters of the given module will be added to the list of param groups, with s
diffusion/utils/optimizer.py:52
Methodadd_transform
Add a transformation to the dataset.
diffusion/data/wids/wids.py:585
Functionall_gather
Run all_gather on arbitrary picklable data (not necessarily tensors) Args: data: any picklable object Returns: list[data]
diffusion/utils/dist_utils.py:103
Functionall_gather_cpu
(result_part, tmpdir=None, collect_by_master=True)
diffusion/utils/dist_utils.py:186
Functionanalyze_chunk_pattern
Analyze chunk pattern and return vectorization strategy. Detects special patterns that allow hybrid vectorization: - uniform: All chunks equa
diffusion/utils/chunk_utils.py:293
Functionapply_drop_func
(network: nn.Module, drop_config: Optional[dict[str, Any]])
diffusion/model/dc_ae/efficientvit/models/nn/drop.py:30
Functionapply_droppath
( network: nn.Module, drop_prob: float, linear_decay=True, scheduled=True, skip=0, )
diffusion/model/dc_ae/efficientvit/models/nn/drop.py:44
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:359
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:429
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:532
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:747
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:819
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:1680
Methodapply_rotary_emb
(hidden_states: torch.Tensor, freqs: torch.Tensor)
diffusion/model/nets/sana_blocks.py:1821
Functionattention
( q, k, v, q_lens=None, k_lens=None, dropout_p=0.0, softmax_scale=None, q_scal
diffusion/model/wan/attention.py:237
Methodavg
(self)
diffusion/model/dc_ae/efficientvit/apps/utils/metric.py:45
Methodbackward
(ctx, *grads)
diffusion/utils/dist_utils.py:279
Methodbackward
(ctx, grad_output: torch.Tensor)
diffusion/model/nets/sana_gdn_blocks.py:104
Methodbackward
(ctx, grad_y: torch.Tensor)
diffusion/model/nets/fastlinear/modules/triton_lite_mla_fwd.py:54
Methodbackward
(ctx, dy)
diffusion/model/dc_ae/efficientvit/models/nn/triton_rms_norm.py:169
Methodbatch_end_frame
(self)
diffusion/utils/misc.py:314
Methodbias
(self)
train_scripts/sol_rl/train_utils.py:395
Functionblock_sparse_attention
q: [B, Lq, Nq, C1]. k: [B, Lk, Nk, C1]. v: [B, Lk, Nk, C2]. Nq must be divisible by Nk. q_lens
diffusion/model/wan/attention.py:140
Functionbroadcast
(data, **kwargs)
diffusion/utils/dist_utils.py:178
Functionbuild_act
(name: str or None, **kwargs)
diffusion/model/act.py:40
Methodbuild_optimizer
r"""require setting 'batch_per_epoch' before building optimizer & lr_scheduler
diffusion/model/dc_ae/efficientvit/apps/trainer/run_config.py:72
Methodcache_mode
Get current cache mode.
diffusion/model/ltx2/causal_vae.py:118
Methodcalc_bpd_loop
Compute the entire variational lower-bound, measured in bits-per-dim, as well as other related quantities. :param model: the
diffusion/model/gaussian_diffusion.py:996
Functioncam_scan_bidi_chunkwise_cuda
Drop-in for fused_gdn_chunkwise.cam_scan_bidi_chunkwise. CUDA fast path when head_dim==128 & fp32 contiguous inputs (the deployed sana_wm con
diffusion/model/ops/fused_gdn_chunkwise_cuda.py:807
Functioncam_scan_chunkwise_cuda
Drop-in for fused_gdn_chunkwise.cam_scan_chunkwise (the STREAMING/cached causal cam scan). CUDA cam_phase_a + cam_phase_c (read q/k/v [B,H,D,N] di
diffusion/model/ops/fused_gdn_chunkwise_cuda.py:853
Functioncam_scan_pair_chunkwise
Sum a forward camera scan and a separately-gated reverse scan. Chunk-causal camera attention needs the reverse branch to use boundary-masked
diffusion/model/ops/fused_gdn_chunkwise.py:2140
Methodchat
Chatbot function to generate responses based on the given prompt and optional image.
diffusion/model/qwen/qwen_vl.py:211
Methodcheck_current_kv_cache
Check whether the current kv_cache is valid
diffusion/longsana/model/streaming_sana_long.py:334
Functionclassify_height_width_bin
Returns binned height and width.
app/sana_controlnet_pipeline.py:54
Methodcleanup_old_checkpoints
Remove old checkpoints if the number exceeds max_checkpoints. Only the main process performs the actual deletion to avoid race conditions
diffusion/longsana/trainer/self_forcing_trainer.py:369
Methodclear
(self)
diffusion/model/wan/model.py:30
Methodclear_mask
Clear the current mask
app/app_sana_inpaint.py:267
Functioncli
(func)
app/sana_video_refiner_pipeline_diffusers.py:14
Functionclip_grad_norm_
(self, max_norm: Union[float, int], norm_type: Union[float, int] = 2.0)
diffusion/utils/dist_utils.py:303
Functionclip_score
(device)
diffusion/post_training/rewards.py:324
Methodclose
(self, dispose=False)
diffusion/data/wids/wids_mmtar.py:80
Methodclose
(self)
diffusion/data/wids/wids_tar.py:96
Methodclose
(self)
diffusion/data/wids/wids.py:298
Methodcollate_fn
(examples)
diffusion/post_training/prompt_dataset.py:47
Methodcollate_fn
(examples)
diffusion/post_training/prompt_dataset.py:67
Methodcollect_from_block
(block: torch.nn.Module, block_idx: int)
diffusion/scheduler/self_forcing_flow_euler_sampler.py:228
Methodcollect_from_block
(block, block_idx)
diffusion/scheduler/longlive_flow_euler_sampler.py:369
Methodcollect_from_block
(block, block_idx)
diffusion/longsana/pipeline/sana_inference_interactive_pipeline_long_chunk.py:81
Methodcollect_from_block
Collect cached modules from a single transformer block
diffusion/longsana/pipeline/sana_training_pipeline.py:543
Methodcollect_from_block
(block, block_idx)
diffusion/longsana/pipeline/sana_inference_pipeline.py:63
Methodcollect_from_block
(block, block_idx)
diffusion/longsana/pipeline/sana_inference_interactive_pipeline.py:84
Methodcollect_recursive
(module: torch.nn.Module)
diffusion/scheduler/self_forcing_flow_euler_sampler.py:232
Methodcollect_recursive
(module)
diffusion/scheduler/longlive_flow_euler_sampler.py:373
Methodcollect_recursive
(module)
diffusion/longsana/pipeline/sana_inference_interactive_pipeline_long_chunk.py:85
Methodcollect_recursive
(module)
diffusion/longsana/pipeline/sana_training_pipeline.py:548
Methodcollect_recursive
(module)
diffusion/longsana/pipeline/sana_inference_pipeline.py:67
Methodcollect_recursive
(module)
diffusion/longsana/pipeline/sana_inference_interactive_pipeline.py:88
Functioncompute_num_samples
(fname)
diffusion/data/wids/wids.py:107
Methodcondition_mean
(self, cond_fn, *args, **kwargs)
diffusion/model/respace.py:468
Methodcondition_score
(self, cond_fn, *args, **kwargs)
diffusion/model/respace.py:471
Methodconstruct_python_tuple
(self, node)
diffusion/utils/misc.py:39
Methodconstruct_python_tuple
(self, node)
diffusion/model/dc_ae/efficientvit/apps/utils/misc.py:98
Functioncontinuous_gaussian_log_likelihood
Compute the log-likelihood of a continuous Gaussian distribution. :param x: the targets :param means: the Gaussian mean Tensor. :para
diffusion/model/diffusion_utils.py:56
Methodconvert_noise_to_x0
Convert the diffusion network's noise prediction to x0 predidction. noise: the predicted noise with shape [B, C, H, W] xt: th
diffusion/scheduler/longlive_flow_euler_sampler.py:49
Methodconvert_noise_to_x0
Convert the diffusion network's noise prediction to x0 predidction. noise: the predicted noise with shape [B, C, H, W] xt: th
diffusion/longsana/utils/scheduler.py:43
← previousnext →1,901–2,000 of 2,606, ranked by callers