Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/executorch
/ functions
Functions
28,493 in github.com/pytorch/executorch
⨍
Functions
28,493
◇
Types & classes
6,584
↳
Endpoints
346
↓ 2 callers
Function
_make_quantized_model
Create a tiny model with random weights and quantize it.
examples/models/qwen3_5_moe/test_quantize_roundtrip.py:62
↓ 2 callers
Function
_make_rope_embeddings
( config, hidden_states: torch.Tensor, position_ids: torch.Tensor, )
backends/arm/test/models/Gemma3n/test_gemma3nModel.py:59
↓ 2 callers
Function
_make_submodule
( fn: Callable[..., Union[torch.Tensor, Tuple[torch.Tensor]]], example_returns: Optional[List[torch.Te
exir/control_flow.py:95
↓ 2 callers
Function
_make_symint
( shape_env: ShapeEnv, symbol: str, hint: int, min: int = 1, max: int = 64 )
backends/arm/test/passes/test_rewrite_upsample_pass.py:13
↓ 2 callers
Function
_make_symint
( shape_env: ShapeEnv, symbol: str, hint: int, min: int = 1, max: int = 64 )
backends/arm/test/misc/tosa_dialect/test_tosa_resize.py:21
↓ 2 callers
Function
_make_tq4_inputs
(seed, h_q, head_dim, max_seq, device="cuda")
backends/cuda/tests/test_tq4_sdpa.py:772
↓ 2 callers
Function
_make_triangular_test
Generate a registered OpTestCase subclass for tril or triu.
backends/mlx/test/test_ops.py:4747
↓ 2 callers
Function
_make_vision_cu_seqlens
(device: torch.device)
backends/arm/test/models/Qwen3_VL/test_qwen3_vl_layers.py:90
↓ 2 callers
Method
_mark_bias_as_int48_if_needed
( self, node: torch.fx.Node, bias_node: torch.fx.Node )
backends/arm/_passes/rewrite_conv_pass.py:221
↓ 2 callers
Method
_mark_node_handled
(self, node: Node, *, handler: Optional[Handler] = None)
backends/mlx/builder/program_builder.py:339
↓ 2 callers
Function
_mark_nodes_as_annotated
(nodes: list[_Node])
backends/apple/coreml/quantizer/_coreml_quantizer_utils.py:57
↓ 2 callers
Function
_maybe_duplicate_constant_nodes
If the constants node is shared by different tagged nodes, like constant_0 ----> op_b (tag_10) |-------------> op_a (tag_11) we make
exir/backend/utils.py:210
↓ 2 callers
Method
_maybe_enqueue_shared_node
( self, neighbor: Node, shared_nodes: set[Node], bfs_queue: list[Node] )
backends/arm/quantizer/arm_quantizer_utils.py:519
↓ 2 callers
Method
_maybe_insert_q_dq_after
If the input node of op is a dequant node, insert a q-dq pair after op with identical quantization parameters.
backends/arm/_passes/decompose_meandim_pass.py:237
↓ 2 callers
Function
_merge_runtime_debug_handles
Merge two DebugHandles by removing elements from debug_handle1 that are also present in debug_handle2, while preserving the relative order of
devtools/inspector/_inspector_utils.py:555
↓ 2 callers
Function
_modality_inputs_merger
This method aims at merging the token embeddings with the image hidden states into one single sequence of vectors that are fed to the transformer
examples/qualcomm/oss_scripts/llama/decoder_utils.py:40
↓ 2 callers
Function
_module_ast
(path: Path)
examples/models/lfm2/test_lfm2_5_mlx.py:19
↓ 2 callers
Function
_node_iter_for_targets
(graph_module, targets)
backends/cortex_m/test/misc/test_pattern_matcher.py:52
↓ 2 callers
Function
_normalize_datatype_info
Convert DatatypeInfo → PortDatatypeConstraints (flatten QuantConstraintInfo list).
backends/qualcomm/quantizer/backend_opinfo_adapter.py:89
↓ 2 callers
Function
_normalize_dims
Normalize the dimensions of a tensor.
extension/llm/export/export_passes.py:10
↓ 2 callers
Method
_normalize_dtype
PyTorch export quantizer only supports uint8 and int8 data types, so we map the quantized dtypes to the corresponding supported dtype
backends/apple/coreml/quantizer/_annotation_config.py:59
↓ 2 callers
Method
_normalize_ops
(ops: str | Sequence[str] | None)
backends/arm/test/tester/test_pipeline.py:118
↓ 2 callers
Method
_overwrite_precision
(self, node: torch.fx.Node)
backends/xnnpack/partition/config/gemm_configs.py:99
↓ 2 callers
Function
_pack_dimension
Compute packed dimension size, new padding, and final output size for a single spatial dimension.
backends/arm/_passes/decompose_maxpool2d_with_dilation_pass.py:24
↓ 2 callers
Function
_pack_header
(num_inputs, num_outputs, model_bytes_size)
backends/mediatek/preprocess.py:49
↓ 2 callers
Method
_pad
Pad encoded inputs (on left/right and up to predefined length or max length in the batch). Args: encoded_inputs:
examples/mediatek/aot_utils/llm_utils/tokenizers_/tokenization_utils_base.py:3945
↓ 2 callers
Function
_pad_to
Returns the input followed by enough zero bytes to become the requested length. Args: data: The data to pad. length: The length o
backends/xnnpack/serialization/xnnpack_graph_serialize.py:262
↓ 2 callers
Function
_padding_required
Returns the padding required to align `offset` to `alignment`.
backends/apple/mps/mps_preprocess.py:271
↓ 2 callers
Function
_parse_attention_sink_config
Parse attention sink config from command line args Args: control_args: Command line arguments Returns: sink_size: the num
examples/qualcomm/oss_scripts/llama/wrappers/attention_sink_wrappers.py:190
↓ 2 callers
Function
_parse_fields
Parse fields from a struct/table body.
backends/mlx/serialization/generate.py:260
↓ 2 callers
Method
_parse_sdpa_args_and_kwargs
(cls, sdpa_node: Node)
backends/mlx/patterns.py:415
↓ 2 callers
Function
_parse_tensor_value
( tensor: Optional[Tensor], output_buffer: Optional[bytes] )
devtools/inspector/_inspector_utils.py:165
↓ 2 callers
Function
_parse_version
Turn '2.34' → (2,34) so it can be compared.
backends/qualcomm/scripts/download_qnn_sdk.py:438
↓ 2 callers
Function
_partition_graph_into_submodules
(gm, subgm_tag, subgm_cb, ptn)
backends/qualcomm/utils/utils.py:525
↓ 2 callers
Method
_pe_encoding
Positionally encode points that are normalized to [0,1].
examples/models/efficient_sam/efficient_sam_core/efficient_sam_decoder.py:119
↓ 2 callers
Method
_populate_event_signature_fields
Given a partially constructed Event, populate the fields related to the profile event signature or debug event signature Fie
devtools/inspector/_inspector.py:504
↓ 2 callers
Method
_prefix_key
Apply the named-data key prefix for the .pte namespace. This is the single point where canonical (unprefixed) names are transformed i
backends/mlx/builder/program_builder.py:156
↓ 2 callers
Method
_prepare_dataframe
Args: include_units: Whether headers should include units (default true) include_delegate_debug_data: Whether to incl
devtools/inspector/_inspector.py:1436
↓ 2 callers
Function
_prepare_mask_params
Prepare attention mask parameters for kernel invocation.
backends/cuda/triton/kernels/sdpa.py:709
↓ 2 callers
Method
_prepare_module_for_qparam_assertions
(self, module, sample_input)
backends/qualcomm/tests/test_qnn_delegate.py:4370
↓ 2 callers
Function
_preprocess_multimethod
Helper function to abstract out the logic to be shared between the two backends: FirstBackendWithPreprocessAll and SecondBackendWithPreproces
exir/backend/test/backend_with_preprocess_all_demo.py:48
↓ 2 callers
Method
_preprocess_token_ids
Pre-process the token ids for decoding by removing the prompt tokens ids and timestamp token ids. Args: token_ids (`Union[int, Li
examples/mediatek/aot_utils/llm_utils/tokenizers_/tokenization_whisper.py:706
↓ 2 callers
Method
_process_nodes
Common logic for processing all nodes: create slots, match patterns, run handlers. This method: 1. Creates I/O slots for pla
backends/mlx/builder/program_builder.py:504
↓ 2 callers
Method
_propagate_channels_first_format_up
(self, node: Node)
backends/nxp/backend/node_format_inference.py:288
↓ 2 callers
Function
_qnn_subprocess_env
Return an env dict with LD_LIBRARY_PATH set so QNN SDK prebuilt binaries (e.g. qnn-context-binary-utility) can resolve their bundled libc++.so
backends/qualcomm/tests/utils.py:140
↓ 2 callers
Function
_qspec_port_encoding_type
(node: Node, qspec: QuantizationSpecBase)
backends/qualcomm/quantizer/validators.py:281
↓ 2 callers
Method
_quantize
(self, value)
examples/models/llama/source_transformation/custom_kv_cache.py:86
↓ 2 callers
Method
_quantize
Symmetric per-token quantization using basic torch ops.
examples/models/gemma4/text_decoder/gemma4_attention.py:527
↓ 2 callers
Function
_quantize_and_lower_module
( module: GraphModule, input_shape: tuple[int, ...], is_qat: bool, target="imxrt700" )
backends/nxp/tests/generic_tests/test_split_group_convolution.py:41
↓ 2 callers
Method
_quantize_and_update
(self, input_pos, k_val, v_val, indices=None)
examples/models/llama/source_transformation/custom_kv_cache.py:103
↓ 2 callers
Function
_quantize_fused_conv_bias
Core logic for quantizing biases introduced by BatchNorm fusion/QAT. BatchNorm fusion or QAT introduces a bias to conv layers that originally had
backends/transforms/quantize_fused_convbn_bias_pass.py:164
↓ 2 callers
Method
_quantized_op
This is the quantized linear op that is used to implement the weight-only int4 quantized linear op.
examples/models/llama/experimental/subclass.py:383
↓ 2 callers
Function
_raise_with_executorch_hint
Re-raise a coremltools quantization error with ExecuTorch-specific guidance.
backends/apple/coreml/compiler/torch_ops.py:38
↓ 2 callers
Function
_random_non_identity_permutation
( rng: random.Random, rank: int )
backends/arm/test/misc/test_high_rank_permute_view_invariants.py:53
↓ 2 callers
Method
_reduction_dims_are_trailing
Check whether all reduction dims are the trailing (innermost) dims.
backends/cadence/aot/remove_ops.py:476
↓ 2 callers
Function
_register_subclass
(cls)
examples/models/qwen3_5_moe/quantize_and_save.py:46
↓ 2 callers
Method
_register_tensor
( self, gm: torch.fx.GraphModule, node: fx.Node, tensor_constant: TensorConstant )
backends/qualcomm/_passes/lift_constant_scalar_operands.py:107
↓ 2 callers
Function
_reinsert_node_before
( graph_module: GraphModule, node: Node, insertion_point: Node )
backends/nxp/aten_passes/simulated_linear_bn_fusion_passes/add_simulated_linear_bn_fusion_qat_pass.py:73
↓ 2 callers
Function
_remove_pattern_from_graph
(graph_module: GraphModule, pattern: GraphModule)
backends/nxp/aten_passes/simulated_linear_bn_fusion_passes/remove_simulated_linear_bn_fusion_qat_pass.py:81
↓ 2 callers
Method
_repeat_kv
Repeat KV heads to match Q heads for MQA/GQA.
examples/models/gemma4/text_decoder/gemma4_attention.py:239
↓ 2 callers
Function
_replace_modules
Recursively replace all instances of target_type using factory.
backends/mlx/llm/source_transformation.py:32
↓ 2 callers
Method
_require_wc_algo
( self, )
backends/openvino/quantizer/quantizer.py:133
↓ 2 callers
Method
_reshape_for_broadcast
Helper function to reshape frequencies for broadcasting
backends/vulkan/test/test_vulkan_passes.py:125
↓ 2 callers
Method
_reshape_for_broadcast
(self, freqs_cis: torch.Tensor, x: torch.Tensor)
backends/vulkan/patterns/rope.py:63
↓ 2 callers
Method
_resize_img
(self, file: str, scale: int)
examples/mediatek/model_export_scripts/edsr.py:61
↓ 2 callers
Method
_resize_img
(self, file: str, scale: int)
examples/qualcomm/scripts/edsr.py:61
↓ 2 callers
Method
_resolve_constant
Returns (dict, key) or None.
backends/mlx/builder/program_builder.py:1076
↓ 2 callers
Function
_restore_constant_segment
Convert constant and mutable tensors from a single byte-blob into a list of individual tensors. Args: constant_segment: SubsegmentOffset
exir/_serialize/_program.py:627
↓ 2 callers
Method
_rewrite_constant_pad
(self, input_tensor, pad, value, meta)
backends/arm/_passes/rewrite_pad.py:27
↓ 2 callers
Method
_root_dir
The path to the root of the git repo.
setup.py:112
↓ 2 callers
Method
_rotate_half
(x: torch.Tensor)
backends/vulkan/patterns/rope_hf.py:60
↓ 2 callers
Function
_rotate_interleave
Pairwise rotation on adjacent pairs: (-x1, x0, -x3, x2, ...).
examples/models/voxtral_tts/model.py:206
↓ 2 callers
Function
_run_et_aoti
Export and run a model through the ExecuTorch CUDA AOTI backend.
backends/cuda/tests/test_output_stride_rearrange.py:31
↓ 2 callers
Function
_run_evaluate_model
(*args: str)
backends/arm/test/misc/test_evaluate_model.py:14
↓ 2 callers
Function
_run_flatc
Runs the `flatc` command with the provided args. If a resource matching _FLATC_RESOURCE_NAME exists, uses that executable. Otherwise, expects
exir/_serialize/_flatbuffer.py:324
↓ 2 callers
Function
_run_fuse_pass
(graph_module: GraphModule)
backends/arm/test/passes/test_fuse_consecutive_concat_shapes.py:77
↓ 2 callers
Method
_run_manual_dqlinear_tests
(self, weight_n_bit: int, op_dtype: torch.dtype)
backends/apple/mps/test/test_mps_linear.py:504
↓ 2 callers
Method
_run_model_and_get_inspector
Helper method to export a model, run it with event tracing, and return an Inspector instance for verifying intermediate outputs.
devtools/inspector/tests/inspector_test.py:2037
↓ 2 callers
Method
_run_pipeline
(self)
export/export.py:434
↓ 2 callers
Function
_run_python_program
Run a model in Python with channels first (contiguous) inputs. :param model: Any PyTorch/ExecuTorch model runnable directly in python with channe
backends/nxp/tests/nsys_testing.py:298
↓ 2 callers
Method
_safe_compute_flat_size
Compute the flat size of a tensor with given shape. Strings and negative dimensions are treated as '1'. :param shape: Shape of the tensor. Ca
backends/nxp/backend/ir/converter/node_converters/ops_converters/view_copy_converter.py:148
↓ 2 callers
Function
_save_bundle
Save a quantized model as a bundle (model.safetensors + config.json). Uses the production save_quantized_model for weights, and writes a conf
examples/models/qwen3_5_moe/test_quantize_roundtrip.py:87
↓ 2 callers
Function
_save_program
Save the ExecuTorch program to disk.
backends/mlx/examples/llm/export_llm_hf.py:315
↓ 2 callers
Method
_save_to_external_constant_map
Saves external constant to the map.
exir/emit/_emitter.py:374
↓ 2 callers
Function
_sdpa_fwd_kernel_body
Shared kernel body for SDPA forward pass. PACK_GQA: when True, multiple Q heads sharing the same KV head are folded into the M dimension
backends/cuda/triton/kernels/sdpa.py:329
↓ 2 callers
Method
_sdpa_ref
( self, q_quantized, k_quantized, v_quantized, start_pos, q_ze
extension/llm/custom_ops/test_quantized_sdpa.py:77
↓ 2 callers
Function
_select_by_module_instance
Build a selector that matches nodes inside `nn_module_stack` instances accepted by `instance_predicate` (called with each entry value).
devtools/intermediate_output_tap/_selectors.py:86
↓ 2 callers
Function
_select_index
(value)
backends/arm/_passes/convert_split_to_slice.py:116
↓ 2 callers
Function
_serialize_op_counts
A utility function to serialize op counts to a string, for the purpose of including in the test report.
backends/test/suite/reporting.py:360
↓ 2 callers
Function
_set_batched_moe
Toggle batched tensor-core MoE kernel for all MoE layers.
examples/models/qwen3_5_moe/export.py:691
↓ 2 callers
Function
_set_dequant_prefill
Toggle dequant+BF16 prefill path for all W4DequantLinear modules.
examples/models/qwen3_5_moe/export.py:614
↓ 2 callers
Method
_set_seed
Set random seed for reproducibility.
backends/mlx/test/test_utils.py:852
↓ 2 callers
Function
_short_label
(shape, scenario="decode")
backends/cuda/benchmarks/benchmark_sdpa.py:179
↓ 2 callers
Method
_should_report_rejection
(self, rejected: RejectedPatternReport)
backends/cortex_m/quantizer_reporter.py:258
↓ 2 callers
Function
_should_transform
Returns whether the given tensor should be transformed by the pass to contiguous dim order.
exir/passes/convert_constant_dim_order_pass.py:6
↓ 2 callers
Function
_skip_passthrough_user
Given `node`, advance to its next non-passthrough user, walking through any chain of clone/dim_order_copy ops in between (collecting them in `
backends/vulkan/patterns/quantized_pixel_shuffle.py:38
↓ 2 callers
Method
_skip_shared_qspec_from_io
(self, node: Node, qspec: QuantizationSpec)
backends/arm/quantizer/arm_quantizer_utils.py:516
↓ 2 callers
Method
_slice_cache_to_actual
Slice K/V/mask along seq dim to actually-valid range. The static KV cache is allocated at max_seq_len, but only positions [0, start_p
examples/models/gemma4/text_decoder/gemma4_attention.py:278
↓ 2 callers
Method
_slice_mask
Slice a [max_seq_len, max_seq_len] mask to current query positions x cache.
examples/models/gemma4/text_decoder/gemma4_attention.py:309
↓ 2 callers
Method
_split_per_channel_qparams
( qarg: _PerChannelQuantArgs, start_index, stop_index )
backends/arm/_passes/decompose_grouped_conv_pass.py:179
← previous
next →
2,901–3,000 of 28,493, ranked by callers