MCPcopy Create free account

hub / github.com/state-spaces/mamba / functions

Functions436 in github.com/state-spaces/mamba

↓ 1 callersMethodreset
(self, max_seqlen, max_batch_size)
mamba_ssm/utils/generation.py:29
↓ 1 callersMethodreset_parameters
(self)
mamba_ssm/ops/triton/layernorm_gated.py:404
↓ 1 callersMethodreset_parameters
(self)
mamba_ssm/ops/triton/layernorm_gated.py:430
↓ 1 callersMethodreset_parameters
(self)
mamba_ssm/ops/triton/layer_norm.py:969
↓ 1 callersFunctionrms_norm_fn
( x, weight, bias, residual=None, x1=None, weight1=None, bias1=None, eps=1e-6,
mamba_ssm/ops/triton/layer_norm.py:922
↓ 1 callersMethodrun
(self)
setup.py:336
↓ 1 callersFunctionsample
Sample from top-k logits. Arguments: logits: Tensor of shape (batch_size, vocab_size)
mamba_ssm/utils/generation.py:83
↓ 1 callersFunctionsech2_approx
(Fast) square of the hyperbolic secant approximation using PTX inline assembly. Args: x: Input triton tensor (any shape) in float32
mamba_ssm/ops/triton/mamba3/utils.py:72
↓ 1 callersFunctionsegsum_unstable
(x: Tensor)
tests/ops/tilelang/test_mamba3_mimo.py:631
↓ 1 callersFunctionselect
(a: cute.Tensor, mode: List[int])
mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py:28
↓ 1 callersFunctionselective_scan_ref
u: r(B D L) delta: r(B D L) A: c(D N) or r(D N) B: c(D N) or r(B N L) or r(B N 2L) or r(B G N L) or (B G N L) C: c(D N) or r(B N
mamba_ssm/ops/selective_scan_interface.py:115
↓ 1 callersFunctionshould_stop
(current_token, inference_params)
mamba_ssm/utils/generation.py:205
↓ 1 callersFunctionssd_minimal_discrete
Arguments: X: (batch, length, n_heads, d_head) A: (batch, length, n_heads) B: (batch, length, n_heads, d_state) C
mamba_ssm/modules/ssd_minimal.py:34
↓ 1 callersFunctionstate_passing
Argument: states: (batch, nchunks, nheads, dim) dA_chunk_cumsum: (batch, nheads, nchunks) initial_states: (batch, nheads,
mamba_ssm/ops/triton/ssd_state_passing.py:314
↓ 1 callersFunctionstate_passing_ref
Argument: states: (batch, nchunks, nheads, dim) dA_chunk_cumsum: (batch, nheads, nchunks) initial_states: (batch, nheads,
mamba_ssm/ops/triton/ssd_state_passing.py:327
↓ 1 callersMethodstep
(self, hidden_states, conv_state, ssm_state)
mamba_ssm/modules/mamba_simple.py:208
↓ 1 callersMethodstep
(self, hidden_states, conv_state, ssm_state)
mamba_ssm/modules/mamba2.py:278
↓ 1 callersFunctiontest_bwd_dadt_fused_varlen_correctness
Test bwd_dadt_fused_triton_varlen against varlen reference.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1588
↓ 1 callersFunctiontest_bwd_ddt_fused_correctness
Test bwd_dadt_fused_triton (dense) against the reference implementations.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1413
↓ 1 callersFunctiontest_correctness_qk_inference
()
mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py:327
↓ 1 callersFunctiontest_dacs_segsum_correctness
Test the dense dacs+segsum Triton kernel against the dense reference.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1555
↓ 1 callersFunctiontest_dacs_segsum_correctness_varlen
()
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1503
↓ 1 callersFunctiontest_dtrap_ddt_correctness
Test bwd_dtrap_ddt_triton (dense) against compute_dtrap_ddt_ref.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1458
↓ 1 callersFunctiontest_dtrap_ddt_varlen_correctness
Test bwd_dtrap_ddt_triton_varlen against varlen reference.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1655
↓ 1 callersFunctiontest_mamba3_siso_combined_batched
Test Mamba-3 combined forward+backward against fwd reference.
tests/ops/triton/test_mamba3_siso.py:561
↓ 1 callersFunctiontest_mamba3_siso_combined_varlen
Test Mamba-3 combined forward+backward with variable-length sequences against fwd reference.
tests/ops/triton/test_mamba3_siso.py:675
↓ 1 callersFunctiontest_mamba3_siso_step_ref_vs_fwd_ref
Test that mamba3_siso_step_ref and mamba3_siso_fwd_ref produce identical outputs.
tests/ops/triton/test_mamba3_siso.py:843
↓ 1 callersMethodtie_weights
(self)
mamba_ssm/models/mixer_seq_simple.py:267
↓ 1 callersFunctionupdate_graph_cache
( model, cache, batch_size, seqlen_og, max_seqlen, decoding_seqlens=(1,), dtype=No
mamba_ssm/utils/generation.py:283
Method__call__
( # B: batch size, H: num heads, D: head dim, N: dstate, R: mimo self, mState: cute.Te
mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py:86
Method__init__
(self, pretrained="state-spaces/mamba-2.8b", max_length=2048, batch_size=None, device="cuda",
evals/lm_harness_eval.py:19
Method__init__
If group_size is not None, we do GroupNorm with each group having group_size elements. group_size=None is equivalent to group_size=hidden_size
mamba_ssm/ops/triton/layernorm_gated.py:390
Method__init__
(self, hidden_size, eps=1e-5, dropout_p=0.0, device=None, dtype=None)
mamba_ssm/ops/triton/layer_norm.py:957
Method__init__
(self, tile_D: int, dstate: int, mimo: int = 1, num_warps: int = 4, remove_gate: bool = False, remove_outproj:
mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py:49
Method__init__
num_heads_kv: can be used to toggle MQA / GQA. If None, use num_heads. return_residual: whether to return the input x along with the
mamba_ssm/modules/mha.py:47
Method__init__
( self, d_model, d_state=16, d_conv=4, expand=2, dt_rank="auto
mamba_ssm/modules/mamba_simple.py:32
Method__init__
Simple block wrapping a mixer class with LayerNorm/RMSNorm and residual connection" This Block has a slightly different structure co
mamba_ssm/modules/block.py:11
Method__init__
( self, d_model, d_state=64, d_conv=4, conv_init=None, expand=
mamba_ssm/modules/mamba2_simple.py:25
Method__init__
( self, in_features, hidden_features=None, out_features=None, activati
mamba_ssm/modules/mlp.py:7
Method__init__
( self, d_model, d_state=128, expand=2, headdim=64, ngroups=1,
mamba_ssm/modules/mamba3.py:27
Method__init__
( self, d_model, d_state=128, d_conv=4, conv_init=None, expand
mamba_ssm/modules/mamba2.py:38
Method__init__
( self, in_features: int, out_features: int, process_group: ProcessGroup,
mamba_ssm/distributed/tensor_parallel.py:112
Method__init__
(self, num_embeddings, *args, process_group=None, padding_idx=None, **kwargs)
mamba_ssm/distributed/tensor_parallel.py:195
Method__init__
(self, num_embeddings, embedding_dim, *args, process_group=None, **kwargs)
mamba_ssm/distributed/tensor_parallel.py:227
Method__init__
If max_position_embeddings <= 0, there's no position embeddings
mamba_ssm/distributed/tensor_parallel.py:242
Method__init__
( self, config: MambaConfig, initializer_cfg=None, device=None, dtype=
mamba_ssm/models/mixer_seq_simple.py:217
Function_alloc_fn
Custom allocator for TMA descriptor global memory allocation.
mamba_ssm/ops/triton/mamba3/mamba3_siso_step.py:228
Function_alloc_fn
Custom allocator for TMA descriptor global memory allocation.
mamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py:435
Function_alloc_fn
Custom allocator for TMA descriptor global memory allocation.
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:1783
Function_bmm_chunk_bwd_kernel
( # Pointers to matrices a_ptr, dout_ptr, db_ptr, res_ptr, # Matrix dimensions seqlen, chunk_s
mamba_ssm/ops/triton/ssd_bmm.py:111
Function_bmm_chunk_fwd_kernel
( # Pointers to matrices a_ptr, b_ptr, out_ptr, seq_idx_ptr, # Matrix dimensions seqlen, chunk
mamba_ssm/ops/triton/ssd_bmm.py:37
Function_chunk_cumsum_bwd_kernel
( # Pointers to matrices ddA_ptr, ddt_out_ptr, dt_ptr, A_ptr, dt_bias_ptr, ddt_ptr, dA_ptr, ddt_bi
mamba_ssm/ops/triton/ssd_chunk_state.py:102
Function_chunk_cumsum_fwd_kernel
( # Pointers to matrices dt_ptr, A_ptr, dt_bias_ptr, dt_out_ptr, dA_cumsum_ptr, # Matrix dimension
mamba_ssm/ops/triton/ssd_chunk_state.py:40
Function_chunk_scan_bwd_dc_kernel
( # Pointers to matrices dout_ptr, prev_states_ptr, C_ptr, dA_cumsum_ptr, seq_idx_ptr, dc_ptr, ddA
mamba_ssm/ops/triton/ssd_chunk_scan.py:530
Function_chunk_scan_bwd_dcb_kernel
( # Pointers to matrices x_ptr, dout_ptr, cb_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr, dcb_ptr, ddA
mamba_ssm/ops/triton/ssd_chunk_scan.py:774
Function_chunk_scan_bwd_ddAcs_prev
(prev_states, C, dout, dA_cumsum, seq_idx=None)
mamba_ssm/ops/triton/ssd_chunk_scan.py:1732
Function_chunk_scan_bwd_ddAcs_prev_kernel
( # Pointers to matrices dout_ptr, prev_states_ptr, C_ptr, dA_cumsum_ptr, seq_idx_ptr, ddA_cumsum_
mamba_ssm/ops/triton/ssd_chunk_scan.py:1198
Function_chunk_scan_bwd_ddAcs_stable_kernel
( # Pointers to matrices x_ptr, dout_ptr, dt_ptr, dA_cumsum_ptr, cb_ptr, ddA_cumsum_ptr, # Mat
mamba_ssm/ops/triton/ssd_chunk_scan.py:1098
Function_chunk_scan_bwd_ddAcs_stable_kernel_old
( # Pointers to matrices x_ptr, dout_ptr, dt_ptr, dA_cumsum_ptr, cb_ptr, ddAcs_ptr, # Matrix d
mamba_ssm/ops/triton/ssd_chunk_scan.py:979
Function_chunk_scan_bwd_ddAcs_stable_old
(x, dt, dA_cumsum, dout, cb)
mamba_ssm/ops/triton/ssd_chunk_scan.py:1667
Function_chunk_scan_bwd_ddAcs_unstable_kernel
( # Pointers to matrices dout_ptr, out_ptr, dt_ptr, ddt_ptr, x_ptr, D_ptr, ddA_cumsum_ptr, dD_ptr,
mamba_ssm/ops/triton/ssd_chunk_scan.py:889
Function_chunk_scan_bwd_dstates_kernel
( # Pointers to matrices dout_ptr, c_ptr, dprev_states_ptr, dA_cumsum_ptr, seq_idx_ptr, # Matrix d
mamba_ssm/ops/triton/ssd_chunk_scan.py:449
Function_chunk_scan_bwd_dx_kernel
( # Pointers to matrices x_ptr, cb_ptr, dout_ptr, dt_ptr, dA_cumsum_ptr, D_ptr, dx_ptr, ddt_ptr, #
mamba_ssm/ops/triton/ssd_chunk_scan.py:641
Function_chunk_scan_bwd_dz_kernel
( # Pointers to matrices dout_ptr, out_ptr, z_ptr, x_ptr, D_ptr, outz_ptr, dz_ptr, dout_x_ptr, dD_ptr,
mamba_ssm/ops/triton/ssd_chunk_scan.py:349
Function_chunk_scan_chunk_state_bwd_dx_kernel
( # Pointers to matrices x_ptr, cb_ptr, dout_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr, D_ptr, b_ptr
mamba_ssm/ops/triton/ssd_combined.py:93
Function_chunk_scan_fwd_kernel
( # Pointers to matrices cb_ptr, x_ptr, z_ptr, out_ptr, out_x_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr,
mamba_ssm/ops/triton/ssd_chunk_scan.py:49
Function_chunk_scan_fwd_kernel_wip
( # Pointers to matrices cb_ptr, x_ptr, z_ptr, out_ptr, out_x_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr,
mamba_ssm/ops/triton/ssd_chunk_scan.py:195
Function_chunk_scan_fwd_wip
(cb, x, dt, dA_cumsum, C, B, states, D=None, z=None, seq_idx=None)
mamba_ssm/ops/triton/ssd_chunk_scan.py:1311
Function_chunk_state_bwd_db_kernel
( # Pointers to matrices x_ptr, dstates_ptr, b_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr, db_ptr, dd
mamba_ssm/ops/triton/ssd_chunk_state.py:398
Function_chunk_state_bwd_ddAcs_stable_kernel
( # Pointers to matrices x_ptr, b_ptr, dstates_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr, ddA_cumsum
mamba_ssm/ops/triton/ssd_chunk_state.py:528
Function_chunk_state_bwd_dx_kernel
( # Pointers to matrices x_ptr, b_ptr, dstates_ptr, dt_ptr, dA_cumsum_ptr, dx_ptr, ddt_ptr, ddA_cu
mamba_ssm/ops/triton/ssd_chunk_state.py:286
Function_chunk_state_fwd_kernel
( # Pointers to matrices x_ptr, b_ptr, states_ptr, dt_ptr, dA_cumsum_ptr, seq_idx_ptr, # Matrix di
mamba_ssm/ops/triton/ssd_chunk_state.py:192
Function_chunk_state_varlen_kernel
( # Pointers to matrices x_ptr, b_ptr, dt_ptr, dA_cumsum_ptr, chunk_states_ptr, cu_seqlens_ptr, states
mamba_ssm/ops/triton/ssd_chunk_state.py:640
Function_estimate_config_cost
Estimate shared memory cost of a config. Lower is cheaper.
mamba_ssm/utils/determinism.py:35
Function_init_weights
( module, n_layer, initializer_range=0.02, # Now only used for embedding layer. rescale_preno
mamba_ssm/models/mixer_seq_simple.py:86
Function_kernel_deps
()
tests/ops/cute/test_mamba3_mimo_step.py:69
Function_layer_norm_bwd_kernel
( X, # pointer to the input W, # pointer to the weights B, # pointer to the biases Z,
mamba_ssm/ops/triton/layernorm_gated.py:155
Function_layer_norm_bwd_kernel
( X, # pointer to the input W, # pointer to the weights B, # pointer to the biases Y, # po
mamba_ssm/ops/triton/layer_norm.py:436
Function_layer_norm_fwd_1pass_kernel
( X, # pointer to the input Y, # pointer to the output W, # pointer to the weights B, # po
mamba_ssm/ops/triton/layernorm_gated.py:45
Function_layer_norm_fwd_1pass_kernel
( X, # pointer to the input Y, # pointer to the output W, # pointer to the weights B, # po
mamba_ssm/ops/triton/layer_norm.py:181
Method_model_generate
(self, context, max_length, stop, **generation_kwargs)
evals/lm_harness_eval.py:34
Function_selective_scan_update_kernel
( # Pointers to matrices state_ptr, x_ptr, dt_ptr, dt_bias_ptr, A_ptr, B_ptr, C_ptr, D_ptr, z_ptr, out
mamba_ssm/ops/triton/selective_state_update.py:24
Function_state_passing_bwd_kernel
( # Pointers to matrices dout_ptr, out_ptr, dA_cs_ptr, dfinal_states_ptr, seq_idx_ptr, dstates_ptr
mamba_ssm/ops/triton/ssd_state_passing.py:102
Function_state_passing_fwd_kernel
( # Pointers to matrices states_ptr, out_ptr, final_states_ptr, dA_cs_ptr, initstates_ptr, seq_idx_ptr
mamba_ssm/ops/triton/ssd_state_passing.py:30
Function_swiglu_bwd_kernel
( X, Y, DOUT, OUT, DX, DY, stride_x_row, # how much to increase the pointer when
mamba_ssm/ops/triton/k_activations.py:78
Function_swiglu_fwd_kernel
( X, Y, OUT, stride_x_row, # how much to increase the pointer when moving by 1 row stride
mamba_ssm/ops/triton/k_activations.py:23
Function_triton_alloc_fn
Allocator for Triton runtime memory (TMA descriptors, scratch).
mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py:21
Methodallocate_inference_cache
(self, batch_size, max_seqlen, dtype=None, **kwargs)
mamba_ssm/modules/mamba_simple.py:255
Methodallocate_inference_cache
(self, batch_size, max_seqlen, dtype=None, **kwargs)
mamba_ssm/modules/block.py:90
Methodallocate_inference_cache
(self, batch_size, max_seqlen, dtype=None, **kwargs)
mamba_ssm/modules/mamba2.py:345
Methodallocate_inference_cache
(self, batch_size, max_seqlen, dtype=None, **kwargs)
mamba_ssm/models/mixer_seq_simple.py:271
Functionallreduce_sequence_parallel_grad
(model: torch.nn.Module, process_group: ProcessGroup)
mamba_ssm/distributed/distributed_utils.py:120
Functionangle_dt_bwd_kernel
( # Outputs GRAD_ANGLE, GRAD_DT, GRAD_INIT_STATE, # Inputs GRAD_OUT, GRAD_OUTPUT_STATE, ANGLE,
mamba_ssm/ops/triton/mamba3/angle_dt.py:232
Functionangle_dt_fwd_kernel
( # Outputs OUT, OUTPUT_STATE, # Inputs ANGLE, DT, INIT_STATE, CU_SEQLENS, # Strides for O
mamba_ssm/ops/triton/mamba3/angle_dt.py:24
Functionautotune_configs
Select autotune configs for deterministic mode. Uses cached autotuning (TRITON_CACHE_AUTOTUNING=1) if Triton >= 3.4.0, otherwise auto-sel
mamba_ssm/utils/determinism.py:59
Methodbackward
(ctx, dout, *args)
mamba_ssm/ops/selective_scan_interface.py:59
Methodbackward
(ctx, dout)
mamba_ssm/ops/selective_scan_interface.py:282
Methodbackward
(ctx, dout)
mamba_ssm/ops/triton/ssd_chunk_scan.py:1798
Methodbackward
(ctx, dy)
mamba_ssm/ops/triton/layernorm_gated.py:369
Methodbackward
(ctx, dy, *args)
mamba_ssm/ops/triton/layer_norm.py:828
← previousnext →201–300 of 436, ranked by callers