MCPcopy Create free account

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

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

↓ 6 callersFunctionparallel_attn_bwd_preprocess
( o: torch.Tensor, do: torch.Tensor, )
fla/ops/attn/parallel.py:578
↓ 6 callersFunctionrotary_embedding_ref
(x, cos, sin, interleaved=False)
fla/modules/rotary.py:30
↓ 6 callersFunctionrun_cp_test_with_spawn
Run CP test using torch.multiprocessing.spawn. This allows running the test directly with pytest.
tests/context_parallel/test_cp_dplr.py:330
↓ 5 callersMethod__init__
(self, seen_tokens: int = 0, **kwargs: Any)
fla/models/utils.py:551
↓ 5 callersFunction_bitonic_merge
( x, ids, stage: tl.constexpr, order: tl.constexpr, n_dims: tl.constexpr, )
fla/ops/nsa/utils.py:56
↓ 5 callersFunction_build_split_wheels
(tmp_path: Path)
tests/test_split_package_release.py:45
↓ 5 callersFunction_full_causal_attn
(q, k, v, cu_seqlens, max_seqlen)
tests/ops/test_moba.py:20
↓ 5 callersMethod_get_D
(self, expand_to_head_dim: bool = False)
fla/layers/mamba2.py:268
↓ 5 callersFunctionapply_mask_to_padding_states
Tunes out the hidden states for padding tokens, see https://github.com/state-spaces/mamba/issues/66
fla/layers/mamba2.py:42
↓ 5 callersFunctionbench
(fn, step=20, warm_up=10, grad_to_none=None)
benchmarks/cp/test_gdn_with_cp.py:129
↓ 5 callersFunctionbuild_wall_kv_cache
r"""Build a pre-rescaled Wall KV cache. Returns ``(k_tilde, r_cache)`` where, for each chunk ``c`` of size ``C``: ``R_c = P[chun
fla/ops/wall_attn/decode.py:254
↓ 5 callersFunctionceil_log
(x: int, b: int)
fla/ops/log_linear_attn/chunk.py:1496
↓ 5 callersFunctionchunk_bwd_dh
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, do: torch.Tensor, h0: torch.Tensor,
fla/ops/common/chunk_h.py:352
↓ 5 callersFunctionchunk_gated_delta_product
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/gated_delta_product/chunk.py:259
↓ 5 callersFunctionchunk_gated_delta_rule_bwd_dhu
( q: torch.Tensor, k: torch.Tensor, w: torch.Tensor, do: torch.Tensor, dv: torch.Tensor,
fla/ops/common/chunk_delta_h.py:659
↓ 5 callersFunctionfused_recurrent_rwkv6
r""" Args: r (torch.Tensor): reception of shape `[B, T, H, K]`. Alias: q, query in linear attention. k (to
fla/ops/rwkv6/fused_recurrent.py:560
↓ 5 callersMethodhandle_recurrent_state
(self, recurrent_state, recurrent_state_new, cu_seqlens, cu_seqlen_all, reverse_indices)
fla/layers/mom.py:827
↓ 5 callersFunctionlayer_norm_linear
( x: torch.Tensor, norm_weight: torch.Tensor, norm_bias: torch.Tensor, linear_weight: torch.Te
fla/modules/layernorm.py:889
↓ 5 callersFunctionmake_cu_seqlens
(seqlens)
tests/ops/utils/test_index.py:87
↓ 5 callersMethodnormalize_autotune_key
(value: Any)
fla/ops/utils/cache.py:121
↓ 5 callersFunctionparallel_forgetting_attn
r""" Args: q (torch.Tensor): queries of shape `[B, T, HQ, K]`. k (torch.Tensor): keys of shape `[B, T, H,
fla/ops/forgetting_attn/parallel.py:13
↓ 5 callersFunctionprepare_sequence_ids
(cu_seqlens: torch.LongTensor, cu_seqlens_cpu: torch.LongTensor | None = None)
fla/ops/utils/index.py:145
↓ 5 callersFunctionread_wheel_metadata
(wheel: Path)
scripts/smoke_test_split_packages.py:43
↓ 5 callersFunctionrecurrent_oja_ref
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, beta: torch.Tensor, g: torch.Tensor,
tests/ops/test_oja.py:19
↓ 5 callersFunctionrotary_embedding
Args: x: [B, T, H, D] cos, sin: [TR, R//2] interleaved: If True, rotate pairs of even and odd dimensions (GPT
fla/modules/rotary.py:281
↓ 5 callersFunctionrun
( cmd: list[str], *, cwd: str | Path | None = None, env: dict[str, str] | None = None, tim
scripts/smoke_test_split_packages.py:20
↓ 5 callersFunctionrun_cmd
Run a shell command and return stdout.
scripts/run_benchmark_compare.py:57
↓ 4 callersMethod__init__
(self, config: YOCOConfig)
fla/models/yoco/modeling_yoco.py:401
↓ 4 callersMethod__init__
( self, config: RWKV7Config, layer_idx: int, )
fla/models/rwkv7/modeling_rwkv7.py:120
↓ 4 callersMethod__init__
( self, hidden_size: int, hidden_ratio: int | None = None, intermediate_size:
fla/models/bitnet/modeling_bitnet.py:44
↓ 4 callersMethod__init__
(self, config: RWKV6Config, layer_idx: int)
fla/models/rwkv6/modeling_rwkv6.py:104
↓ 4 callersFunction_assert_attn_state_tokens
(attn_state, expected_tokens: torch.Tensor)
tests/models/test_cache.py:23
↓ 4 callersFunction_block_size
(head_dim: int, device_index: int)
fla/ops/parallax/parallel.py:18
↓ 4 callersFunction_create_venv
(tmp_path: Path, *, system_site_packages: bool = False)
tests/test_split_package_release.py:106
↓ 4 callersFunction_make_mamba2_pair
Create custom & official Mamba2 layers sharing identical weights. Args: official_use_mem_eff_path: Controls whether the official Mamba2 u
tests/models/test_modeling_mamba2.py:142
↓ 4 callersFunction_make_mamba_pair
Create custom & official Mamba layers sharing identical weights. Returns (custom, official) with all parameters copied from custom → official.
tests/models/test_modeling_mamba.py:84
↓ 4 callersMethod_update_cos_sin_cache
(self, seqlen, device=None, dtype=None)
fla/modules/rotary.py:409
↓ 4 callersFunctionall_gather_into_tensor
All-gather a tensor across ranks. Args: inp: Input tensor to gather out: Optional output tensor of shape [world_size, *inp.s
fla/ops/cp/comm.py:19
↓ 4 callersFunctioncached_add_one
(x)
tests/test_utils.py:30
↓ 4 callersFunctioncausal_conv1d_fwd
( x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, residual: torch.Tensor, initi
fla/modules/conv/triton/ops.py:37
↓ 4 callersMethodcausal_conv1d_update
( self, x, cache, residual=None, weight=None, bias=None,
fla/modules/backends/triton_ascend/__init__.py:375
↓ 4 callersFunctionceil_div
(x: int, y: int)
fla/ops/log_linear_attn/chunk.py:1492
↓ 4 callersFunctionchunk_bwd_dqkwg
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, do: torch.Tensor, h: torch.Tensor,
fla/ops/common/chunk_o.py:660
↓ 4 callersFunctionchunk_delta_rule
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/delta_rule/chunk.py:214
↓ 4 callersFunctionchunk_dplr_delta_rule
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/generalized_delta_rule/dplr/chunk.py:442
↓ 4 callersFunctionchunk_fwd_o
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, h: torch.Tensor, g: torch.Tensor | No
fla/ops/common/chunk_o.py:505
↓ 4 callersFunctionchunk_gated_delta_product_ref
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, g: torch.Tensor, beta: torch.Tensor,
fla/ops/gated_delta_product/chunk_ref.py:16
↓ 4 callersFunctionchunk_gla_fwd_o_gk
( q: torch.Tensor, v: torch.Tensor, g: torch.Tensor, A: torch.Tensor, h: torch.Tensor,
fla/ops/gla/chunk.py:883
↓ 4 callersFunctionchunk_gsa
r""" Args: q (torch.Tensor): queries of shape `[B, T, HQ, K]`. k (torch.Tensor): keys of shape `[B, T, H,
fla/ops/gsa/chunk.py:1082
↓ 4 callersFunctionchunk_linear_attn
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/linear_attn/chunk.py:15
↓ 4 callersFunctionchunk_log_linear_attn
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/log_linear_attn/chunk.py:1868
↓ 4 callersFunctionchunk_rwkv6_fwd_cumsum
( g: torch.Tensor, chunk_size: int, scale: float | None = None, cu_seqlens: torch.Tensor | Non
fla/ops/rwkv6/chunk.py:89
↓ 4 callersFunctionchunk_scaled_dot_kkt_fwd
r""" Compute beta * K * K^T. Args: k (torch.Tensor): The key tensor of shape `[B, T, H, K]` where `H` is the number of qu
fla/ops/common/chunk_scaled_dot_kkt.py:81
↓ 4 callersFunctionconv_cp_send_recv_fwd
Conv1d CP forward: each rank sends its tails, receives previous rank's tails as heads. Args: tails: [W-1, D] or [N, D, W-1] - tail t
fla/ops/cp/comm.py:142
↓ 4 callersFunctionexpand_h0
(h0: torch.Tensor, context: FLACPContext)
fla/ops/cp/chunk_delta_h.py:919
↓ 4 callersFunctionfind_wheel
(dist_dir: Path, prefix: str)
scripts/smoke_test_split_packages.py:36
↓ 4 callersFunctionfused_chunk_linear_attn
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/linear_attn/fused_chunk.py:15
↓ 4 callersFunctionfused_chunk_simple_gla
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/simple_gla/fused_chunk.py:13
↓ 4 callersFunctionfused_recurrent_hgrn
r""" Args: x (torch.Tensor): inputs of shape `[B, T, D]. g (torch.Tensor): Forget gates of shape `[B, T, D
fla/ops/hgrn/fused_recurrent.py:258
↓ 4 callersFunctionfused_recurrent_linear_attn
r""" Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys of shape `[B, T, H, K
fla/ops/linear_attn/fused_recurrent.py:14
↓ 4 callersFunctiongdn_with_custom_cp
()
benchmarks/cp/test_gdn_with_cp.py:715
↓ 4 callersFunctionget_available_device
()
fla/utils/_device.py:96
↓ 4 callersFunctionget_grads
(func, *inputs)
tests/modules/test_conv.py:939
↓ 4 callersFunctionget_logger
(name: str = None)
legacy/training/flame/logging.py:18
↓ 4 callersMethodis_enabled
(cls)
fla/ops/backends/__init__.py:66
↓ 4 callersFunctionkda_gate_chunk_cumsum
( g: torch.Tensor, A_log: torch.Tensor, chunk_size: int, scale: float = None, dt_bias: tor
fla/ops/kda/gate.py:422
↓ 4 callersMethodkey_hash
(key: Any)
fla/ops/utils/cache.py:133
↓ 4 callersFunctionlog2
(x)
fla/ops/utils/op.py:24
↓ 4 callersFunctionmean_pooling
( x: torch.Tensor, chunk_size: int, cu_seqlens: torch.LongTensor | None = None, head_first: bo
fla/ops/utils/pooling.py:198
↓ 4 callersFunctionnaive_kda_lowerbound_gate
( g: torch.Tensor, A_log: torch.Tensor, dt_bias: torch.Tensor | None = None, lower_bound: floa
fla/ops/kda/gate.py:57
↓ 4 callersFunctionnaive_recurrent_gated_delta_rule
Reference PyTorch implementation of recurrent 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:13
↓ 4 callersFunctionparallel_wall_attn_decode
r"""Wall decode with a pre-rescaled KV cache. Use this directly from modeling code; it does NOT share a signature with `parallel_wall_attn_fw
fla/ops/wall_attn/decode.py:159
↓ 4 callersMethodprepare_recurrent_state
(self, recurrent_state, cu_seqlens, cu_seqlen_all, reverse_indices, batch_size)
fla/layers/mom.py:805
↓ 4 callersFunctionprepare_token_indices
(cu_seqlens: torch.LongTensor, cu_seqlens_cpu: torch.LongTensor | None = None)
fla/ops/utils/index.py:150
↓ 4 callersMethodreset
(self)
fla/models/utils.py:182
↓ 4 callersFunctionreversed_cumsum
(x, dim=-1)
tests/ops/utils/test_cumsum.py:17
↓ 4 callersFunctionrun
(state_v_first: bool)
tests/ops/test_gla.py:127
↓ 4 callersFunctionrun
(state_v_first: bool)
tests/ops/test_simple_gla.py:125
↓ 4 callersFunctionsizeof_fmt
(num, suffix='B')
benchmarks/benchmark_training_throughput.py:28
↓ 4 callersFunctiontoken_shift_ref
( x: torch.Tensor, cu_seqlens: torch.Tensor | None = None, )
fla/modules/token_shift.py:18
↓ 3 callersMethod__init__
( self, mode: str = 'chunk', hidden_size: int = 2048, num_heads: int = 32,
fla/layers/yoco.py:86
↓ 3 callersMethod__init__
( self, input_dim: int, output_dim: int, low_rank_dim: int, bias: bool
fla/layers/rwkv6.py:213
↓ 3 callersMethod__init__
(self, config: MLAConfig, layer_idx: int)
fla/models/mla/modeling_mla.py:43
↓ 3 callersMethod__init__
(self, config: ABCConfig, layer_idx: int)
fla/models/abc/modeling_abc.py:43
↓ 3 callersMethod__init__
(self, config: WallTransformerConfig, layer_idx: int)
fla/models/wall_transformer/modeling_wall_transformer.py:45
↓ 3 callersMethod__init__
(self, config: MoBAConfig, layer_idx: int)
fla/models/moba/modeling_moba.py:43
↓ 3 callersMethod__init__
(self, config: LinearAttentionConfig, layer_idx: int)
fla/models/linear_attn/modeling_linear_attn.py:44
↓ 3 callersMethod__init__
(self, config: MomConfig, layer_idx: int)
fla/models/mom/modeling_mom.py:125
↓ 3 callersMethod__init__
(self, config: DeltaNetConfig, layer_idx: int)
fla/models/delta_net/modeling_delta_net.py:43
↓ 3 callersMethod__init__
(self, config: HGRN2Config, layer_idx: int)
fla/models/hgrn2/modeling_hgrn2.py:44
↓ 3 callersMethod__init__
(self, config: MesaNetConfig, layer_idx: int)
fla/models/mesa_net/modeling_mesa_net.py:44
↓ 3 callersMethod__init__
(self, config: GatedDeltaProductConfig, layer_idx: int)
fla/models/gated_deltaproduct/modeling_gated_deltaproduct.py:44
↓ 3 callersMethod__init__
(self, config: RodimusConfig, layer_idx: int)
fla/models/rodimus/modeling_rodimus.py:49
↓ 3 callersMethod__init__
(self, config: DeltaFormerConfig, layer_idx: int)
fla/models/deltaformer/modeling_deltaformer.py:41
↓ 3 callersMethod__init__
(self, config: HGRNConfig, layer_idx: int)
fla/models/hgrn/modeling_hgrn.py:44
↓ 3 callersMethod__init__
(self, config: GatedDeltaNetConfig, layer_idx: int)
fla/models/gated_deltanet/modeling_gated_deltanet.py:44
↓ 3 callersMethod__init__
(self, config: RetNetConfig, layer_idx: int)
fla/models/retnet/modeling_retnet.py:44
↓ 3 callersMethod__init__
(self, config: PaTHAttentionConfig, layer_idx: int)
fla/models/path_attn/modeling_path_attention.py:43
↓ 3 callersMethod__init__
(self, config: RavenConfig, layer_idx: int)
fla/models/raven/modeling_raven.py:47
↓ 3 callersMethod__init__
(self, config: ForgettingTransformerConfig, layer_idx: int)
fla/models/forgetting_transformer/modeling_forgetting_transformer.py:43
← previousnext →101–200 of 2,989, ranked by callers