MCPcopy Create free account

hub / github.com/facebookresearch/xformers / functions

Functions1,445 in github.com/facebookresearch/xformers

↓ 2 callersFunctionsequence_parallel_trailing_matmul
( x: torch.Tensor, w: torch.Tensor, *, fuse: bool, process_group: torch.distributed.Proces
xformers/ops/seqpar.py:355
↓ 2 callersFunctionsparsify24_dense
(tensor: torch.Tensor)
tests/test_sparsity24.py:616
↓ 2 callersFunctionstack_or_none
Does exactly the same as :attr:`torch.stack` if the tensors can be concatenated without any memory operation. Otherwise returns None.
xformers/ops/unbind.py:124
↓ 2 callersFunctiontest_forward
(opFW_device_dtype_biasT_B_Mq_Mkv_H_K_Kv, packed, fmt, **kwargs)
tests/test_mem_eff_attention.py:510
↓ 2 callersFunctiontiled_matmul_fwd
( flat_a: List[torch.Tensor], flat_b: List[torch.Tensor], ms: List[int], ns: List[int], ks
xformers/ops/tiled_matmul.py:206
↓ 2 callersFunctiontiled_matmul_out
( a: List[List[torch.Tensor]], b: List[List[torch.Tensor]], out: List[List[torch.Tensor]], )
xformers/ops/tiled_matmul.py:137
↓ 2 callersFunctiontree_attention
Compute Medusa/EAGLE/Hydra-style tree attention. Notice that this function takes as arguments biases for the left (prefix) and right (spe
xformers/ops/tree_attention.py:513
↓ 2 callersMethodupdate_profilers_on_step
(self)
xformers/profiler/profiler.py:284
↓ 2 callersFunctionuse_triton_splitk_for_prefix
Heuristic to decide whether to use Triton Split-k or default (Flash Attention) for prefix attention.
xformers/ops/tree_attention.py:458
↓ 2 callersFunctionxf_slice
xformers/csrc/pt_stable_utils.h:90
↓ 1 callersMethodProcess
(self, *args, **kwargs)
tests/multiprocessing_utils.py:22
↓ 1 callersFunctionT
(t)
xformers/attn_bias_utils.py:435
↓ 1 callersFunctionT
(t)
tests/test_splitk_reference.py:23
↓ 1 callersMethod__init__
(self, trigger_bw: Callable[[], None])
xformers/fwbw_overlap.py:328
↓ 1 callersMethod__init__
( self, in_features: int, out_features: int, *, process_group: torch.d
xformers/ops/modpar_layers.py:109
↓ 1 callersMethod__init__
(self, target, inline_variables, loop_iter)
xformers/triton/vararg_kernel.py:20
↓ 1 callersMethod__init__
( self, B_in_hidden_out_ft: Tuple[int, int, int, int], dtype, bias: bool, bw: bool )
xformers/benchmarks/benchmark_sp24.py:46
↓ 1 callersMethod__post_init__
(self)
xformers/ops/fmha/attn_bias.py:542
↓ 1 callersFunction_analyze_operators
Use ProfileOperatorsTorchDispatchMode to get runtime and memory info. Args: function: The function to optimize which will be selecti
xformers/checkpoint.py:287
↓ 1 callersMethod_analyze_trace
(self, prof: torch.profiler.profiler.profile)
xformers/profiler/profiler.py:113
↓ 1 callersFunction_attention_flops
(queries, values, causal: bool, fmt: str = "BHMK")
xformers/profiler/profile_analyzer.py:23
↓ 1 callersFunction_benchmark_results_from_csv
(filename: str)
xformers/benchmarks/utils.py:237
↓ 1 callersFunction_benchmark_results_to_csv
( filename: str, results: List[Tuple[Dict[str, Any], Any]] )
xformers/benchmarks/utils.py:280
↓ 1 callersFunction_block_diag_reshape_lse
LSE can be padded, let's remove the padding
tests/test_mem_eff_attention.py:612
↓ 1 callersMethod_bmm
(cls, arg0, arg1)
xformers/sparse/blocksparse_tensor.py:125
↓ 1 callersFunction_can_ranks_communicate_all_to_all_over_nvlink
(group: dist.ProcessGroup)
xformers/ops/sequence_parallel_fused_ops.py:342
↓ 1 callersFunction_check_row_or_column
(row_or_col_type, row_or_col_idx, tensor_name, dim_name, vals)
xformers/ops/_triton/tiled_matmul_kernels.py:349
↓ 1 callersFunction_check_strides_for_bmghk
We want to be able to collapse the G/H dimensions together
xformers/ops/fmha/flash.py:519
↓ 1 callersFunction_combine_scale_shift
(scale: torch.Tensor, shift: torch.Tensor)
tests/utils.py:311
↓ 1 callersFunction_coo_to_csr
(m, n, row_indices, column_indices)
xformers/sparse/utils.py:10
↓ 1 callersMethod_copy
(cls, arg0, arg1)
xformers/sparse/blocksparse_tensor.py:158
↓ 1 callersFunction_create_aligned_bias
(*shape: int, **kwargs)
xformers/attn_bias_utils.py:16
↓ 1 callersMethod_create_block_mask
( self, shape: Tuple[int, ...], dtype: torch.dtype = torch.float32, device: Un
xformers/ops/fmha/attn_bias.py:804
↓ 1 callersMethod_create_block_mask
( self, shape: Tuple[int, ...], dtype: torch.dtype = torch.float32, device: Un
xformers/ops/fmha/attn_bias.py:1103
↓ 1 callersFunction_create_blocksparse_tensor
( device, block_size=32, Z=8, C=2, H=64, W=64, dtype=torch.float32 )
tests/test_sparse_tensors.py:23
↓ 1 callersMethod_create_output_filename
Returns where to write a file with desired filename. Handles the case where we are in distributed settings, or when we need t
xformers/profiler/profiler.py:304
↓ 1 callersFunction_csr_to_coo
(m, n, row_offsets, column_indices)
xformers/sparse/utils.py:17
↓ 1 callersFunction_cusplt_find_alg
cuSPARSELt has multiple algorithms (that correspond to different kernels) to run a given GEMM, because the optimal kernel depends on the GEMM
xformers/ops/sp24.py:410
↓ 1 callersFunction_deserialize_bias
(attn_bias_ctx, attn_bias_tensor: Optional[torch.Tensor])
xformers/ops/fmha/__init__.py:55
↓ 1 callersMethod_equal
(cls, arg0, arg1)
xformers/sparse/blocksparse_tensor.py:169
↓ 1 callersFunction_fail_if_regressions
( results: List[Any], reference: List[Any], atol_s: float, rtol: float )
xformers/benchmarks/utils.py:649
↓ 1 callersFunction_filter_unsupported_ops
(ops: Sequence[T])
tests/test_mem_eff_attention.py:99
↓ 1 callersFunction_finalize_results
Returns a `benchmark.Compare` object, except that if we have runs with different algorithms, we also add the algorithm name in the column
xformers/benchmarks/utils.py:306
↓ 1 callersMethod_find_all_root_events_with_flops
( all_events: Sequence[torch._C._autograd._KinetoEvent], )
xformers/profiler/profile_analyzer.py:156
↓ 1 callersFunction_flash_attention3_incompatible_reason
()
xformers/ops/fmha/flash3.py:69
↓ 1 callersFunction_flattened_transpose
( flat_x: List[torch.Tensor], rows: int, cols: int )
xformers/ops/tiled_matmul.py:188
↓ 1 callersFunction_gen4x4
(r: random.Random)
tests/test_sparsity24.py:498
↓ 1 callersFunction_generate_op_device_dtype_biasT_B_Mq_Mkv_H_K_Kv
( ops_list: Sequence[Type[fmha.AttentionOpBase]], max_shapes_per_op: int = 65000 )
tests/test_mem_eff_attention.py:249
↓ 1 callersFunction_get_arg_idx
(op, *arg_names: str)
xformers/profiler/profile_analyzer.py:44
↓ 1 callersFunction_get_batch
()
xformers/ops/fmha/flash3.py:257
↓ 1 callersFunction_get_cusparselt_torch_version
Returns the version of the cusparselt.so library used by pytorch
xformers/ops/sp24.py:45
↓ 1 callersFunction_get_default_policy
(allow_list=None)
xformers/checkpoint.py:82
↓ 1 callersFunction_get_depth_counts
(sorted_tree_choices: List[Tuple[int, ...]])
xformers/ops/tree_attention.py:239
↓ 1 callersMethod_get_inplace_metadata
(self, func, out)
xformers/checkpoint.py:214
↓ 1 callersFunction_get_num_nodes_per_level
( depth_counts: List[int], device: Optional[torch.device] )
xformers/ops/tree_attention.py:252
↓ 1 callersMethod_get_policy_fn
(self, *args, **kwargs)
xformers/checkpoint.py:492
↓ 1 callersFunction_get_strides
( ts: List[List[torch.Tensor]], tensor_name, dim_0_name, dim_1_name )
xformers/ops/_triton/tiled_matmul_kernels.py:360
↓ 1 callersFunction_get_subtree_size_and_num_children_per_node_at_level
( num_nodes_per_level: torch.Tensor, num_children_per_node: torch.Tensor, device: Optional[torch.d
xformers/ops/tree_attention.py:219
↓ 1 callersFunction_get_transpose_info
(m, n, row_indices, row_offsets, column_indices)
xformers/sparse/utils.py:29
↓ 1 callersFunction_has_cusparseLt
()
xformers/ops/sp24.py:75
↓ 1 callersFunction_heuristic_kvsplit
( inp: Inputs, enable_kvsplit_attn: bool, )
xformers/ops/fmha/flash3.py:132
↓ 1 callersFunction_horizontal_axial_2d_distance
(H, W, p=2.0)
tests/test_attention_patterns.py:36
↓ 1 callersFunction_is_bias_type_supported_in_BMK
(attn_bias_type: Any)
xformers/ops/fmha/common.py:38
↓ 1 callersFunction_is_cuda_at_least_sm80
(device: torch.device)
xformers/ops/fmha/triton_splitk.py:135
↓ 1 callersFunction_is_oom_error
(e)
xformers/benchmarks/utils.py:643
↓ 1 callersFunction_is_paged_attention_supported
(attn_bias_type)
xformers/ops/fmha/flash.py:458
↓ 1 callersFunction_is_supported_gappy_bias
(attn_bias: Any)
xformers/ops/fmha/triton_splitk.py:72
↓ 1 callersFunction_launch_triton_matmul
( a: List[List[torch.Tensor]], b: List[List[torch.Tensor]], c: List[List[torch.Tensor]], ms: L
xformers/ops/_triton/tiled_matmul_kernels.py:383
↓ 1 callersFunction_local_1d_pattern
(attn_size: int, window_size: int)
tests/test_attention_patterns.py:15
↓ 1 callersFunction_local_2d_gaussian_distribution
(H, W, sigma=1.0)
tests/test_attention_patterns.py:58
↓ 1 callersMethod_masked_matmul
(cls, a, b, mask)
xformers/sparse/blocksparse_tensor.py:132
↓ 1 callersFunction_memory_efficient_attention
( inp: Inputs, op: Optional[AttentionOp] = None )
xformers/ops/fmha/__init__.py:467
↓ 1 callersFunction_merge_attentions_ref
attn_split: [split_k, B, M, (G,) H, Kq] lse_split: [split_k, B, (G,) H, M]
tests/test_fmha_merge_attentions.py:513
↓ 1 callersFunction_merge_attentions_varargs_ref
attn_split: list of [B, M, (G,) H, Kq] lse_split: list of [B, (G,) H, M]
xformers/benchmarks/benchmark_merge_attentions.py:12
↓ 1 callersMethod_norm
(self, x)
tests/test_rmsnorm.py:35
↓ 1 callersMethod_ordered_params
Used for testing - returns ordered arguments for operators
xformers/ops/swiglu_op.py:361
↓ 1 callersFunction_overlap_fw_bw
( trigger_fw: Callable[[], T], trigger_bw: Callable[[], None], initial_bw_chunks: int = 0, )
xformers/fwbw_overlap.py:508
↓ 1 callersFunction_pack_xformer_input
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, cache_seqlens: List[int], bias_type,
tests/test_mem_eff_attention.py:2949
↓ 1 callersMethod_packed_ordered_params
( self, )
xformers/ops/swiglu_op.py:398
↓ 1 callersFunction_pad_seqdim
(partial: Partial, left: int, right: int)
tests/test_fmha_merge_attentions.py:628
↓ 1 callersFunction_prepare_candidate_idx
( tree_choices: List[Tuple[int, ...]], device: Optional[torch.device] )
xformers/ops/tree_attention.py:445
↓ 1 callersFunction_prepare_child_node_indices
( tree_choices: List[Tuple[int, ...]], device: Optional[torch.device] )
xformers/ops/tree_attention.py:416
↓ 1 callersFunction_prepare_parent_node_indices
( sorted_tree_choices: List[Tuple[int, ...]], device: Optional[torch.device] )
xformers/ops/tree_attention.py:404
↓ 1 callersFunction_prepare_retrieval_indices
Convert tree definition from the format used by Medusa and EAGLE (tree_choices, see docstring of TreeAttnMetadata.from_tree_choices) to a lis
xformers/ops/tree_attention.py:348
↓ 1 callersFunction_prepare_tree_attn_bias
Construct a Medusa-style tree attention bias as an explicit tensor. It can be used as a spec_attn_bias ("right" or "suffix" attention part)
xformers/ops/tree_attention.py:259
↓ 1 callersFunction_prepare_tree_indices
Construct an index tensor for choices in the tree and their corresponding index in the draft tokens. Args: sorted_tree_choices: sorte
xformers/ops/tree_attention.py:317
↓ 1 callersFunction_prepare_tree_position_ids
Construct sequence position of each node within its path, can be used for positional embedding. Args: depth_counts: number of nodes a
xformers/ops/tree_attention.py:383
↓ 1 callersMethod_preprocess_trace
( self, prof: torch.profiler.profiler.profile, file_name: str )
xformers/profiler/profiler.py:98
↓ 1 callersFunction_rand_seqlens
Generates lists of lengths of query blocks and corresponding key blocks. The total number of queries will be bs * q_len and the total num
xformers/attn_bias_utils.py:263
↓ 1 callersFunction_rand_seqlens_padded_k
( r: random.Random, bs: int, q_len: int, kv_len: int )
xformers/attn_bias_utils.py:354
↓ 1 callersMethod_raw_wrap
(cls, values, layout)
xformers/sparse/blocksparse_tensor.py:111
↓ 1 callersFunction_register_extensions
()
xformers/_cpp_lib.py:85
↓ 1 callersFunction_render_bar_plot
(results: List[Any], store_results_folder: str)
xformers/benchmarks/utils.py:343
↓ 1 callersFunction_replace_if_needed
Adds a flops amount for operators that don't have this information in Kineto already This mostly applies for the attention for now, as GEMMs
xformers/profiler/profile_analyzer.py:51
↓ 1 callersFunction_rms_norm_add_forward
(x, y, attn_norm_weights, eps)
xformers/ops/_triton/rmsnorm_kernels.py:125
↓ 1 callersFunction_rms_norm_forward
(x, attn_norm_weights, eps)
xformers/ops/_triton/rmsnorm_kernels.py:94
↓ 1 callersFunction_round_nnz
(mask, divisible_by=4)
xformers/sparse/utils.py:99
↓ 1 callersFunction_sddmm
(a, b, layout)
xformers/sparse/blocksparse_tensor.py:61
↓ 1 callersFunction_seed
()
tests/test_sparse_tensors.py:44
↓ 1 callersFunction_serialize_op
(op)
xformers/ops/fmha/__init__.py:71
← previousnext →201–300 of 1,445, ranked by callers