MCPcopy Create free account

hub / github.com/facebookresearch/xformers / functions

Functions1,445 in github.com/facebookresearch/xformers

↓ 92 callersMethodto
(self, device: torch.device)
xformers/ops/fmha/attn_bias.py:400
↓ 55 callersFunctionassert_allclose
( out: Optional[torch.Tensor], ref: Optional[torch.Tensor], msg: str = "failed", atol: float =
tests/utils.py:105
↓ 39 callersMethodbackward
(ctx, x)
tests/test_sparsity24.py:1052
↓ 39 callersMethodis_available
(cls)
xformers/ops/common.py:33
↓ 33 callersMethodfrom_seqlens
Input tensors are assumed to be in shape [B, M, *]
xformers/ops/fmha/attn_bias.py:436
↓ 25 callersMethodapply
( cls, inp: Inputs, needs_gradient: bool )
xformers/ops/fmha/ck.py:222
↓ 23 callersMethoddevice
(self)
xformers/ops/fmha/common.py:160
↓ 22 callersMethodsplit
( self, x: torch.Tensor, batch_sizes: Optional[Sequence[int]] = None )
xformers/ops/fmha/attn_bias.py:475
↓ 19 callersMethodmaterialize
Materializes the bias as a `torch.Tensor`. This is very slow and we don't attempt to make it fast. Only use for debugging/testing.
xformers/ops/fmha/attn_bias.py:89
↓ 18 callersMethodload
xformers/csrc/sparse24/warp_tensor.h:42
↓ 15 callersMethodstore
xformers/csrc/sparse24/warp_tensor.h:56
↓ 12 callersFunctioncreate_tensors
( op: Optional[Type[AttentionOpBase]], device, dtype, attn_bias_type, B, q_len, kv
tests/test_mem_eff_attention.py:367
↓ 12 callersFunctionget_operator
(library: str, name: str)
xformers/ops/common.py:11
↓ 12 callersMethodvalues
(self)
xformers/sparse/blocksparse_tensor.py:107
↓ 10 callersMethod_sp24_to_dense
(self)
xformers/ops/sp24.py:329
↓ 10 callersFunctioncheck_lastdim_alignment_stride1
( reasons: List[str], name: str, x: torch.Tensor, alignment: int )
xformers/ops/fmha/common.py:578
↓ 10 callersMethodintervals
(self)
xformers/ops/fmha/attn_bias.py:411
↓ 10 callersMethodnot_supported_reasons
(cls, d: Inputs)
xformers/ops/fmha/ck.py:353
↓ 8 callersFunction_is_triton_available
()
xformers/__init__.py:45
↓ 8 callersFunction_to_device
(t: torch.Tensor, device: torch.device)
xformers/ops/fmha/attn_bias.py:39
↓ 8 callersMethodsupports
(self, op: "SwiGLUOpDispatch")
xformers/ops/swiglu_op.py:81
↓ 7 callersFunction_get_default_bias_device
(device: Optional[torch.device] = None)
xformers/ops/fmha/attn_bias.py:104
↓ 7 callersFunctioncreate_attn_bias
( bias_type, batch_size: int, num_heads: int, num_heads_groups: int, q_len: int, kv_le
xformers/attn_bias_utils.py:30
↓ 7 callersFunctionlocal_nd_distance
(*sizes, p=2.0, weights=None)
xformers/components/attention/attention_patterns.py:20
↓ 6 callersFunction_materialize_causal_mask
( shape: Tuple[int, ...], dtype: torch.dtype = torch.float32, device: Union[str, torch.device] = "
xformers/ops/fmha/attn_bias.py:114
↓ 6 callersFunctioncheckpoint
Wrapper around torch.utils.checkpoint that accepts a custom policy function for selectively deciding what to store and what to recompute Args:
xformers/checkpoint.py:175
↓ 6 callersMethodfrom_seqlens_padded
Input tensors are assumed to be in shape [B, M, *] seqstart = padding * torch.arange(batch_size)
xformers/ops/fmha/attn_bias.py:574
↓ 6 callersFunctionunroll_varargs
Specializes a triton kernel with variable number of inputs to a specific number of inputs `N`. `mode` can either be `UNROLL` or `CONDITI
xformers/triton/vararg_kernel.py:186
↓ 5 callersFunction_create_tensor
(tensor_type, device, dtype, shape, sparsity)
tests/test_sparse_tensors.py:36
↓ 5 callersFunction_get_tensor_bias
( attn_bias: Optional[Union[torch.Tensor, AttentionBias]], )
xformers/ops/fmha/ck.py:90
↓ 5 callersMethodbackward
(cls, ctx, *tensors: torch.Tensor)
xformers/ops/unbind.py:94
↓ 5 callersFunctionbefore_forward
call this before entering a new FW pass
xformers/fwbw_overlap.py:445
↓ 5 callersFunctionf
(x: torch.Tensor)
tests/test_fwbw_overlap.py:39
↓ 5 callersMethodfrom_tree_choices
Args: tree_choices: tree description in the style of https://github.com/FasterDecoding/Medusa/blob/5e9805386/medu
xformers/ops/tree_attention.py:142
↓ 5 callersMethodinfo
(self)
xformers/ops/swiglu_op.py:105
↓ 5 callersMethodmake_paged
Assuming our keys actually live in separate blocks of length notional_padding, convert to a Paged version, avoiding GPU syncs.
xformers/ops/fmha/attn_bias.py:1598
↓ 5 callersFunctionmemory_efficient_attention_partial_autograd
Wrapper around `memory_efficient_attention_partial` which works with autograd. Arguments are the same as for `memory_efficient_attention_part
xformers/ops/fmha/merge_training.py:165
↓ 5 callersFunctionmerge_attentions_autograd
Wrapper around merge_attentions which works with autograd.
xformers/ops/fmha/merge_training.py:185
↓ 5 callersMethodstep
Signals the profiler that the next profiling step has started.
xformers/profiler/profiler.py:339
↓ 4 callersFunction_check_needs_no_topleft
(d: Inputs, reasons: List[str])
xformers/ops/fmha/flash.py:497
↓ 4 callersFunction_convert_input_format
( inp: Inputs, supports_mqa: bool, use_kvsplit: bool = False, )
xformers/ops/fmha/flash.py:336
↓ 4 callersFunction_convert_input_format
( inp: Inputs, )
xformers/ops/fmha/cutlass_blackwell.py:63
↓ 4 callersFunction_flatten
(x: List[List[torch.Tensor]], rows: int, cols: int)
xformers/ops/tiled_matmul.py:167
↓ 4 callersFunction_get_tensor_bias
( attn_bias: Optional[Union[torch.Tensor, AttentionBias]], )
xformers/ops/fmha/cutlass.py:86
↓ 4 callersFunction_is_causal
(attn_bias: Optional[Union[torch.Tensor, AttentionBias]])
xformers/ops/fmha/flash.py:438
↓ 4 callersFunction_window_size
( attn_bias: Optional[Union[torch.Tensor, AttentionBias]], )
xformers/ops/fmha/flash.py:470
↓ 4 callersMethodat
xformers/csrc/sparse24/sparse24_pack.h:179
↓ 4 callersMethodbackward
(ctx: Any, gx: torch.Tensor)
tests/test_fwbw_overlap.py:140
↓ 4 callersMethodcreate_tensors
( dtype, B: int = 2, Mq: int = 32, Mkv: int = 32, H: int = 3,
tests/test_mem_eff_attention.py:1895
↓ 4 callersMethodcurrent_stream_wait
(self)
xformers/fwbw_overlap.py:28
↓ 4 callersFunctionfn
(x, e)
tests/test_sparsity24.py:945
↓ 4 callersFunctionfused_allgather_and_linear
( scattered_input: torch.Tensor, weight: torch.Tensor, *, group: dist.ProcessGroup, out: O
xformers/ops/sequence_parallel_fused_ops.py:379
↓ 4 callersFunctionfused_linear_and_reducescatter
( gathered_input: torch.Tensor, weight: torch.Tensor, *, group: dist.ProcessGroup, out: Op
xformers/ops/sequence_parallel_fused_ops.py:620
↓ 4 callersFunctiongather_along_first_dim
( input_: torch.Tensor, *, process_group: torch.distributed.ProcessGroup )
xformers/ops/differentiable_collectives.py:63
↓ 4 callersFunctionget_fmha_fwd_mtile
xformers/csrc/attention/hip_fmha/ck_tiled_fmha_fwd_setting.h:177
↓ 4 callersFunctionget_xformers_operator
(name: str)
xformers/ops/common.py:23
↓ 4 callersFunctionlaunch_subprocesses
(world_size: int, fn, *args, **kwargs)
tests/multiprocessing_utils.py:189
↓ 4 callersFunctionmy_matmul
( inputs: List[torch.Tensor], src_rank: int, stream_factory: Callable[[], torch.cuda.S
xformers/ops/sequence_parallel_fused_ops.py:535
↓ 4 callersMethodnormalize_bmhk
(self)
xformers/ops/fmha/common.py:184
↓ 4 callersFunctionoverlap_fw_bw
( trigger_fw: Callable[[], T], trigger_bw: Callable[[], None], initial_bw_chunks: int = 0, )
xformers/fwbw_overlap.py:497
↓ 4 callersFunctionpaged_attention_run_inner
( B: int, MAX_T: int, num_quant_groups: int, page_size: int, op: Type[AttentionFwOpBase],
tests/test_mem_eff_attention.py:2491
↓ 4 callersFunctionrope_padded
Performs RoPE (rotary embeddings) and kv-cache emplacement for a heterogeneous batch for inference in the style given by BlockDiagonalCau
xformers/ops/rope_padded.py:16
↓ 4 callersFunctionuse_splitkv_smallq
This method determines whether to use normal or smallq splitkv kernel
xformers/csrc/attention/hip_fmha/ck_tiled_fmha_fwd_splitkv_smallq_selector.h:13
↓ 3 callersMethod__enter__
(self)
xformers/profiler/profiler.py:324
↓ 3 callersMethod__exit__
(self, exc_type, exc_val, exc_tb)
xformers/profiler/profiler.py:332
↓ 3 callersMethod__init__
( self, dim: int, head_dim: int, n_heads: int, n_kv_heads: int,
examples/llama_inference/model.py:52
↓ 3 callersFunction_dispatch_fw_priority_list
( inp: Inputs, needs_gradient: bool )
xformers/ops/fmha/dispatch.py:86
↓ 3 callersFunction_ensure_op_supports_or_raise
(exc_type, name: str, op, inp: Inputs)
xformers/ops/fmha/dispatch.py:47
↓ 3 callersFunction_gen_24_sparsifiable_both_ways
( M: int, N: int, dtype, seed: int = 0 )
tests/test_sparsity24.py:514
↓ 3 callersFunction_generate_2d_grid
(H, W)
tests/test_attention_patterns.py:29
↓ 3 callersFunction_get_dtype_atol
(tensor_type, device: str)
tests/test_sparse_tensors.py:49
↓ 3 callersFunction_get_use_fa3
()
xformers/ops/fmha/dispatch.py:27
↓ 3 callersFunction_memory_efficient_attention_forward_requires_grad
( inp: Inputs, op: Optional[Type[AttentionFwOpBase]] )
xformers/ops/fmha/__init__.py:499
↓ 3 callersFunction_strides
(x: Optional[torch.Tensor], *stride_names: str)
xformers/ops/fmha/triton_splitk.py:42
↓ 3 callersFunction_test_decoder
( op, n_heads: int, kv_heads: Optional[int], padding: int, bsz: int, dtype: str, d
tests/test_mem_eff_attention.py:1655
↓ 3 callersFunction_to_device_tensor
(seq: Sequence[int], dtype: torch.dtype, device: torch.device)
xformers/ops/fmha/attn_bias.py:48
↓ 3 callersFunction_unflatten
( flat_x: List[torch.Tensor], rows: int, cols: int )
xformers/ops/tiled_matmul.py:175
↓ 3 callersMethod_wrap
(cls, values, bmat)
xformers/sparse/blocksparse_tensor.py:118
↓ 3 callersFunctionassert_flops
( error_msg: str, *, match: int = -1, at_least: int = -1, at_most: Union[int, float] = mat
tests/test_profiler.py:114
↓ 3 callersFunctionbenchmark_main_helper
Helper function to run benchmarks. Supports loading previous results for comparison, and saving current results to file.
xformers/benchmarks/utils.py:438
↓ 3 callersFunctionbenchmark_main_helper2
( name: str, functions, fw: bool = False, bw: bool = False, cuda_graph: bool = True, *
xformers/benchmarks/utils.py:707
↓ 3 callersFunctionceil_div
xformers/csrc/pt_stable_utils.h:56
↓ 3 callersMethodcompute_num_ops
( self, dtype: torch.dtype, fw: bool = True, bw: bool = True )
xformers/profiler/profile_analyzer.py:125
↓ 3 callersFunctioncreate_random_mask
(shape)
tests/test_sparsity24.py:136
↓ 3 callersFunctionflush_single_bw_chunk
()
xformers/fwbw_overlap.py:480
↓ 3 callersMethodfrom_seqlens_gappy
( cls, seqstarts: Sequence[int], seqlens: Sequence[int], paged: bool,
xformers/ops/fmha/attn_bias.py:715
↓ 3 callersMethodfrom_tensor_list
Creates a :attr:`BlockDiagonalMask` from a list of tensors, and returns the tensors concatenated on the sequence length dimension ..
xformers/ops/fmha/attn_bias.py:875
↓ 3 callersMethodfrom_tensor_lists_qkv
( cls, tensors_q: Sequence[torch.Tensor], tensors_k: Sequence[torch.Tensor], t
xformers/ops/fmha/attn_bias.py:908
↓ 3 callersFunctionfused_allgather_and_anything
( scattered_inputs: List[torch.Tensor], my_matmul: Callable[ [List[torch.Tensor], int, Callabl
xformers/ops/sequence_parallel_fused_ops.py:564
↓ 3 callersMethodget_qkv_in_bmghk
(self)
xformers/ops/fmha/common.py:167
↓ 3 callersFunctionget_supported_attn_bias_types
(op)
tests/test_mem_eff_attention.py:226
↓ 3 callersMethodmake_causal_from_bottomright
Makes each block causal with a possible non-causal prefix
xformers/ops/fmha/attn_bias.py:962
↓ 3 callersFunctionreduce_scatter_along_first_dim
( input_: torch.Tensor, *, process_group: torch.distributed.ProcessGroup )
xformers/ops/differentiable_collectives.py:72
↓ 3 callersFunctionsample_random_supported_fw
( inp: fmha.Inputs, seed, op_bw: Type[fmha.common.AttentionBwOpBase] )
tests/test_mem_eff_attention.py:122
↓ 3 callersMethodstart
(self)
xformers/profiler/profiler.py:318
↓ 3 callersFunctiontiled_matmul
Multiply two matrices given as grids of tiles It performs the matmul between A and B, which are given as two-dimensional grids of tiles (i.e.
xformers/ops/tiled_matmul.py:266
↓ 3 callersFunctionuse_cpu_ref
(device: str)
tests/utils.py:44
↓ 3 callersMethodvalidate_inputs
(self)
xformers/ops/fmha/common.py:208
↓ 2 callersMethod__init__
(self, *args, **kwargs)
xformers/checkpoint.py:45
↓ 2 callersMethod__new__
(cls, values, layout)
xformers/sparse/blocksparse_tensor.py:78
next →1–100 of 1,445, ranked by callers