MCPcopy Create free account

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

Functions436 in github.com/state-spaces/mamba

Methodbackward
(ctx, dout, *args)
mamba_ssm/ops/triton/layer_norm.py:1047
Methodbackward
(ctx, dstates)
mamba_ssm/ops/triton/ssd_chunk_state.py:1067
Methodbackward
(ctx, dout, dfinal_states)
mamba_ssm/ops/triton/ssd_state_passing.py:300
Methodbackward
(ctx, dout, *args)
mamba_ssm/ops/triton/ssd_combined.py:616
Methodbackward
(ctx, dout, *args)
mamba_ssm/ops/triton/ssd_combined.py:897
Methodbackward
Backward pass: compute gradients using Triton backward kernels.
mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py:153
Methodbackward
Backward pass: compute gradients using Tilelang backward kernels.
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo.py:121
Methodbackward
(ctx, grad_output: Tensor)
mamba_ssm/distributed/distributed_utils.py:59
Methodbackward
(ctx, grad_output: Tensor)
mamba_ssm/distributed/distributed_utils.py:78
Methodbackward
(ctx, grad_output: Tensor)
mamba_ssm/distributed/distributed_utils.py:97
Methodbackward
(ctx, grad_output)
mamba_ssm/distributed/tensor_parallel.py:62
Methodbatch_size
(self)
evals/lm_harness_eval.py:31
Functionbenchmark_bwd_ddt
Benchmark fused kernel against unfused baseline.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1704
Functionbenchmark_dacs_segsum
Benchmark dacs+segsum Triton against reference implementation.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1767
Functionbenchmark_dtrap_ddt
Benchmark dtrap/ddt kernel against reference implementation.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1804
Functionbwd_dadt_cumsum_fused_kernel
Compute ddt contributions from ddA_cs (reverse-cumsum) and ddA_cs_rev (forward-exclusive-cumsum) within each chunk. Each program handles one
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:72
Functionbwd_dadt_cumsum_fused_kernel_varlen
Varlen version of bwd_dadt_cumsum_fused_kernel. Grid: (B, H, nchunks_global). Each program handles one global chunk slot.
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1020
Functionbwd_dtrap_ddt_kernel
Back-propagate through the trapezoidal-rule gamma parameterisation. The forward pass computes: gamma[t] = sigmoid(trap[t]) * dt[t]
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:235
Functionbwd_dtrap_ddt_kernel_varlen
Varlen version of bwd_dtrap_ddt_kernel. Grid: (B, H, nchunks_global).
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1160
Functionbwd_segsum_dadt_kernel
Accumulate the inter-token segsum contribution of dSSdA into ddt. For each [C×C] chunk block the operation is: 1. Load dSSdA[chunk] (stor
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:148
Functionbwd_segsum_dadt_kernel_varlen
Varlen version of bwd_segsum_dadt_kernel. Grid: (B, H, nchunks_global).
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1089
Functiondacs_segsum_kernel
Dense (fixed-length) version of dacs_segsum_kernel_varlen. Computes da_cs, da_cs_rev, and the lower-triangular segsum matrix for each contigu
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:453
Functiondacs_segsum_kernel_varlen
Varlen version of dacs_segsum_kernel. Computes da_cs (forward prefix-sum of da, clipped to ≤ 0), da_cs_rev (exclusive reverse prefix-sum, cli
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:369
Functiondecorator
(*args, **kwargs)
mamba_ssm/utils/torch.py:6
Functiondetach_clone
Detach and clone tensors, preserving None values.
tests/ops/triton/test_mamba3_siso.py:346
Functiondetach_clone
(*args)
tests/ops/triton/test_ssd.py:20
Functiondispatch
(input_ids, position_ids, seqlen)
mamba_ssm/utils/generation.py:333
Methodforward
(ctx, u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False, return_last_st
mamba_ssm/ops/selective_scan_interface.py:26
Methodforward
xz: (batch, dim, seqlen)
mamba_ssm/ops/selective_scan_interface.py:188
Methodforward
(ctx, B, C, x, dt, dA_cumsum, prev_states, D=None, z=None)
mamba_ssm/ops/triton/ssd_chunk_scan.py:1767
Methodforward
(ctx, xy)
mamba_ssm/ops/triton/k_activations.py:161
Methodforward
If z is not None, we do norm(x) * silu(z) if norm_before_gate, else norm(x * silu(z))
mamba_ssm/ops/triton/layernorm_gated.py:341
Methodforward
If z is not None, we do norm(x) * silu(z) if norm_before_gate, else norm(x * silu(z))
mamba_ssm/ops/triton/layernorm_gated.py:408
Methodforward
If z is not None, we do norm(x) * silu(z) if norm_before_gate, else norm(x * silu(z))
mamba_ssm/ops/triton/layernorm_gated.py:433
Methodforward
( ctx, x, weight, bias, residual=None, x1=None, weight
mamba_ssm/ops/triton/layer_norm.py:730
Methodforward
(self, x, residual=None, prenorm=False, residual_in_fp32=False)
mamba_ssm/ops/triton/layer_norm.py:972
Methodforward
( ctx, x, norm_weight, norm_bias, linear_weight, linear_bias,
mamba_ssm/ops/triton/layer_norm.py:988
Methodforward
(ctx, B, x, dt, dA_cumsum, states_in_fp32=True)
mamba_ssm/ops/triton/ssd_chunk_state.py:1050
Methodforward
(ctx, states, dA_chunk_cumsum, initial_states=None)
mamba_ssm/ops/triton/ssd_state_passing.py:289
Methodforward
(ctx, x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, initial_states=None, seq_idx=None, cu_seqlens=
mamba_ssm/ops/triton/ssd_combined.py:596
Methodforward
(ctx, zxbcdt, conv1d_weight, conv1d_bias, dt_bias, A, D, chunk_size, initial_states=None, seq_idx=None, dt_lim
mamba_ssm/ops/triton/ssd_combined.py:819
Methodforward
Forward pass: call Triton kernel and save tensors for backward.
mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py:54
Methodforward
Forward pass: call Triton/Tilelang kernel and save tensors for backward.
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo.py:34
Methodforward
Arguments: x: (batch, seqlen, hidden_dim) (where hidden_dim = num heads * head dim) if cu_seqlens is None and max
mamba_ssm/modules/mha.py:201
Methodforward
hidden_states: (B, L, D) Returns: same shape as hidden_states
mamba_ssm/modules/mamba_simple.py:119
Methodforward
r"""Pass the input through the encoder layer. Args: hidden_states: the sequence to the encoder layer (required). resi
mamba_ssm/modules/block.py:42
Methodforward
u: (B, L, D) Returns: same shape as u
mamba_ssm/modules/mamba2_simple.py:124
Methodforward
(self, x)
mamba_ssm/modules/mlp.py:29
Methodforward
u: (batch, seqlen, hidden_dim) Returns: same shape as u
mamba_ssm/modules/mamba3.py:135
Methodforward
u: (batch, seqlen, hidden_dim) if seqlen=None. If seqlen is not None, u is (batch * seqlen, hidden_dim). This is so that when we
mamba_ssm/modules/mamba2.py:154
Methodforward
(ctx, input_: Tensor, process_group: ProcessGroup)
mamba_ssm/distributed/distributed_utils.py:53
Methodforward
(ctx, input_: Tensor, process_group: ProcessGroup)
mamba_ssm/distributed/distributed_utils.py:72
Methodforward
(ctx, input_: Tensor, process_group: ProcessGroup)
mamba_ssm/distributed/distributed_utils.py:91
Methodforward
If process_group is not None and sequence_parallel=True, we're doing Tensor Parallel with sequence parallelism: we do an all_gather_r
mamba_ssm/distributed/tensor_parallel.py:26
Methodforward
(self, x)
mamba_ssm/distributed/tensor_parallel.py:138
Methodforward
(self, input: Tensor)
mamba_ssm/distributed/tensor_parallel.py:210
Methodforward
input_ids: (batch, seqlen) position_ids: (batch, seqlen)
mamba_ssm/distributed/tensor_parallel.py:273
Methodforward
(self, input_ids, inference_params=None, **mixer_kwargs)
mamba_ssm/models/mixer_seq_simple.py:190
Methodforward
"position_ids" is just to be compatible with Transformer generation. We don't use it. num_last_tokens: if > 0, only return the logits
mamba_ssm/models/mixer_seq_simple.py:274
Functionfull_step_fn
()
tests/ops/cute/test_mamba3_mimo_step.py:282
Functionfused_impl
()
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1746
Functionget_dim_for_local_rank
Get the dim for the local rank derived from splitting dim on world_size processes. The split may not be even across the world_size processes.
mamba_ssm/distributed/distributed_utils.py:135
Functiongrid
(META)
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:165
Functioninit_to_zero
(names)
mamba_ssm/ops/triton/ssd_chunk_scan.py:28
Functioninit_to_zero
(names)
mamba_ssm/ops/triton/ssd_bmm.py:18
Functioninit_to_zero
(names)
mamba_ssm/ops/triton/ssd_chunk_state.py:24
Functioninit_to_zero
(names)
mamba_ssm/ops/triton/ssd_combined.py:55
Functionlayer_norm_linear_fn
( x, norm_weight, norm_bias, linear_weight, linear_bias, residual=None, eps=1e-6,
mamba_ssm/ops/triton/layer_norm.py:1092
Functionlayer_norm_ref
( x, weight, bias, residual=None, x1=None, weight1=None, bias1=None, eps=1e-6,
mamba_ssm/ops/triton/layer_norm.py:22
Functionmamba3_mimo
Mamba-3 attention with Tilelang kernels and automatic differentiation. Args: Q: Query tensor (batch, seqlen, mimo_rank, nheads_qk, he
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo.py:227
Functionmamba3_siso_bwd_kernel_ddt_dtrap_dinput_states
Backward kernel for computing dDT, dTrap, and input state gradients. Part 1 - dDT and dTrap from dScale and dGamma: Forward: gam
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:1430
Functionmamba3_siso_bwd_kernel_dk_state_post
Post-kernel for d_ok_state contributions. Grid: (nheads, batch) Each program handles one (batch, nhead) pair and computes: 1. dK
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:1066
Functionmamba3_siso_bwd_kernel_dqkv
Backward kernel for Mamba-3 attention mechanism. Each program instance handles one (head, batch/seq) pair and iterates through all c
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:204
Functionmamba3_siso_bwd_kernel_dzdo
Backward kernel for Z-gating: computes dZ and scales dO. In the forward pass, output is gated as: out = O * Z * sigmoid(Z) = O * silu(Z)
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:33
Functionmamba3_siso_bwd_kernel_rotary_bias_angles
Grid: (nchunks, batch) Each program processes one (batch, chunk) pair. Loop structure: - Outer loop: iterate over qk_heads (nhea
mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py:822
Functionmamba3_siso_fwd_kernel
Mamba-3 forward kernel. Grid: (nheads, batch) for batched, (nheads, 1, num_sequences) for varlen Inputs: Q, K:
mamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py:30
Functionmamba3_siso_step_kernel
Mamba-3 Step kernel. Inputs: Q, K: (batch, nheads_qk, headdim_qk) V: (batch,
mamba_ssm/ops/triton/mamba3/mamba3_siso_step.py:27
Functionmamba_chunk_scan
Argument: x: (batch, seqlen, nheads, headdim) dt: (batch, seqlen, nheads) A: (nheads) B: (batch, seqlen, ngroups,
mamba_ssm/ops/triton/ssd_combined.py:646
Functionmamba_conv1d_scan_ref
Argument: xBC: (batch, seqlen, dim + 2 * ngroups * dstate) where dim == nheads * headdim conv1d_weight: (dim + 2 * ngroups * dsta
mamba_ssm/ops/triton/ssd_combined.py:774
Functionmamba_mimo_bwd_bwd_kernel
Overview: Reverse-chunk backward pass that consumes cached STATES and QK_DOT from the first pass to produce gradients
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py:535
Functionmamba_mimo_bwd_bwd_kernel
Varlen bwd-bwd kernel: computes all remaining gradients in reverse chunk order. Inputs: - DOUT: upstream gradien
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py:591
Functionmamba_mimo_bwd_fwd_kernel
Overview: Fused backward-forward pass over chunks. Recomputes local forward intermediates, accumulates projection gra
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py:72
Functionmamba_mimo_bwd_fwd_kernel
Varlen bwd-fwd kernel: re-runs the forward recurrence per sequence. Inputs: - DOUT: upstream gradient. - Q,
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py:109
Functionmamba_mimo_fwd_kernel
Overview: Fused chunked forward pass that combines MIMO projections with recurrent state updates. Computes interchunk
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py:70
Functionmamba_mimo_fwd_kernel
Overview: Varlen fused chunked forward pass. Identical in math to the dense kernel in ``mamba3_mimo_fwd.py``; differ
mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py:119
Functionmamba_split_conv1d_scan_ref
Argument: zxbcdt: (batch, seqlen, 2 * dim + 2 * ngroups * dstate + nheads) where dim == nheads * headdim conv1d_weight: (dim + 2
mamba_ssm/ops/triton/ssd_combined.py:999
Functionmodify_logits_for_top_k_filtering
Set the logits for none top-k values to -inf. Done in-place.
mamba_ssm/utils/generation.py:45
Functionmods
()
tests/ops/tilelang/test_mamba3_mimo.py:71
Functionmods_varlen
()
tests/ops/tilelang/test_mamba3_mimo.py:1401
Functionref_impl
()
mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py:1733
Methodreset
(self, max_seqlen, max_batch_size)
tests/ops/cute/test_mamba3_mimo_step.py:87
Functionrms_norm_ref
( x, weight, bias, residual=None, x1=None, weight1=None, bias1=None, eps=1e-6,
mamba_ssm/ops/triton/layer_norm.py:77
Functionrotary_qk_inference_kernel
( OUT_Q, # Pointers to matrices OUT_K, OUT_ANGLE_STATE, Q, K, ANGLE_STATE, ANGLE_
mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py:16
Functionrun
(new_input_ids, new_position_ids, seqlen)
mamba_ssm/utils/generation.py:381
Methodsave_pretrained
Minimal implementation of save_pretrained for MambaLMHeadModel. Save the model and its configuration file to a directory.
mamba_ssm/models/mixer_seq_simple.py:294
Functionsegsum_unstable
Naive segment sum calculation.
mamba_ssm/modules/ssd_minimal.py:14
Functionselective_scan_bwd
Argument: dout: (batch, seqlen, nheads, headdim) x: (batch, seqlen, nheads, headdim) dt: (batch, nheads, nchunks, chunk_s
mamba_ssm/ops/triton/ssd_combined.py:516
Functionssd_chunk_scan_combined_ref
Argument: x: (batch, seqlen, nheads, headdim) dt: (batch, seqlen, nheads) A: (nheads) B: (batch, seqlen, ngroups,
mamba_ssm/ops/triton/ssd_combined.py:682
Functionsync_shared_params
(model: torch.nn.Module, process_group: ProcessGroup)
mamba_ssm/distributed/distributed_utils.py:105
Functiontest_bwd_varlen_prereduce_relative_errors_lt_10pct
Varlen backward in prereduce mode (mimo_o=None).
tests/ops/tilelang/test_mamba3_mimo.py:1863
← previousnext →301–400 of 436, ranked by callers