MCPcopy Create free account

hub / github.com/facebookresearch/xformers / functions

Functions1,445 in github.com/facebookresearch/xformers

↓ 2 callersFunction_attn_bias_apply
( attn_bias: Optional[Union[torch.Tensor, AttentionBias]], op: Callable[[torch.Tensor], torch.Tensor],
xformers/ops/fmha/common.py:47
↓ 2 callersFunction_check_bias_alignment
( reasons: List[str], attn_bias: Optional[Union[torch.Tensor, AttentionBias]] )
xformers/ops/fmha/ck.py:100
↓ 2 callersFunction_check_bias_alignment
( reasons: List[str], attn_bias: Optional[Union[torch.Tensor, AttentionBias]] )
xformers/ops/fmha/cutlass.py:96
↓ 2 callersFunction_check_different_value_headdim_ampere
(d: Inputs, reasons: List[str])
xformers/ops/fmha/flash3.py:568
↓ 2 callersFunction_create_dq_dk_dv
( grads_share_storage: bool, query, key, value )
xformers/ops/fmha/flash.py:320
↓ 2 callersFunction_create_dq_dk_dv
( grads_share_storage: bool, query, key, value )
xformers/ops/fmha/flash3.py:430
↓ 2 callersFunction_custom_mask_type
(bias: Optional[Union[torch.Tensor, AttentionBias]])
xformers/ops/fmha/ck.py:138
↓ 2 callersFunction_custom_mask_type
(bias: Optional[Union[torch.Tensor, AttentionBias]])
xformers/ops/fmha/cutlass.py:134
↓ 2 callersFunction_detect_lse_packed_or_raise
Detects the LSE format if we're in a varlen case. Returns `None` if the format is not relevant (eg not varlen) Raises an exception if the
xformers/ops/fmha/__init__.py:513
↓ 2 callersFunction_diffsort
(a)
xformers/sparse/utils.py:25
↓ 2 callersFunction_dispatch_bw
( inp: Inputs, varlen_lse_packed: Optional[bool] )
xformers/ops/fmha/dispatch.py:149
↓ 2 callersFunction_dispatch_fw
Computes the best operator for forward Raises: NotImplementedError: if not operator was found Returns: AttentionOp: The best
xformers/ops/fmha/dispatch.py:133
↓ 2 callersFunction_dispatches_to_flash_decoding
(q, kv)
tests/test_mem_eff_attention.py:2181
↓ 2 callersFunction_dispatches_to_splitK
(q, kv)
tests/test_mem_eff_attention.py:2174
↓ 2 callersFunction_format_inputs_description
(inp: Inputs)
xformers/ops/fmha/dispatch.py:39
↓ 2 callersFunction_format_not_supported_reasons
(op, reasons: List[str])
xformers/ops/fmha/dispatch.py:58
↓ 2 callersFunction_generate_nd_grid
(*sizes)
xformers/components/attention/attention_patterns.py:15
↓ 2 callersFunction_get_blocktables
(inp_attn_bias)
xformers/ops/fmha/flash3.py:582
↓ 2 callersFunction_get_drop_mask
(op, batch_size, q_len, kv_len, p, device)
tests/test_mem_eff_attention.py:975
↓ 2 callersFunction_get_model_blocks
(num_layers, dtype, device, inplace, random, first_inplace)
tests/test_checkpoint.py:253
↓ 2 callersFunction_get_operator
(name: str)
xformers/ops/fmha/cutlass_blackwell.py:34
↓ 2 callersFunction_get_seqlen_info
( inp: Inputs, )
xformers/ops/fmha/ck.py:49
↓ 2 callersFunction_get_seqlen_info
( inp: Inputs, )
xformers/ops/fmha/cutlass.py:65
↓ 2 callersMethod_get_seqstart
Given sequence lengths, returns the min/max value and the sequence start positions (offsets), with first element being 0 (returned in
xformers/ops/fmha/attn_bias.py:415
↓ 2 callersFunction_get_splitk_kernel
Kernel _fwd_kernel_splitK needs to be post-processed by unroll_varargs to specialize it for a given number of quantization groups N_GROUPS
xformers/ops/fmha/_triton/splitk_kernels.py:607
↓ 2 callersFunction_get_storage_base
(x: torch.Tensor)
xformers/ops/common.py:63
↓ 2 callersFunction_init_2d_weight
( weight: torch.Tensor, init_method: Callable[[torch.Tensor], torch.Tensor], process_group: Option
xformers/ops/modpar_layers.py:18
↓ 2 callersFunction_is_bottom_right
(attn_bias: Union[torch.Tensor, AttentionBias, None])
xformers/ops/fmha/cutlass_blackwell.py:187
↓ 2 callersFunction_is_causal
(attn_bias: Union[torch.Tensor, AttentionBias, None])
xformers/ops/fmha/cutlass_blackwell.py:169
↓ 2 callersFunction_is_cuda
()
xformers/ops/fmha/triton_splitk.py:131
↓ 2 callersFunction_is_fp8_dtype
(dt: torch.dtype)
xformers/ops/sequence_parallel_fused_ops.py:20
↓ 2 callersFunction_is_seqlen_q_le_seqlen_k
( cu_seqlens_q_py: List[int], cu_seqlens_k_py: List[int] )
xformers/ops/fmha/cutlass_blackwell.py:156
↓ 2 callersFunction_is_supported_causal_bias
(attn_bias: Any)
xformers/ops/fmha/triton_splitk.py:49
↓ 2 callersFunction_is_supported_local_bias
(attn_bias: Any)
xformers/ops/fmha/triton_splitk.py:62
↓ 2 callersFunction_is_supported_paged_bias
(attn_bias: Any)
xformers/ops/fmha/triton_splitk.py:82
↓ 2 callersFunction_lazy_init
( device: torch.device, group: dist.ProcessGroup )
xformers/ops/sequence_parallel_fused_ops.py:355
↓ 2 callersFunction_local_2d_distance
(H, W, p=2.0)
tests/test_attention_patterns.py:50
↓ 2 callersFunction_memory_efficient_attention_backward
Warning: grad/ctx.out is potentially in BMK format
xformers/ops/fmha/__init__.py:552
↓ 2 callersFunction_memory_efficient_attention_forward
( inp: Inputs, op: Optional[Type[AttentionFwOpBase]] )
xformers/ops/fmha/__init__.py:485
↓ 2 callersFunction_minimum_gemm_alignment
(inp: Inputs)
xformers/ops/fmha/ck.py:45
↓ 2 callersFunction_minimum_gemm_alignment
(inp: Inputs)
xformers/ops/fmha/cutlass.py:48
↓ 2 callersMethod_mm
( self, B: torch.Tensor, *, prefer_col_major_output: bool = False, bia
xformers/ops/sp24.py:337
↓ 2 callersFunction_nonzero_mask_to_sparse_csr_indices
Converts dense 2d matrix to a csr sparse matrix.
xformers/sparse/utils.py:61
↓ 2 callersFunction_optimize_runtime_with_given_memory
Given a list of operator names, their corresponding runtimes, and the maximum amount of memory available, find the subset of operators that c
xformers/checkpoint.py:386
↓ 2 callersFunction_post_process_lse
( lse: torch.Tensor, inp: Inputs, original_query_shape: Tuple[int, ...], )
xformers/ops/fmha/flash.py:537
↓ 2 callersFunction_prepare_reduce_kernel_params
( attn_out: torch.Tensor, lse_out: Optional[torch.Tensor], attn_split: Sequence[torch.Tensor],
xformers/ops/fmha/triton_splitk.py:1256
↓ 2 callersFunction_rand_maxed_partition
( r: random.Random, total: int, n: int, mx: int, positive: bool = True )
xformers/attn_bias_utils.py:336
↓ 2 callersFunction_run_priority_list
( name: str, priority_list: Sequence[T], inp: Inputs, extra_op_reasons: Optional[List[Tuple[An
xformers/ops/fmha/dispatch.py:62
↓ 2 callersFunction_slow_rope2
More flexible unused version of _slow_rope - allows varying dtypes.
tests/test_rope_padded.py:107
↓ 2 callersFunction_sparsify24_forward
(x: torch.Tensor, *, algo: str, backend: str)
xformers/ops/sp24.py:571
↓ 2 callersFunction_stack_or_none_fw
( tensors: Union[Tuple[torch.Tensor, ...], List[torch.Tensor]], dim: int, )
xformers/ops/unbind.py:59
↓ 2 callersFunction_to_fp8_rowwise
(x: torch.Tensor, dtype)
tests/test_sparsity24.py:1079
↓ 2 callersFunction_window_size
( attn_bias: Optional[Union[torch.Tensor, AttentionBias]], )
xformers/ops/fmha/cutlass_blackwell.py:203
↓ 2 callersFunction_workaround_cusparselt_internal_error
()
tests/test_sparsity24.py:797
↓ 2 callersFunctionall_reduce
( x: torch.Tensor, *, process_group: torch.distributed.ProcessGroup )
xformers/ops/differentiable_collectives.py:13
↓ 2 callersMethodapply
Applies fn to the attention output, as if we were a tensor. fn must expect tensors of shape BMGHK or BMHK, but cannot actually
xformers/ops/fmha/merge_training.py:142
↓ 2 callersMethodcapture
( cls, device: torch.device, name: str = "", )
xformers/fwbw_overlap.py:55
↓ 2 callersFunctioncheck_inputs
( a: List[List[torch.Tensor]], b: List[List[torch.Tensor]], )
xformers/ops/tiled_matmul.py:32
↓ 2 callersFunctioncompare_fused_and_non_fused_ops
( my_rank: int, world_size: int, subgroup: torch.distributed.ProcessGroup, step: str, dims
tests/test_sequence_parallel_fused_ops.py:29
↓ 2 callersFunctionconstruct_tree_choices
Construct a tree based on given branching factor for each non-root level.
xformers/ops/tree_attention.py:679
↓ 2 callersFunctioncreate_argparser
Create CLI argument parser.
xformers/benchmarks/utils.py:403
↓ 2 callersFunctioncreate_tensors
(shape_q, Hkv, dtype, requires_grad=False, packed=True)
xformers/benchmarks/benchmark_mem_eff_attention.py:142
↓ 2 callersMethoddecode
Decodes a list of token IDs into a string. Args: t (list[int]): The list of token IDs to be decoded. Returns:
examples/llama_inference/tokenizer.py:56
↓ 2 callersFunctiondo_bench_cudagraph
Benchmark the runtime of the provided function. Args: fn: Function to benchmark rep: Repetition time (in ms) grad_to_
xformers/utils.py:85
↓ 2 callersMethodencode
Encodes a string into a list of token IDs. Args: s (str): The input string to be encoded. bos (bool): Whethe
examples/llama_inference/tokenizer.py:36
↓ 2 callersMethodend_phase
Terminate the current phase.
examples/llama_inference/stats.py:36
↓ 2 callersFunctionenter_phase
Marks the transition to either comms or compute in the FW pass
xformers/fwbw_overlap.py:455
↓ 2 callersFunctionfold
(x)
xformers/ops/fmha/cutlass_blackwell.py:112
↓ 2 callersMethodforward_with_attn_bias
( self, token_values: torch.Tensor, attn_bias: AttnBias, cache: list[LayerCach
examples/llama_inference/model.py:292
↓ 2 callersMethodfrom_profile
( events: Sequence[torch._C._autograd._KinetoEvent], )
xformers/profiler/profile_analyzer.py:192
↓ 2 callersFunctionfused_anything_and_reducescatter
( my_matmul: Callable[ [List[torch.Tensor], int, Callable[[], torch.cuda.Stream]], None ],
xformers/ops/sequence_parallel_fused_ops.py:791
↓ 2 callersFunctiongather_along_first_dim_async
( input_: torch.Tensor, *, process_group: torch.distributed.ProcessGroup )
xformers/ops/differentiable_collectives.py:25
↓ 2 callersMethodgetCurrentThreadIndices
xformers/csrc/sparse24/sparse24_pack.h:156
↓ 2 callersFunctionget_bias_4d_view
* kernels expect 4D bias/bias.grad with shape * (batch_sz, n_heads, n_queries, n_keys). common bias shapes users may pass * are: * - (n_queries, n_
xformers/csrc/attention/hip_fmha/ck_fmha_util.h:61
↓ 2 callersFunctionget_clock_rate_in_khz
()
xformers/ops/_triton/matmul_perf_model.py:45
↓ 2 callersFunctionget_func_name
(fn)
xformers/benchmarks/utils.py:47
↓ 2 callersFunctionget_mtile_size_for_splitkv_smallq
xformers/csrc/attention/hip_fmha/ck_tiled_fmha_fwd_splitkv_smallq_setting.h:121
↓ 2 callersFunctionget_number_of_cu
xformers/csrc/attention/hip_fmha/ck_fmha_util.h:95
↓ 2 callersFunctionget_optimal_checkpoint_policy
Given a function, its arguments, and the maximum amount of memory available, find the subset of operators that can be optimized to reduce run
xformers/checkpoint.py:309
↓ 2 callersFunctionget_world_size
()
examples/llama_inference/mp_utils.py:83
↓ 2 callersMethodinit_schedule
(self, offset: int = 0)
xformers/profiler/profiler.py:246
↓ 2 callersMethodis_bmghk
(self)
xformers/ops/fmha/merge_training.py:139
↓ 2 callersFunctionis_pt_cutlass_compatible
(force: bool = False)
xformers/ops/fmha/torch_attention_compat.py:10
↓ 2 callersMethodkill_all_processes
(self)
tests/multiprocessing_utils.py:28
↓ 2 callersFunctionlibdevice_find
rsqrt = libdevice_find("rsqrt") is a triton-version-friendly way to say from triton.language.extra.libdevice import rsqrt
xformers/triton/importing.py:9
↓ 2 callersFunctionlocal_nd_pattern
(*sizes, distance, p=2.0)
xformers/components/attention/attention_patterns.py:37
↓ 2 callersMethodlog_bad_exit_codes
(self)
tests/multiprocessing_utils.py:43
↓ 2 callersMethodmake_causal
Makes each block causal
xformers/ops/fmha/attn_bias.py:954
↓ 2 callersMethodmake_local_attention
Experimental: Makes each block causal with local attention
xformers/ops/fmha/attn_bias.py:970
↓ 2 callersMethodmake_stream_factory
( self, current_stream: torch.cuda.Stream )
xformers/ops/sequence_parallel_fused_ops.py:89
↓ 2 callersMethodmaterialize
( self, shape: Tuple[int, ...], dtype: torch.dtype = torch.float32, device: Un
xformers/ops/fmha/attn_bias.py:160
↓ 2 callersMethodnot_supported_reasons
Returns a list of reasons why this is not supported. The kernel can run these inputs only if the returned list is empty
xformers/ops/fmha/common.py:437
↓ 2 callersFunctionpack_kv_cache
Create block tables and pages K/V cache for testing paged attention. Args: cache_k, cache_v: K/V caches, each of shape [B, MAX_T, H_k
xformers/attn_bias_utils.py:451
↓ 2 callersFunctionproduct_dict
(**kwargs)
xformers/benchmarks/utils.py:756
↓ 2 callersMethodpython_version
(self)
xformers/_cpp_lib.py:39
↓ 2 callersFunctionreduce_scatter_along_first_dim_async
( input_: torch.Tensor, *, process_group: torch.distributed.ProcessGroup )
xformers/ops/differentiable_collectives.py:43
↓ 2 callersFunctionref_attention
(q, k, v, attn_bias=None, drop_mask=None, p=0.0, scale=None)
xformers/attn_bias_utils.py:374
↓ 2 callersFunctionref_attention_splitk
( q, k, v, attn_bias, scale=None, split_k=2, dtype=None )
tests/test_splitk_reference.py:42
↓ 2 callersFunctionround_up_to_nearest_multiple
(n: int, m: int)
xformers/benchmarks/benchmark_sequence_parallel_fused.py:62
↓ 2 callersFunctionsequence_parallel_leading_matmul
( x: torch.Tensor, ws: List[torch.Tensor], *, fuse: bool, process_group: torch.distributed
xformers/ops/seqpar.py:209
← previousnext →101–200 of 1,445, ranked by callers