MCPcopy Create free account

hub / github.com/fla-org/flash-linear-attention / functions

Functions2,989 in github.com/fla-org/flash-linear-attention

Functionintra_chunk_preprocess_bwd_kernel
( q, k, w, w2, beta, AT, dA_local, dq, dq_new, dk, dk_new, dw, dbeta, dw1, dw2, T, offsets, in
fla/ops/path_attn/intra_chunk_preprocess_bwd.py:21
Functionintra_chunk_preprocess_fwd_kernel
( q, k, v, w, beta, g_cumsum, o, A, L, M, w2, q_new, k_new
fla/ops/path_attn/intra_chunk_preprocess_fwd.py:20
Functioniplr_chunkwise
(q, k, v, alpha, beta, initial_state=None, output_final_state=True, chunk_size=32)
fla/ops/generalized_delta_rule/iplr/naive.py:40
Functioniplr_recurrence
(q, k, v, alpha, beta, initial_state=None, output_final_state=True)
fla/ops/generalized_delta_rule/iplr/naive.py:15
Methodis_available
(cls)
fla/ops/common/backends/intracard.py:38
Methodis_available
(cls)
fla/ops/common/backends/tilelang/__init__.py:28
Methodis_available
(cls)
fla/ops/kda/backends/tilelang/__init__.py:24
Methodis_available
(cls)
fla/modules/backends/triton_ascend/__init__.py:24
Methodis_cp_enabled
Whether context parallel is enabled.
fla/ops/cp/context.py:55
Functionk_update_bwd_kernel_long
( grad_out, k, a, ka, dk, da, dka, cu_seqlens, chunk_indices, T, D, BD: tl.constexpr, BT:
fla/ops/rwkv7/fused_k_update.py:175
Functionk_update_bwd_kernel_short
( grad_out, k, a, ka, dk, da, dka, cu_seqlens, T, D, BT: tl.constexpr, BD: tl.constexp
fla/ops/rwkv7/fused_k_update.py:123
Functionk_update_fwd_kernel_long
( k, a, ka, out, cu_seqlens, chunk_indices, T, D, BD: tl.constexpr, BT: tl.constexpr, IS_V
fla/ops/rwkv7/fused_k_update.py:76
Functionk_update_fwd_kernel_short
( k, a, ka, out, cu_seqlens, T, D, BD: tl.constexpr, IS_VARLEN: tl.constexpr, )
fla/ops/rwkv7/fused_k_update.py:33
Functionkda_baseline_single_gpu
Baseline: single GPU with local sequence length.
benchmarks/cp/benchmark_kda_cp8_vs_cp2tp.py:357
Functionkda_forward
( hidden_states: torch.Tensor, attention_mask: torch.Tensor | None = None, past_key_values: Cache
benchmarks/cp/test_gdn_with_cp.py:503
Functionkda_gate_bwd_kernel
( g, A_log, dt_bias, beta, dyg, dyb, dg, dA, dbeta, lower_bound, T
fla/ops/kda/gate.py:144
Functionkda_gate_chunk_cumsum_vector_kernel
( s, A_log, dt_bias, o, scale, cu_seqlens, chunk_indices, lower_bound, T,
fla/ops/kda/gate.py:363
Functionkda_gate_fwd_kernel
( g, A_log, dt_bias, beta, yg, yb, lower_bound, T, H: tl.constexpr, D:
fla/ops/kda/gate.py:88
Functionkda_with_all2all_cp
All2All CP implementation: all-gather inputs, compute, scatter outputs.
benchmarks/cp/benchmark_kda_cp8_vs_cp2tp.py:310
Functionkda_with_cp
With CP implementation (using build_cp_context).
benchmarks/cp/benchmark_kda_cp8_vs_cp2tp.py:280
Functionkl_div_kernel
( logits, target_logits, loss, s_logits, s_loss, reduction: tl.constexpr, N: tl.co
fla/modules/fused_kl_div.py:27
Functionkl_div_kernel
( logits, target_logits, loss, s_logits, s_loss, reduction: tl.constexpr, N: tl.co
fla/modules/backends/triton_ascend/fused_kl_div.py:22
Functionl2norm_bwd_kernel
( y, rstd, dy, dx, eps, T, D: tl.constexpr, BD: tl.constexpr, NB: tl.const
fla/modules/l2norm.py:113
Functionl2norm_bwd_kernel1
( y, rstd, dy, dx, eps, D, BD: tl.constexpr, )
fla/modules/l2norm.py:54
Functionl2norm_fwd_kernel
( x, y, rstd, eps, T, D: tl.constexpr, BD: tl.constexpr, NB: tl.constexpr,
fla/modules/l2norm.py:83
Functionl2norm_fwd_kernel1
( x, y, rstd, eps, D, BD: tl.constexpr, )
fla/modules/l2norm.py:26
Methodlayer_norm_bwd
( self, dy, x, weight, bias, mean=None, rstd=None,
fla/modules/backends/triton_ascend/__init__.py:223
Functionlayer_norm_bwd_kernel
( x, # pointer to the input w, # pointer to the weights b, # pointer to the biases y, # po
fla/modules/layernorm.py:342
Functionlayer_norm_bwd_kernel
( X, # pointer to the input W, # pointer to the weights B, # pointer to the biases Y, # po
fla/modules/fused_bitlinear.py:208
Functionlayer_norm_bwd_kernel
( X, # pointer to the input W, # pointer to the weights B, # pointer to the biases Z,
fla/modules/layernorm_gated.py:187
Functionlayer_norm_bwd_kernel1
( x, # pointer to the input w, # pointer to the weights b, # pointer to the biases y, # po
fla/modules/layernorm.py:459
Functionlayer_norm_bwd_kernel1
( x, w, b, y, dy, dx, dw, db, dres, dres_in, mean, rstd, T
fla/modules/backends/triton_ascend/layernorm.py:94
Methodlayer_norm_fwd
( self, x, weight, bias, eps=1e-5, residual=None, out_
fla/modules/backends/triton_ascend/__init__.py:198
Functionlayer_norm_fwd_kernel
( x, # pointer to the input y, # pointer to the output w, # pointer to the weights b, # po
fla/modules/layernorm.py:195
Functionlayer_norm_fwd_kernel
( X, # pointer to the input Y, # pointer to the output W, # pointer to the weights B, # po
fla/modules/layernorm_gated.py:55
Functionlayer_norm_fwd_kernel1
( x, # pointer to the input y, # pointer to the output w, # pointer to the weights b, # po
fla/modules/layernorm.py:269
Functionlayer_norm_fwd_kernel1
( x, y, w, b, res, res_out, mean, rstd, eps, G: tl.constexpr, D: t
fla/modules/backends/triton_ascend/layernorm.py:26
Functionlayer_norm_fwd_kernel_quant
( X, # pointer to the input Y, # pointer to the output W, # pointer to the weights B, # po
fla/modules/fused_bitlinear.py:73
Functionlayer_norm_gated_bwd_kernel
( x, # pointer to the input g, # pointer to the gate w, # pointer to the weights b, # poin
fla/modules/fused_norm_gate.py:202
Functionlayer_norm_gated_bwd_kernel1
( x, # pointer to the input g, # pointer to the gate w, # pointer to the weights b, # poin
fla/modules/fused_norm_gate.py:330
Functionlayer_norm_gated_fwd_kernel
( x, # pointer to the input g, # pointer to the gate y, # pointer to the output w, # point
fla/modules/fused_norm_gate.py:35
Functionlayer_norm_gated_fwd_kernel1
( x, # pointer to the input g, # pointer to the gate y, # pointer to the output w, # point
fla/modules/fused_norm_gate.py:121
Functionlayer_norm_ref
( x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, residual: torch.Tensor = None,
fla/modules/layernorm.py:40
Methodlayers
(self)
fla/models/yoco/modeling_yoco.py:448
Methodlazy_initialization
(self, key_states: torch.Tensor)
fla/models/utils.py:39
Methodload_hook
(self, state_dict, prefix, *args)
fla/models/mamba2/modeling_mamba2.py:259
Methodload_hook
(self, state_dict, prefix, *args)
fla/models/mamba/modeling_mamba.py:184
Methodload_hook
(self, state_dict, prefix, *args)
fla/models/log_linear_mamba2/modeling_log_linear_mamba2.py:288
Methodload_hook
(self, state_dict, prefix, *args)
fla/models/mamba3/modeling_mamba3.py:175
Functionlogcumsumexp_fwd_kernel
( s, z, T, S: tl.constexpr, BT: tl.constexpr, )
fla/ops/utils/logcumsumexp.py:25
Methodlogsigmoid_bwd
(self, x, dy, temperature=1., output_contiguous=False)
fla/modules/backends/triton_ascend/__init__.py:151
Functionlogsigmoid_bwd_kernel
( x, dy, dx, stride_x_row, stride_dy_row, stride_dx_row, temperature, T, D
fla/modules/activations.py:244
Functionlogsigmoid_bwd_kernel
( x, dx, dy, temperature, T, D: tl.constexpr, stride_x_row, stride_dx_row,
fla/modules/backends/triton_ascend/activations.py:172
Functionlogsigmoid_clamp
(t)
benchmarks/ops/registry.py:73
Methodlogsigmoid_fwd
(self, x, temperature=1., output_contiguous=False)
fla/modules/backends/triton_ascend/__init__.py:147
Functionlogsigmoid_fwd_kernel
( x, y, stride_x_row, stride_y_row, temperature, T, D: tl.constexpr, B: tl.con
fla/modules/activations.py:212
Functionlogsigmoid_fwd_kernel
( x, y, temperature, T, D: tl.constexpr, stride_x_row, stride_y_row, B: tl.con
fla/modules/backends/triton_ascend/activations.py:137
Functionlogsumexp_fwd
r""" Compute the logsumexp of the input tensor over the last dimension. Args: x (Tensor): The input tensor of any shape.
fla/ops/utils/logsumexp.py:48
Methodlogsumexp_fwd
( self, x, scale=None, softcapping=None, dtype=None, )
fla/modules/backends/triton_ascend/__init__.py:80
Functionlogsumexp_fwd_kernel
( x, z, scale, D: tl.constexpr, B: tl.constexpr, HAS_SCALE: tl.constexpr, )
fla/ops/utils/logsumexp.py:28
Functionlogsumexp_fwd_kernel
( x, z, scale, softcapping, D: tl.constexpr, B: tl.constexpr, HAS_SCALE: tl.conste
fla/modules/fused_linear_cross_entropy.py:44
Functionlogsumexp_fwd_kernel
( x, z, scale, softcapping: tl.constexpr, D: tl.constexpr, B: tl.constexpr, ROWWIS
fla/modules/backends/triton_ascend/fused_linear_cross_entropy.py:26
Functionmatmul
(a, b, activation='')
fla/ops/utils/matmul.py:182
Functionmatmul_kernel
Kernel for computing the matmul C = A x B. A has shape (M, K), B has shape (K, N) and C has shape (M, N)
fla/ops/utils/matmul.py:53
Functionmean_pooling_bwd_kernel
( do, dx, cu_seqlens, chunk_indices, T, H: tl.constexpr, D: tl.constexpr, BT:
fla/ops/utils/pooling.py:76
Functionmean_pooling_fwd_kernel
( x, o, cu_seqlens, chunk_indices, T, H: tl.constexpr, D: tl.constexpr, BT: tl
fla/ops/utils/pooling.py:29
Functionmerge_16x16_to_32x32_inverse_kernel
( A, Ai, cu_seqlens, chunk_indices, T, H: tl.constexpr, BT: tl.constexpr, USE_
fla/ops/utils/solve_tril.py:105
Functionmerge_16x16_to_64x64_inverse_kernel
( A, Ai, cu_seqlens, chunk_indices, T, H: tl.constexpr, BT: tl.constexpr, USE_
fla/ops/utils/solve_tril.py:194
Functionmerge_fwd_bwd_kernel
Unified merge kernel for both CP and Intra-card modes. CP mode (INTRACARD_MODE=False): Grid: (V/BV, HV) Merges across ranks
fla/ops/cp/chunk_delta_h.py:321
Functionmesa_net_decoding_one_step_kernel
( q, k, v, g, o, lamb, beta, prev_h_kk, prev_h_kv, curr_h_kk, curr
fla/ops/mesa_net/decoding_one_step.py:17
Functionnaive_attn_decoding_kernel
( q, k, v, o, g_cumsum, sink_bias, scale, cu_seqlens, T, B: tl.constex
fla/ops/attn/decoding.py:31
Functionnaive_chunk_based
(q, k, v, chunk_size=256)
fla/ops/based/naive.py:34
Functionnaive_chunk_gated_delta_rule
Reference PyTorch implementation of chunk gated delta rule. Args: q: [B, T, H, K] k: [B, T, H, K] v: [B, T, H, V]
fla/ops/gated_delta_rule/naive.py:67
Functionnaive_chunk_gdn2
Chunkwise PyTorch reference for GDN-2. The within-chunk recurrence is expanded via the WY representation: `A = (I + tril(K' D K^T, -1))^{-1}`
fla/ops/gdn2/naive.py:86
Functionnaive_chunk_hgrn
( x: torch.Tensor, g: torch.Tensor, initial_state: torch.Tensor | None = None, output_final_st
fla/ops/hgrn/naive.py:37
Functionnaive_chunk_rwkv6
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, w: torch.Tensor, u: torch.Tensor,
fla/ops/rwkv6/chunk_naive.py:12
Functionnaive_chunk_simple_gla
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, g: torch.Tensor, initial_state: torch
fla/ops/simple_gla/naive.py:13
Functionnaive_cumsum_abc
A simple implementation of vanilla ABC that is more aligned with the descriptions in the paper. This is just for demonstration purposes, with
fla/ops/abc/naive.py:74
Functionnaive_delta_rule_parallel
(q, k, v, beta, BM=128, BN=32)
fla/ops/delta_rule/parallel.py:344
Functionnaive_mesa_net_CG
(q, k, v, g, lamb, beta, chunk_size, max_CG_iteration=30, h_kk_init=None, h_kv_init=None)
fla/ops/mesa_net/naive.py:71
Functionnaive_parallel_rebased
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, scale: float | None = None, use_norm:
fla/ops/rebased/naive.py:11
Functionnaive_recurrent_abc
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, s: torch.Tensor, g: torch.Tensor | No
fla/ops/abc/naive.py:12
Functionnaive_recurrent_comba
Reference PyTorch implementation of recurrent COMBA. Args: q: [B, T, H, K] k: [B, T, H, K] v: [B, T, H, V] p
fla/ops/comba/naive.py:13
Functionnaive_recurrent_rwkv6
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, w: torch.Tensor, u: torch.Tensor,
fla/ops/rwkv6/recurrent_naive.py:11
Functionnaive_recurrent_rwkv6_bwd
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, w: torch.Tensor, u: torch.Tensor,
fla/ops/rwkv6/recurrent_naive.py:47
Functionnaive_retention
(q, k, v)
fla/ops/retention/naive.py:11
Methodnum_seqs
Number of sequences in this rank.
fla/ops/cp/context.py:50
Methodnum_split_seqs
(self)
fla/ops/common/intracard_cp.py:74
Methodoffload
(self)
fla/models/utils.py:152
Methodon_log
( self, args: TrainingArguments, state: TrainerState, control: TrainerControl,
legacy/training/flame/logging.py:75
Methodon_train_begin
r""" Event called at the beginning of training.
legacy/training/flame/logging.py:45
Functionpackunpack_sequence_kernel
( x, y, cu_seqlens, S, D, BD: tl.constexpr, PADDING_SIDE: tl.constexpr, PACK:
fla/ops/utils/pack.py:28
Functionparallax_decode_kernel
Forward-only Parallax over a cached KV (prefill / chunked decode). The ``Sq`` query tokens are the last ``Sq`` positions of a length-``Skv``
fla/ops/parallax/decode.py:17
Functionparallax_decode_one_step_kernel
Single-token Parallax decode: one query per (batch, head) over its cached KV. The query is the sequence's last position, so causality is implicit
fla/ops/parallax/decode.py:192
Methodparallel_attn_bwd
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, o: torch.Te
fla/ops/common/backends/tilelang/__init__.py:165
Functionparallel_attn_bwd_kernel_dkv
( q, k, v, g_cumsum, lse, delta, do, dk, dv, dg_cumsum, cu_seqlens
fla/ops/attn/parallel.py:353
Functionparallel_attn_bwd_kernel_dq
( q, k, v, lse, delta, do, dq, dg_cumsum, g_cumsum, scale, cu_seql
fla/ops/attn/parallel.py:208
Functionparallel_attn_bwd_kernel_preprocess
( o, do, delta, B: tl.constexpr, V: tl.constexpr, )
fla/ops/attn/parallel.py:184
Methodparallel_attn_bwd_verifier
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, o: torch.Te
fla/ops/common/backends/tilelang/__init__.py:145
Methodparallel_attn_fwd
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, g_cumsum: t
fla/ops/common/backends/tilelang/__init__.py:124
← previousnext →2,201–2,300 of 2,989, ranked by callers