brk-code

pytorch の API リファレンス

pytorch (pytorch/pytorch) の公開 API 400 件 —— クラス 131、関数 208、メソッド 61。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: pytorch/pytorch

種別件数
クラス131
関数208
メソッド61

API 一覧

func.ci.libtorch.extract_libtorch_from_wheel.copy_bin(torch_dir:Path, libtorch_bin:Path, platform:str) -> None
Copy binary executables (mainly relevant for Windows).
func.ci.libtorch.extract_libtorch_from_wheel.copy_libraries(torch_dir:Path, libtorch_lib:Path, platform:str) -> None
Copy libraries from torch/lib/ to libtorch/lib/.
func.ci.libtorch.extract_libtorch_from_wheel.get_git_hash(torch_dir:Path) -> str
Read git_version from the wheel's torch/version.py.
class.ci.lumen_cli.cli.lib.common.cli_helper.TargetSpec
CLI subcommand specification with bA.
func.ci.lumen_cli.cli.lib.common.cli_helper.register_targets(parser:argparse.ArgumentParser, target_specs:dict[str, TargetSpec], common_args:Callable[[argparse.ArgumentParser], None]=lambda _: None) -> None
Register target subcommands.
func.ci.lumen_cli.cli.lib.common.docker_helper.local_image_exists(image_name:str, client:docker.DockerClient | None=None) -> bool
Return True if a local Docker image exists.
func.ci.lumen_cli.cli.lib.common.envs_helper.env_path(name:str, default:str | Path | None=None, resolve:bool=True) -> Path
Get environment variable as Path, raise if missing.
func.ci.lumen_cli.cli.lib.common.envs_helper.env_path_optional(name:str, default:str | Path | None=None, resolve:bool=True) -> Path | None
Get environment variable as optional Path.
func.ci.lumen_cli.cli.lib.common.envs_helper.generate_dataclass_help(cls) -> str
Auto-generate help text for dataclass fields.
func.ci.lumen_cli.cli.lib.common.envs_helper.get_env(name:str, default:str='') -> str
Get environment variable with default fallback.
func.ci.lumen_cli.cli.lib.common.gh_summary.md_heading(text:str, level:int=2) -> str
Generate a Markdown heading string with the given level (1-6).
class.ci.lumen_cli.cli.lib.common.git_helper.PrintProgress
Simple progress logger for git operations.
func.ci.lumen_cli.cli.lib.common.path_helper.copy(src:str | Path, dst:str | Path) -> None
Copy file or directory from src to dst.
func.ci.lumen_cli.cli.lib.common.path_helper.ensure_dir_exists(path:str | Path) -> Path
Create directory if it doesn't exist.
func.ci.lumen_cli.cli.lib.common.path_helper.force_create_dir(path:str | Path) -> Path
Remove directory if exists, then create fresh empty directory.
func.ci.lumen_cli.cli.lib.common.path_helper.get_path(path:str | Path, resolve:bool=False) -> Path
Convert to Path object, optionally resolving to absolute path.
func.ci.lumen_cli.cli.lib.common.path_helper.is_path_exist(path:str | Path | None) -> bool
Check if path exists.
func.ci.lumen_cli.cli.lib.common.path_helper.remove_dir(path:str | Path | None) -> None
Remove directory if it exists.
func.ci.lumen_cli.cli.lib.common.utils.run_command(cmd:str, use_shell:bool=False, log_cmd:bool=True, cwd:str | None=None, env:dict | None=None, check:bool=True) -> int
Run a command with optional shell execution.
func.ci.lumen_cli.cli.lib.common.utils.str2bool(value:str | None) -> bool
Convert environment variables to boolean values.
class.ci.lumen_cli.cli.lib.core.vllm.vllm_build.VllmBuildRunner
Build vLLM using docker buildx.
func.ci.manywheel.build_env_setup.discover_rocm_home() -> str
Locate the ROCm install root.
class.ci.manywheel.repair_wheel.AuxFile
Auxiliary content (e.g.
func.ci.manywheel.repair_wheel.aarch64_extra_deps(use_cuda:bool) -> list[Path]
Libraries to bundle into torch/lib/ on aarch64.
func.ci.manywheel.repair_wheel.cuda_rpaths(gpu_arch_version:str) -> str
Build the colon-separated RPATH list for CUDA wheels.
func.ci.manywheel.repair_wheel.rocm_os_deps() -> list[Path]
OS-side runtime deps that must travel with ROCm wheels.
func.ci.manywheel.repair_wheel.rocm_rpaths() -> str
RPATH list for the TheRock wheel-based ROCm layout.
func.ci.manywheel.repair_wheel.wheel_platform_tags(wheel_name:str) -> list[str]
Platform tags encoded in a wheel filename.
func.ci.pytorch.windows._common.download(url:str, dest:Path, attempts:int=5) -> None
Stream `url` to `dest`, retrying with exponential backoff.
func.ci.pytorch.windows._common.write_env_exports(env:dict[str, str], path:Path | None) -> None
Write `export KEY=VALUE` lines for build.sh to source.
func.ci.pytorch.windows.build_env_setup.capture_vcvars_env(vcvarsall:Path, args:str) -> dict[str, str]
Capture the env diff produced by `vcvarsall.bat <args>`.
func.ci.pytorch.windows.build_env_setup.find_cuda_path(dotted_version:str) -> Path
Find the CUDA install root for the requested dotted version.
func.ci.pytorch.windows.build_env_setup.find_nvtoolsext() -> Path
Mirror internal/check_nvtx.bat.
func.ci.pytorch.windows.build_env_setup.find_vcvarsall(vc_year:str) -> Path
Locate vcvarsall.bat via vswhere.exe.
func.spin.cmds.develop()
Build PyTorch (editable install).
func.spin.cmds.docs(make_args)
Build documentation.
func.spin.cmds.fixlint(ctx, *lintrunner_args, **kwargs)
Autofix all files.
func.spin.cmds.infer(files)
Infer type annotations using `pyrefly infer`.
func.spin.cmds.install()
Install PyTorch (non-editable).
func.spin.cmds.lint(ctx, *lintrunner_args, *apply_patches, **kwargs)
Lint all files.
func.spin.cmds.quickfix(ctx, *lintrunner_args, **kwargs)
Autofix changed files.
func.spin.cmds.quicklint(ctx, *lintrunner_args, *apply_patches, **kwargs)
Lint changed files.
func.spin.cmds.regenerate_clangtidy_files()
Regenerate clang-tidy files.
func.spin.cmds.regenerate_type_stubs()
Regenerate type stubs.
func.spin.cmds.regenerate_version()
Regenerate version.py.
func.spin.cmds.setup_lint()
Set up lintrunner with current CI version.
funcaten.src.ATen.native.transformers.hip.flash_attn.ck.fav_v3.generate_aiter_embedded_hsa.sanitize_identifier(name:str) -> str
Convert a file path to a valid C++ identifier.
classfunctorch.dim.DotPart
Helper class for organizing dimensions in dot products.
methodfunctorch.dim.DotPart.append(dim_entry:Any) -> None
Add a dimension entry to this part.
methodfunctorch.dim.Tensor.order(*dims:Any) -> _Tensor
Reorder the dimensions of this tensor.
funcfunctorch.dim._getsetitem.has_dims(obj:Any) -> bool
Check if an object has first-class dimensions.
funcfunctorch.dim._getsetitem.setitem(self:Any, index:Any, rhs:Any) -> None
Set values in tensor using first-class dimensions.
funcfunctorch.dim._order.append_dim(d:DimEntry) -> None
Add a dimension to the reordering, removing it from available levels.
funcfunctorch.dim._wrap.handle_from_tensor(tensor:torch.Tensor) -> torch.Tensor
Handle tensor conversion for torch function integration.
funcfunctorch.dim.dimlists(n:int | None=None, sizes:list[int | None] | None=None) -> DimList | tuple[DimList, ...]
Create and return one or more DimList objects.
funcfunctorch.dim.dims(n:int | None=None, sizes:list[int | None] | None=None) -> Dim | tuple[Dim, ...]
Create and return one or more Dim objects.
funcfunctorch.dim.dot(lhs:Any, rhs:Any, sum_dims:Any) -> _Tensor | torch.Tensor
Perform dot product between two tensors along specified dimensions.
funcfunctorch.dim.dot_finish(parts:list[DotPart], result_tensor:torch.Tensor) -> Tensor
Finish dot product by reshaping result and creating Tensor.
funcfunctorch.dim.dot_prepare(parts:list[DotPart], tensor_info:TensorInfo) -> torch.Tensor
Prepare tensor for dot product by matching levels and reshaping.
funcfunctorch.dim.handle_from_tensor(tensor:torch.Tensor) -> torch.Tensor
Handle tensor conversion for torch function integration.
funcfunctorch.dim.index(self:Any, positions:Any, dims:Any) -> _Tensor
Index a regular tensor by binding specified positions to dims.
funcfunctorch.dim.insert_dim(d:Any, lhs_idx:Any, rhs_idx:Any) -> None
Insert dimension into appropriate part based on stride pattern.
funcfunctorch.dim.split(tensor:Any, split_size_or_sections:Any, dim:Any=None) -> tuple
Split tensor along a dimension.
funcfunctorch.dim.stack(tensors:Any, new_dim:Any, dim:int=0) -> _Tensor
Stack tensors along a new dimension.
functorch.__config__.parallel_info() -> str
Returns detailed string with parallelization settings
classtorch._appdirs.AppDirs
Convenience wrapper for getting application dirs.
methodtorch._custom_op.impl.CustomOp.impl_factory() -> typing.Callable
Register an implementation for a factory function.
functorch._dynamo.backends.common.fake_tensor_unsupported(fn:Callable[[Any, list[Any], Any], R]) -> Any
Decorator for backends that need real inputs.
functorch._dynamo.backends.registry.lookup_backend(compiler_fn:str | CompilerFn) -> CompilerFn
Expand backend strings to functions
functorch._dynamo.bytecode_analysis.remove_dead_code(instructions:list['Instruction']) -> list['Instruction']
Dead code elimination
functorch._dynamo.bytecode_analysis.remove_pointless_jumps(instructions:list['Instruction']) -> list['Instruction']
Eliminate jumps to the next instruction
classtorch._dynamo.bytecode_debugger.DebuggerState
Per-frame debugging state.
functorch._dynamo.bytecode_debugger.breakpoint() -> None
Programmatic breakpoint for user code.
functorch._dynamo.bytecode_debugger.debug() -> Generator[_DebugContext, None, None]
Context manager for debugging Dynamo-generated bytecode.
classtorch._dynamo.bytecode_transformation.Instruction
A mutable version of dis.Instruction
functorch._dynamo.bytecode_transformation.assemble(instructions:list[Instruction], firstlineno:int) -> tuple[bytes, bytes]
Do the opposite of dis.get_instructions()
functorch._dynamo.bytecode_transformation.debug_checks(code:types.CodeType) -> None
Make sure our assembler produces same bytes as we start with
functorch._dynamo.bytecode_transformation.decode_exception_table_varint(bytes_iter:Iterator[int]) -> int
Inverse of `encode_exception_table_varint`.
functorch._dynamo.bytecode_transformation.explicit_super(code:types.CodeType, instructions:list[Instruction]) -> None
convert super() with no args into explicit arg form
functorch._dynamo.bytecode_transformation.fix_extended_args(instructions:list[Instruction]) -> int
Fill in correct argvals for EXTENDED_ARG ops
functorch._dynamo.bytecode_transformation.pop() -> None
Pop the key_stack and append an exception table entry if possible.
functorch._dynamo.bytecode_transformation.virtualize_jumps(instructions:Iterable[Instruction]) -> None
Replace jump targets with pointers to make editing easier
functorch._dynamo.cache_size.exceeds_recompile_limit(cache_size:CacheSizeRelevantForFrame, compile_id:CompileId) -> tuple[bool, str]
Checks if we are exceeding the cache size limit.
classtorch._dynamo.codegen.PyCodegen
Helper class uses for constructing Python bytecode
methodtorch._dynamo.codegen.PyCodegen.load_function_name(fn_name:str, push_null:bool, num_on_stack:int=0) -> list[Instruction]
Load the global fn_name on the stack num_on_stack down
methodtorch._dynamo.codegen.PyCodegen.make_call_generated_code(fn_name:str) -> None
Call the generated code function stored in fn_name
methodtorch._dynamo.codegen.PyCodegen.make_function_with_closure(fn_name:str, code:types.CodeType) -> None
Creates a closure with code object `code`.
methodtorch._dynamo.codegen.PyCodegen.mark_source_temp(source:Source) -> None
Mark a source as a temp variable, so that it can be reused.
methodtorch._dynamo.codegen.PyCodegen.setup_globally_cached(name:str, value:Any) -> list[Instruction]
Store value in a new global
classtorch._dynamo.convert_frame.GraphCaptureOutput
Minimal version of DynamoOutput
functorch._dynamo.convert_frame.has_tensor(obj:object) -> bool
Recursively check if the obj has a tensor
functorch._dynamo.convert_frame.has_tensor_in_frame(frame:DynamoFrameType) -> bool
Check if the frame has torch.* related bits
functorch._dynamo.convert_frame.register_bytecode_hook(hook:BytecodeHook) -> RemovableHandle
Register hooks for bytecode generated by Dynamo.
functorch._dynamo.dce_extra_outputs.dce_hop_extra_outputs(gm:torch.fx.GraphModule) -> bool
Remove unused extra outputs from HOP calls in all submodules.
classtorch._dynamo.debug_utils.TensorContainer
Container for tensors as attributes
functorch._dynamo.debug_utils.clone_inputs_retaining_gradness(example_inputs:Sequence[Any]) -> list[Any]
This clone inputs is different from utils clone_input.
functorch._dynamo.decorators.graph_break(msg:str='') -> None
Force a graph break
functorch._dynamo.decorators.nonstrict_trace(traceable_fn:Callable[_P, _R]) -> Callable[_P, _R]
Decorator to mark a function as nonstrict-traceable for dynamo.
functorch._dynamo.decorators.override_optimization_hint(x:Any, val:int) -> None
Override the optimization hint for a scalar unbacked symbol.
functorch._dynamo.decorators.run(fn:Callable[_P, _R] | None=None) -> Any
Don't do any dynamic compiles, just use prior optimizations
functorch._dynamo.decorators.skip_frame(msg:str='') -> None
Force a skipped frame
classtorch._dynamo.device_interface.DeviceInterface
This is a simple device runtime interface for Inductor.
methodtorch._dynamo.dynamo_profiler.DynamoProfilerState.get_timings() -> list[FunctionTraceTiming]
Get all recorded timings.
methodtorch._dynamo.dynamo_profiler.DynamoProfilerState.pop() -> ProfilerStackEntry | None
Pop the top entry from the timing stack.
methodtorch._dynamo.dynamo_profiler.DynamoProfilerState.push(func_name:str, filename:str, firstlineno:int, start_time_ns:int) -> None
Push a new entry onto the timing stack.
methodtorch._dynamo.dynamo_profiler.DynamoProfilerState.record_timing(timing:FunctionTraceTiming) -> None
Record timing data for a traced function.
classtorch._dynamo.dynamo_profiler.FunctionTraceTiming
Timing data for a single inlined function trace.
functorch._dynamo.eval_frame.remove_from_cache(f:Any) -> None
Make sure f.__code__ is not cached to force a recompile
classtorch._dynamo.exc.CondOpArgsMismatchError
Internal error from cond() due to arguments mismatch.
classtorch._dynamo.exc.TorchDynamoException
Base exception class for all TorchDynamo-specific exceptions.
functorch._dynamo.exc.raise_type_error(tx:InstructionTranslatorBase, msg:str) -> NoReturn
Raise a TypeError as an observed exception during tracing.
functorch._dynamo.exc.raise_value_error(tx:InstructionTranslatorBase, msg:str) -> NoReturn
Raise a ValueError as an observed exception during tracing.
functorch._dynamo.exc.unimplemented(*gb_type:str, *context:str, *explanation:str, *hints:list[str], *from_exc:Any=_NOTHING, *log_warning:bool=False, *skip_frame:bool=False) -> NoReturn
Called within dynamo to cause a graph break.
functorch._dynamo.external_utils.insert_const_values_with_mask(tup:tuple[Any, ...], masks:list[bool], values:tuple[Any, ...]) -> tuple[Any, ...]
masks and values are of same length.
functorch._dynamo.external_utils.wrap_dunder_call_ctx_manager(self:Any, func:Callable[_P, _R]) -> Callable[_P, _R]
Apply self as a ctx manager around a call to func
functorch._dynamo.external_utils.wrap_inline(fn:Callable[_P, _R]) -> Callable[_P, _R]
Create an extra frame around fn that is not in skipfiles.
functorch._dynamo.functional_export.clean_export_root(graph_module:torch.fx.GraphModule) -> None
Remove export_root artifacts from FX graph in-place
functorch._dynamo.functional_export.clean_export_root_string(text:str) -> str
Generic utility to clean export_root patterns from strings.
classtorch._dynamo.graph_id_filter.GraphBackendRouter
Routes graphs to different backends based on their IDs.
functorch._dynamo.graph_id_filter.get_backend_override_for_compile_id(compile_id:CompileId | None, config_str:str) -> Any
Get the backend override for a given CompileId.
classtorch._dynamo.graph_region_tracker.RegionWrapper
Holds state for regions e.g.
classtorch._dynamo.guards.GuardManagerWrapper
A helper class that contains the root guard manager.
classtorch._dynamo.guards.UnsupportedGuardCheckSpec
Sentinel for guards with no check spec yet.
functorch._dynamo.guards.install_guard(*skip:int=0, *guards:Guard) -> None
Add dynamo guards to the current tracing context.
functorch._dynamo.guards.strip_local_scope(s:str) -> str
Replace occurrences of L[...] with just the inner content.
methodtorch._dynamo.metrics_context.MetricsContext.add_to_set(metric:str, value:Any) -> None
Records a metric as a set() of values.
methodtorch._dynamo.metrics_context.MetricsContext.add_top_n(metric:str, key:Any, val:int) -> None
Records a metric as a TopN set of values.
methodtorch._dynamo.metrics_context.MetricsContext.in_progress() -> bool
True if we've entered the context.
methodtorch._dynamo.metrics_context.MetricsContext.increment(metric:str, value:int) -> None
Increment a metric by a given amount.
methodtorch._dynamo.metrics_context.MetricsContext.set(metric:str, value:Any, overwrite:bool=False) -> None
Set a metric to a given value.
methodtorch._dynamo.metrics_context.MetricsContext.update(values:dict[str, Any], overwrite:bool=False) -> None
Set multiple metrics directly.
methodtorch._dynamo.metrics_context.MetricsContext.update_outer(values:dict[str, Any]) -> None
Update, but only when at the outermost context.
functorch._dynamo.mutation_guard.is_dynamic_nn_module(obj:Any, is_export:bool) -> bool
Check for nn.Modules() created dynamically or mutated
functorch._dynamo.mutation_guard.watch(obj:Any, guarded_code:Any) -> None
invalidate guarded_code when obj is mutated
classtorch._dynamo.output_graph.FakeRootModule
Trick the constructor of fx.GraphModule
classtorch._dynamo.output_graph.GraphCompileReason
Stores why a given output graph was compiled; i.e.
classtorch._dynamo.output_graph.OutputGraph
Wrapper class to hold outputs of InstructionTranslator.
methodtorch._dynamo.output_graph.OutputGraph.bypass_package(reason:str='', **kwargs:Any) -> None
Do not save this output graph to the CompilePackage
methodtorch._dynamo.output_graph.OutputGraph.example_value_from_input_node(node:torch.fx.Node) -> Any
Extract the non-fake example tensor
methodtorch._dynamo.output_graph.OutputGraph.install_global(prefix:str, value:Any) -> str
Installs a global, generating a unique name for it.
methodtorch._dynamo.output_graph.OutputGraph.install_global_by_id(prefix:str, value:Any) -> str
Installs a global if it hasn't been installed already.
methodtorch._dynamo.output_graph.OutputGraph.install_global_unsafe(name:str, value:Any) -> None
WARNING: prefer the safer `install_global_by_id/install_global`.
methodtorch._dynamo.output_graph.OutputGraph.install_resume_function_global(name:str, code:types.CodeType, f_globals:dict[str, Any]) -> None
Install a resume function as a global.
methodtorch._dynamo.output_graph.OutputGraph.save_global_state(out:dict[str, tuple[Callable[..., Any], bool]] | None=None) -> None
Saves to out if it is provided.
methodtorch._dynamo.output_graph.OutputGraph.update_co_names(name:str) -> None
Ensure self.code_options.co_names contains name
classtorch._dynamo.output_graph.OutputGraphCommon
A minimal interface for full graph capture.
classtorch._dynamo.output_graph.SubgraphTracer
Holds an FX graph that is being traced.
methodtorch._dynamo.output_graph.SubgraphTracer.maybe_lift_tracked_freevar_to_input(arg:Any) -> Any
If arg is a free variable, then lift it to be an input.
classtorch._dynamo.package.SystemInfo
System information including Python, PyTorch, and GPU details.
functorch._dynamo.polyfills.copy.reduce_ex_user_defined_object(obj:T, protocol:int) -> tuple
Traceable polyfill for object.__reduce_ex__ (protocol >= 2).
functorch._dynamo.polyfills.list_cmp(op:Callable[[Any, Any], bool], left:Sequence[T], right:Sequence[T]) -> bool
emulate `(1,2,3) > (1,2)` etc
classtorch._dynamo.polyfills.pytree.PyTreeSpec
Analog for :class:`optree.PyTreeSpec` in Python.
functorch._dynamo.repro.after_aot.setup_fake_process_groups(group_info:dict[str, GroupInfo]) -> None
Set up fake process groups for repro execution.
functorch._dynamo.repro.after_dynamo.dump_backend_repro_as_file(gm:torch.fx.GraphModule, args:Sequence[Any], compiler_name:str | None, check_accuracy:bool=False) -> None
Saves the repro to a repro.py file
functorch._dynamo.repro.after_dynamo.dump_backend_state(gm:torch.fx.GraphModule, args:Sequence[Any], compiler_name:str | None, check_accuracy:bool=False) -> None
Dumps the dynamo graph to repro the issue.
functorch._dynamo.reset() -> None
Clear all compile caches and restore initial state.
functorch._dynamo.set_recursion_limit(limit:int) -> None
Sets an internal dynamo recursion limit.
classtorch._dynamo.symbolic_convert.InliningInstructionTranslator
Trace and inline a called method
functorch._dynamo.symbolic_convert.profile_inline_call(output:OutputGraph, code:types.CodeType, get_inline_depth:Callable[[], int]) -> Generator[None, None, None]
Context manager for profiling inline calls.
functorch._dynamo.testing.debug_insert_nops(frame:DynamoFrameType, cache_size:int, hooks:Any, _:Any, *skip:int=0) -> ConvertFrameReturn
used to debug jump updates
functorch._dynamo.testing.empty_line_normalizer(code:str) -> str
Normalize code: remove empty lines.
functorch._dynamo.trace_rules.add_module_init_func(name:str, init_func:Callable[[], None]) -> None
Register a module without eagerly importing it
functorch._dynamo.trace_rules.check_file(filename:str | None, is_inlined_call:bool=False) -> SkipResult
Should skip this file?
functorch._dynamo.trace_rules.get_skip_reason(obj:object) -> str
Compute a descriptive skip reason for a callable.
classtorch._dynamo.utils.ChromiumEventLogger
Logs chromium events to structured logs.
methodtorch._dynamo.utils.ChromiumEventLogger.get_outermost_event() -> str | None
Get the outermost event name (i.e.
methodtorch._dynamo.utils.ChromiumEventLogger.get_stack() -> list[str]
The main event stack, with every chromium event.
methodtorch._dynamo.utils.ChromiumEventLogger.increment(event_name:str, key:str, value:int) -> None
Increment an integer event data field by the given amount
methodtorch._dynamo.utils.ChromiumEventLogger.log_event_end(event_name:str, time_ns:int, metadata:dict[str, Any], start_time_ns:int, log_pt2_compile_event:bool, compile_id:CompileId | None=None) -> None
Logs the end of a single event.
methodtorch._dynamo.utils.ChromiumEventLogger.log_event_start(event_name:str, time_ns:int, metadata:dict[str, Any], log_pt2_compile_event:bool=False, compile_id:CompileId | None=None) -> None
Logs the start of a single event.
classtorch._dynamo.utils.CleanupHook
Remove a global variable when hook is called
classtorch._dynamo.utils.CompileEventLogger
Helper class for representing adding metadata(i.e.
methodtorch._dynamo.utils.CompileEventLogger.add_record_function_data(event_name:str, **metadata:object) -> None
Add record function data to the profiler event.
methodtorch._dynamo.utils.CompileEventLogger.add_toplevel(log_level:CompileEventLogLevel, overwrite:bool=False, **metadata:object) -> None
Syntactic sugar for logging to the toplevel event
methodtorch._dynamo.utils.CompileEventLogger.chromium(event_name:str, **metadata:object) -> None
Add <metadata> to <event_name> in chromium.
methodtorch._dynamo.utils.CompileEventLogger.compilation_metric(overwrite:bool=False, **metadata:object) -> None
Add <metadata> to the CompilationMetrics context.
methodtorch._dynamo.utils.CompileEventLogger.increment(event_name:str, log_level:CompileEventLogLevel, key:str, value:int) -> None
Increments an existing field, or adds it
methodtorch._dynamo.utils.CompileEventLogger.increment_toplevel(key:str, value:int=1, log_level:CompileEventLogLevel=CompileEventLogLevel.COMPILATION_METRIC) -> None
Increments a value on the toplevel metric.
classtorch._dynamo.utils.StripAnsiFormatter
Logging formatter that strips ANSI escape codes.
functorch._dynamo.utils.clone_input(x:torch.Tensor, *dtype:torch.dtype | None=None) -> torch.Tensor
copy while preserving strides
functorch._dynamo.utils.clone_tensor(x:torch.Tensor) -> torch.Tensor
Clone the tensor and its gradient
functorch._dynamo.utils.copy_dynamo_tensor_attributes(src:torch.Tensor, dst:torch.Tensor) -> None
Copy dynamo-specific tensor attributes from src to dst.
functorch._dynamo.utils.fqn(obj:Any) -> str
Returns the fully qualified name of the object.
functorch._dynamo.utils.get_instruction_source_311(code:types.CodeType, inst:Instruction) -> str
Python 3.11+ only.
functorch._dynamo.utils.import_submodule(mod:types.ModuleType) -> None
Ensure all the files in a given submodule are imported
functorch._dynamo.utils.is_pybind11_enum_member(value:object) -> bool
Check if value is a pybind11 enum member (with stable hash and eq).
functorch._dynamo.utils.is_torch_class(cls:type) -> bool
Check if cls is defined in torch or a torch submodule.
functorch._dynamo.utils.istensor(obj:Any) -> bool
Check of obj is a tensor
functorch._dynamo.utils.key_is_id(k:Any) -> TypeIs[torch.Tensor | torch.nn.Module | MethodWrapperType]
Returns whether it indexes dictionaries using its id
functorch._dynamo.utils.numpy_to_tensor(value:Any) -> Any
Convert tnp.ndarray to tensor, leave other types intact.
functorch._dynamo.utils.register_hook_for_recompile_user_context(hook:Callable[[], str]) -> None
Register a hook to be called when a recompile is triggered.
functorch._dynamo.utils.rmse(ref:torch.Tensor, res:torch.Tensor) -> torch.Tensor
Calculate root mean squared error
functorch._dynamo.utils.run_node(tracer:Any, node:torch.fx.Node, args:Any, kwargs:Any, nnmodule:Any) -> Any
Runs a given node, with the given args and kwargs.
functorch._dynamo.utils.set_feature_use(feature:str, usage:bool) -> None
Records whether we are using a feature Generally a feature is a JK.
functorch._dynamo.utils.to_numpy_helper(value:Any) -> Any
Convert tensor and tnp.ndarray to numpy.ndarray.
classtorch._dynamo.variables.base.GetSet
`tp_getset` entry, analogous to CPython's PyGetSetDef.
classtorch._dynamo.variables.base.Member
`tp_members` entry, analogous to CPython's PyMemberDef.
classtorch._dynamo.variables.base.MutationType
Base class for Variable.mutation_type.
classtorch._dynamo.variables.base.SlotGroup
A CPython slot group.
classtorch._dynamo.variables.base.ValueMutationNew
This case of VariableTracker.mutation_type marker indicates 1.
classtorch._dynamo.variables.builder.VariableBuilder
Wrap a python value in a VariableTracker() instance
classtorch._dynamo.variables.builtin.DictBuiltinVariable
Variable tracker for the `dict` builtin constructor.
classtorch._dynamo.variables.builtin.GetAttrBuiltinVariable
Variable tracker for the `getattr` builtin.
classtorch._dynamo.variables.builtin.HasAttrBuiltinVariable
Variable tracker for the `hasattr` builtin.
classtorch._dynamo.variables.builtin.IterBuiltinVariable
Variable tracker for the `iter` builtin.
classtorch._dynamo.variables.builtin.ListBuiltinVariable
Variable tracker for the `list` builtin constructor.
classtorch._dynamo.variables.builtin.SetAttrBuiltinVariable
Variable tracker for the `setattr` builtin.
classtorch._dynamo.variables.ctx_manager.AcceleratorDeviceIndexVariable
represents torch.accelerator.device_index
classtorch._dynamo.variables.ctx_manager.CUDADeviceVariable
represents torch.cuda.device
classtorch._dynamo.variables.ctx_manager.CatchWarningsCtxManagerVariable
Delay a call to warnings.catch_warnings
classtorch._dynamo.variables.ctx_manager.CudagraphOverrideVariable
represents torch._dynamo.override_cudagraphs
classtorch._dynamo.variables.ctx_manager.DynamoConfigPatchVariable
represents torch._dynamo.patch_dynamo_config
classtorch._dynamo.variables.ctx_manager.ErrorOnGraphBreakVariable
represents torch._dynamo.error_on_graph_break
classtorch._dynamo.variables.ctx_manager.GradInplaceRequiresGradCtxManagerVariable
represents torch grad requires grad
classtorch._dynamo.variables.ctx_manager.GradModeVariable
represents torch.{no_grad,enable_grad,set_grad_mode}()
classtorch._dynamo.variables.ctx_manager.NullContextVariable
This class represents Python contextlib.nullcontext.
classtorch._dynamo.variables.ctx_manager.SDPAKernelVariable
represents torch.nn.attention.sdpa_kernel
classtorch._dynamo.variables.ctx_manager.XPUDeviceVariable
represents torch.xpu.device
classtorch._dynamo.variables.dicts.DictViewVariable
Models _PyDictViewObject This is an "abstract" class.
methodtorch._dynamo.variables.dicts.DictViewVariable.sq_length(tx:'InstructionTranslatorBase') -> VariableTracker
Sequence length for dict view objects.
classtorch._dynamo.variables.dicts.DunderDictVariable
represents object.__dict__
classtorch._dynamo.variables.functions.BoundBuiltinMethodVariable
Bound builtin_function_or_method (PyCFunction_Type).
classtorch._dynamo.variables.functions.ClassMethodVariable
classmethod descriptor wrapping a callable.
classtorch._dynamo.variables.functions.ContextlibContextManagerLocalGeneratorObjectVariable
..
classtorch._dynamo.variables.functions.FunctionDecoratedByContextlibContextManagerVariable
..
classtorch._dynamo.variables.functions.LocalGeneratorFunctionVariable
functions that behaves like iterators ..
classtorch._dynamo.variables.functions.PropertyVariable
Python property descriptor.
classtorch._dynamo.variables.functions.StaticMethodVariable
staticmethod descriptor wrapping a callable.
classtorch._dynamo.variables.functions.UserFunctionVariable
Some unsupported user-defined global function
classtorch._dynamo.variables.functions.UserMethodVariable
Some unsupported user-defined method
classtorch._dynamo.variables.higher_order_ops.SubgraphTracingInfo
Properties observed during subgraph tracing.
functorch._dynamo.variables.higher_order_ops.get_tensor_storages(tensor:torch.Tensor) -> set[StorageWeakRef]
Get storage references from a tensor.
classtorch._dynamo.variables.invoke_subgraph.LiftedCapturedSource
Lifted arg that is a captured variable (e.g.
functorch._dynamo.variables.invoke_subgraph.classify_vt(vt:Any) -> InputTag | None
Return the tag for a leaf VT, or None if unsupported.
functorch._dynamo.variables.invoke_subgraph.get_flat_proxies(fingerprint:InputFingerprint) -> list[Proxy]
Collect deduplicated proxies from tensor/symnode leaves.
functorch._dynamo.variables.invoke_subgraph.sym_num_key(sym_num:Any) -> Any
Key for matching a symbolic input against a cached one.
classtorch._dynamo.variables.iter.FilterVariable
Represents filter(fn, iterable)
classtorch._dynamo.variables.iter.MapVariable
Represents map(fn, *iterables)
classtorch._dynamo.variables.iter.ZipVariable
Represents zip(*iterables)
classtorch._dynamo.variables.lazy.ComputedLazyConstantVariable
Result of a supported op over lazy constant operands.
classtorch._dynamo.variables.lazy.LazyCache
Container to cache the real VariableTracker
methodtorch._dynamo.variables.lazy.LazyVariableTracker.realize() -> VariableTracker
Force construction of the real VariableTracker
classtorch._dynamo.variables.lists.SizeVariable
torch.Size(...)
classtorch._dynamo.variables.memory.CUDAMemPoolVariable
Represents a torch.cuda.MemPool object.
classtorch._dynamo.variables.misc.AutogradEngineVariable
Represents a torch._C._ImperativeEngine instance.
classtorch._dynamo.variables.misc.AutogradFunctionVariable
represents a torch.autograd.Function subclass
classtorch._dynamo.variables.misc.CallMethodVariable
A method bound to a VT instance.
classtorch._dynamo.variables.misc.ConstantLikeVariable
self.value is a compile-time constant, but not a literal
classtorch._dynamo.variables.misc.ContextVarVariable
Wraps a contextvars.ContextVar for Dynamo tracing.
classtorch._dynamo.variables.misc.DeletedVariable
Marker used to implement delattr()
classtorch._dynamo.variables.misc.LoggingLoggerVariable
Represents a call to any logging.Logger methods.
classtorch._dynamo.variables.misc.NumpyVariable
Wrapper around `numpy.*`.
classtorch._dynamo.variables.misc.RandomClassVariable
random.Random
classtorch._dynamo.variables.misc.UnknownVariable
It could be anything!
classtorch._dynamo.variables.nn_module.UnspecializedBuiltinNNModuleVariable
Differentiates between builtin nn modules (e.g.
functorch._dynamo.variables.object_protocol.generic_hash_impl(tx:'InstructionTranslatorBase', obj:VariableTracker) -> tuple[int, bool]
Internal API: compute hash as (value, is_fake).
functorch._dynamo.variables.object_protocol.generic_is_true(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyObject_IsTrue.
functorch._dynamo.variables.object_protocol.generic_richcompare(tx:'InstructionTranslatorBase', v:VariableTracker, w:VariableTracker, op:str) -> VariableTracker
Dynamo's do_richcompare.
functorch._dynamo.variables.object_protocol.generic_str(tx:'InstructionTranslatorBase', obj:'VariableTracker') -> 'VariableTracker'
Mirrors PyObject_Str semantics in Dynamo.
functorch._dynamo.variables.object_protocol.mro_lookup(py_type:type, name:str) -> object
Walk py_type.__mro__ to find *name* in the class hierarchy.
functorch._dynamo.variables.object_protocol.object_generic_getattr(tx:'InstructionTranslatorBase', obj:VariableTracker, name:str) -> VariableTracker
Dynamo's PyObject_GenericGetAttr.
functorch._dynamo.variables.object_protocol.object_richcompare(self:VariableTracker, tx:'InstructionTranslatorBase', other:VariableTracker, op:str) -> VariableTracker
object's tp_richcompare.
functorch._dynamo.variables.object_protocol.pycallable_check(obj_type:type) -> bool
Implements PyCallable_Check: type(x)->tp_call != NULL.
functorch._dynamo.variables.object_protocol.pyindex_check(obj_type:type) -> bool
Implements _PyIndex_Check semantics for VariableTracker objects.
functorch._dynamo.variables.object_protocol.pynumber_absolute(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Absolute.
functorch._dynamo.variables.object_protocol.pynumber_float(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Float (float(x) dispatch).
functorch._dynamo.variables.object_protocol.pynumber_index(tx:'InstructionTranslatorBase', obj:VariableTracker) -> 'VariableTracker'
Mirrors PyNumber_Index (index(x) dispatch).
functorch._dynamo.variables.object_protocol.pynumber_inplace_multiply(tx:'InstructionTranslatorBase', v:VariableTracker, w:VariableTracker) -> VariableTracker
Mirrors CPython's PyNumber_InPlaceMultiply.
functorch._dynamo.variables.object_protocol.pynumber_int(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Long (int(x) dispatch).
functorch._dynamo.variables.object_protocol.pynumber_invert(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Invert.
functorch._dynamo.variables.object_protocol.pynumber_matrix_multiply(tx:'InstructionTranslatorBase', v:VariableTracker, w:VariableTracker) -> VariableTracker
Mirrors CPython's PyNumber_MatrixMultiply.
functorch._dynamo.variables.object_protocol.pynumber_multiply(tx:'InstructionTranslatorBase', v:VariableTracker, w:VariableTracker) -> VariableTracker
Mirrors CPython's PyNumber_Multiply.
functorch._dynamo.variables.object_protocol.pynumber_negative(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Negative.
functorch._dynamo.variables.object_protocol.pynumber_positive(tx:'InstructionTranslatorBase', obj:VariableTracker) -> VariableTracker
Mirrors PyNumber_Positive.
functorch._dynamo.variables.object_protocol.pysequence_inplace_repeat(tx:'InstructionTranslatorBase', seq:VariableTracker, n:VariableTracker) -> VariableTracker
pysequence_repeat using sq_inplace_repeat.
functorch._dynamo.variables.object_protocol.pysequence_repeat(tx:'InstructionTranslatorBase', seq:VariableTracker, n:VariableTracker) -> VariableTracker
Mirrors CPython's sequence_repeat helper.
functorch._dynamo.variables.object_protocol.slot_wrapper_iadd(tx:'InstructionTranslatorBase', self:VariableTracker, other:VariableTracker) -> VariableTracker
``self.__iadd__(other)`` slot wrapper.
functorch._dynamo.variables.object_protocol.slot_wrapper_imul(tx:'InstructionTranslatorBase', self:VariableTracker, other:VariableTracker) -> VariableTracker
``self.__imul__(other)`` slot wrapper.
functorch._dynamo.variables.object_protocol.type_implements_mp_slot(obj_type:type, slot:int) -> bool
Check whether obj_type implements the given mp slot.
functorch._dynamo.variables.object_protocol.type_implements_nb_slot(obj_type:type, slot:int) -> bool
Check whether obj_type implements the nb slot.
functorch._dynamo.variables.object_protocol.type_implements_sq_slot(obj_type:type, slot:int) -> bool
Check whether obj_type implements the given sq slot.
functorch._dynamo.variables.object_protocol.type_implements_tp_call(obj_type:type) -> bool
Check whether obj_type implements the tp_call slot.
functorch._dynamo.variables.object_protocol.type_implements_tp_repr(obj_type:type) -> bool
Check whether obj_type implements the tp_repr slot.
functorch._dynamo.variables.object_protocol.type_implements_tp_str(obj_type:type) -> bool
Check whether obj_type implements the tp_str slot.
functorch._dynamo.variables.object_protocol.vt_is_iterable(obj:VariableTracker) -> bool
Check if the object supports iteration (i.e.
classtorch._dynamo.variables.sets.SetVariable
Represents a Python set during symbolic execution.
functorch._dynamo.variables.sets.set_copy(obj:VariableTracker) -> VariableTracker
Mirrors CPython's internal `set_copy` (Objects/setobject.c).
classtorch._dynamo.variables.streams.StreamContextVariable
This represents torch.cuda.StreamContext
classtorch._dynamo.variables.streams.StreamVariable
Represents the device-agnostic torch.Stream class
classtorch._dynamo.variables.streams.SymbolicStreamState
Track the currently entered stream if any
classtorch._dynamo.variables.tensor.SymNodeVariable
Represents a symbolic scalar, either int, float or bool.
classtorch._dynamo.variables.torch.DispatchKeySetVariable
represents torch.DispatchKeySet
classtorch._dynamo.variables.user_defined.DefaultDictVariable
Represents collections.defaultdict instances.
classtorch._dynamo.variables.user_defined.UserDefinedObjectVariable
Mostly objects of defined type.
classtorch._export.ExportDynamoConfig
Manage Export-specific configurations of Dynamo.
classtorch._export.converter.ExplainTS2FXGraphConverter
Run TS2FXGraphConverter in an explain mode.
functorch._export.converter.ir_name_to_func_name(name:str) -> str
prim::If -> convert_prim_If
functorch._export.db.case.register_db_case(case:ExportCase) -> None
Registers a user provided ExportCase into example bank.
classtorch._export.error.InternalError
Raised when an internal invariance is violated in EXIR stack.
functorch._export.error.internal_assert(pred:bool, assert_msg:str) -> None
This is exir's custom assert method.
functorch._export.non_strict_utils.key_path_to_source(kp:KeyPath, sourced_prefixes:_KeyPathTrie | None=None) -> Source
Given a key path, return the source for the key path.
classtorch._export.serde.dynamic_shapes.DynamicShapesSpec
This stores a dynamic_shapes spec for de/serialization.
classtorch._export.serde.dynamic_shapes.RootDim
This represents a Dim object.
classtorch._export.serde.serialize.ExtensionHandler
Base class for handling extension operators.
functorch._export.serde.serialize.serialize_tensor_meta(t:torch.Tensor) -> TensorMeta
Extract a TensorMeta describing `t`.
functorch._export.utils.is_buffer(program:'ExportedProgram', node:torch.fx.Node) -> bool
Checks if the given node is a buffer within the exported program
functorch._export.utils.node_replace_(old_node:torch.fx.Node, new_node:torch.fx.Node) -> None
Replace all uses of old_node with new_node.
functorch._export.utils.wrap_method(method:Callable[..., object]) -> _WrappedMethod
Wrap a method as a module so that it can be exported.
classtorch._functorch._aot_autograd.aot_autograd_result.CompiledBackward
Cacheable entry for a backward function
classtorch._functorch._aot_autograd.aot_autograd_result.CompiledForward
Cacheable entry for a forward function
classtorch._functorch._aot_autograd.aot_autograd_result.InductorOutput
Class representing a single inductor output
classtorch._functorch._aot_autograd.autograd_cache.AOTAutogradCache
Caches the results of running AOTAutograd.
methodtorch._functorch._aot_autograd.autograd_cache.AOTAutogradCache.clear() -> None
Clear the cache
methodtorch._functorch._aot_autograd.autograd_cache.AOTAutogradCache.save(key:str, entry:GenericAOTAutogradResult[Any, Any], remote:bool) -> None
Save a single entry into the cache.
functorch._functorch._aot_autograd.autograd_cache.check_cacheable(gm:torch.fx.GraphModule) -> None
Checks that the graph module only uses supported operators
functorch._functorch._aot_autograd.autograd_cache.check_node_safe(node:Node) -> None
Checks that the node only uses supported operators.
functorch._functorch._aot_autograd.autograd_cache.is_safe_torch_function(target:Callable[..., Any]) -> bool
Allowlisted torch functions
classtorch._functorch._aot_autograd.descriptors.BufferAOTInput
The input is a buffer, whose FQN is target
classtorch._functorch._aot_autograd.descriptors.ParamAOTInput
The input is a parameter, whose FQN is target
functorch._functorch._aot_autograd.fx_utils.get_buffer_nodes(graph:fx.Graph) -> list[fx.Node]
Get all buffer nodes from a graph as a list.
functorch._functorch._aot_autograd.fx_utils.get_named_buffer_nodes(graph:fx.Graph) -> dict[str, fx.Node]
Get buffer nodes mapped by their fully qualified names.
functorch._functorch._aot_autograd.fx_utils.get_named_param_nodes(graph:fx.Graph) -> dict[str, fx.Node]
Get parameter nodes mapped by their fully qualified names.
functorch._functorch._aot_autograd.fx_utils.get_param_nodes(graph:fx.Graph) -> list[fx.Node]
Get all parameter nodes from a graph as a list.
functorch._functorch._aot_autograd.graph_compile.aot_stage2_autograd(aot_state:AOTState, aot_graph_capture:AOTGraphCapture, partition_fn:Callable, fw_compiler:Callable, bw_compiler:Callable) -> DispatchReturn
Autograd logic.
functorch._functorch._aot_autograd.logging_utils.get_aot_graph_name() -> str
Returns the name of the graph being compiled.
classtorch._functorch._aot_autograd.schemas.AOTConfig
Configuration for AOTDispatcher
classtorch._functorch._aot_autograd.schemas.GraphSignature
Provides information about an exported module.
classtorch._functorch._aot_autograd.schemas.SubclassCreationMeta
Used for AOTDispatch.
functorch._functorch._aot_autograd.streams.assign_backward_streams(gm:torch.fx.GraphModule) -> None
Assigns backward streams to gradient accumulation nodes
functorch._functorch._aot_autograd.streams.wrap_all_sync_nodes_with_control_deps(gm:torch.fx.GraphModule) -> None
Single-pass wrap of all sync nodes in control_deps.
functorch._functorch._aot_autograd.utils.get_default_generator(device:torch.device) -> Any
Get the default RNG generator for a device.
functorch._functorch._aot_autograd.utils.get_device_rng_state(device:torch.device) -> torch.Tensor
Get the RNG state tensor for a device.
functorch._functorch._aot_autograd.utils.import_async_collective_tensor_type() -> type['AsyncCollectiveTensor']
Import and return the ACT type.
functorch._functorch._aot_autograd.utils.supports_graphsafe_rng(device:torch.device) -> bool
Check whether a device supports graphsafe RNG operations.
functorch._functorch.compilers.nop(fx_g:fx.GraphModule, _:Any) -> fx.GraphModule
Returns the :attr:`fx_g` Fx graph module as it is.
functorch._functorch.compilers.ts_compile(fx_g:fx.GraphModule, inps:Sequence[Any]) -> torch.jit.ScriptModule
Compiles the :attr:`fx_g` with Torchscript compiler.
functorch._functorch.eager_transforms.debug_unwrap(tensor:torch.Tensor, *recurse:bool=True) -> torch.Tensor
Unwraps a functorch tensor (e.g.
classtorch._functorch.partitioners.OpTypes
Class for keeping track of different operator categories
functorch._functorch.partitioners.calculate_range(dtype:torch.dtype) -> tuple[float, float]
Calculate the range of values for a given torch.dtype.
functorch._functorch.partitioners.calculate_tensor_size(tensor:torch.Tensor) -> float
Calculate the size of a PyTorch tensor in megabytes (MB).
functorch._functorch.partitioners.get_node_weight(node:fx.Node, static_lifetime_input_nodes:OrderedSet[fx.Node]) -> tuple[float, str | None]
Returns (weight, cannot_save_reason).
functorch._functorch.partitioners.visualize_min_cut_graph(nx_graph:nx.DiGraph[str, dict[str, Any]]) -> tuple[str | None, str | None]
Visualize the min-cut graph to an SVG file.
classtorch._guards.InlinedCodeCache
Cache for code-object-derived data used during inlining.
methodtorch._guards.Source.reconstruct_pycode(codegen:PyCodegen) -> str
Reconstructs the source into a string of Python code.
methodtorch._guards.Source.subguards_allowed() -> bool
True if you can guard on attributes of this
classtorch._guards.TracingContext
Provides the currently installed TracingContext, or None.
functorch._guards.detect_fake_mode(inputs:Any=None) -> FakeTensorMode | None
Attempts to "detect" what the current fake mode is.
functorch._higher_order_ops.cond.cond(pred:bool | int | float | torch.Tensor, true_fn:Callable, false_fn:Callable, operands:tuple | list=()) -> Any
Conditionally applies `true_fn` or `false_fn`.
functorch._higher_order_ops.flat_apply.from_graphable(flat_args:tuple[Unpack[_Ts]], spec:pytree.TreeSpec) -> pytree.PyTree
The inverse of to_graphable.
functorch._higher_order_ops.flat_apply.is_graphable_type(typ:type[object]) -> bool
Return whether the given type is graphable.
functorch._higher_order_ops.flat_apply.to_graphable(stuff:pytree.PyTree) -> tuple[list[object], pytree.TreeSpec]
Flattens stuff into a flat list of graphable types.
classtorch._higher_order_ops.flex_gemm.FlexGemmOpSpec
Canonical operand positions for a supported FlexGEMM op.
functorch._higher_order_ops.flex_gemm.flex_gemm_fast_math_sigmoid(x:torch.Tensor) -> torch.Tensor
Use the tanh sigmoid identity selected by QUACK fast math.
functorch._higher_order_ops.flex_gemm.flex_gemm_fast_math_silu(x:torch.Tensor) -> torch.Tensor
Use the tanh SiLU identity selected by QUACK fast math.
classtorch._higher_order_ops.invoke_subgraph.InvokeSubgraphAutogradOp
Saves the subgraph, i.e.
functorch._higher_order_ops.map.map(f:Callable[[pytree.PyTree, tuple[pytree.PyTree, ...]], pytree.PyTree], xs:pytree.PyTree | torch.Tensor, *args:TypeVarTuple)
Performs a map of f with xs.
classtorch._higher_order_ops.register_hook.RegisterHookOp
HOP that registers a backward hook on a tensor.
classtorch._higher_order_ops.triton_kernel_wrap.ReadWriteIndexes
Return the argument indexes read / written.
functorch._higher_order_ops.triton_kernel_wrap.first_arg(op:Op) -> list[int]
Return the first argument index after checking that it exists.
functorch._higher_order_ops.triton_kernel_wrap.unregister_kernel_access_op(name:str) -> None
Unregister a Triton op from kernel read/write analysis.
functorch._higher_order_ops.utils.query_requires_grad(t:torch.Tensor) -> bool
requires_grad of ``t``, looking through a functional wrapper.
methodtorch._higher_order_ops.wrap.InductorCodeSideTable.add_callable(callable_obj:InductorCompiledCallable) -> int
Register a callable and return its idx.
methodtorch._higher_order_ops.wrap.InductorCodeSideTable.get_callable(idx:int) -> InductorCompiledCallable
Get the callable at the given index.
methodtorch._higher_order_ops.wrap.InductorCodeSideTable.reset_table() -> None
Reset the table.
classtorch._higher_order_ops.wrap.WrapActivationCheckpoint
This operator is used to wrap torch.utils.checkpoint.
classtorch._inductor.analysis.device_info.DeviceInfo
Theoretical numbers from data sheet.
functorch._inductor.analysis.profile_analysis.main() -> None
Main function for the profile analysis script.
functorch._inductor.analyze_preserves_zero_mask.prologue_preserves_zero_mask(prologue:'SchedulerNode') -> bool
Does this prologue preserve zero masks
functorch._inductor.aoti_load_package(path:FileLike, run_single_threaded:bool=False, device_index:int=-1) -> AOTICompiledModel
Loads the model from the PT2 package.
classtorch._inductor.async_compile.CompiledTritonKernels
In memory cache for storing compiled triton kernels.
functorch._inductor.async_compile.get_compile_threads() -> int
Temporary for internal rollout.
functorch._inductor.async_compile.shutdown_compile_workers() -> None
Shut down all outstanding compile-worker pools.
classtorch._inductor.autotune_process.BenchmarkRequest
Only handle triton template benchmark for now.
classtorch._inductor.autotune_process.CUTLASSBenchmarkRequest
A class to handle CUDA (CUTLASS) benchmark requests.
classtorch._inductor.autotune_process.ExternKernelBenchmarkRequest
A class to handle extern kernel benchmark requests.
classtorch._inductor.autotune_process.PrecompileThreadPool
Thread pool for running precompilation asynchronously.
classtorch._inductor.autotune_process.SubgraphBenchmarkRequest
Benchmark request for subgraph choices.
functorch._inductor.autotune_process.run_autotune_in_subprocess(benchmark_request:BenchmarkRequest) -> float
Run autotuning benchmarks in a subprocess.
functorch._inductor.autows_utils.has_meta_ws() -> bool
Whether Meta Triton autoWS is available.
classtorch._inductor.cache.AsyncCache
Asynchronous cache implementation using ThreadPoolExecutor.
methodtorch._inductor.cache.AsyncCache.get_async(key:Key, executor:ThreadPoolExecutor) -> Future[Value | None]
Retrieve a value from the cache asynchronously.
methodtorch._inductor.cache.AsyncCache.insert_async(key:Key, value:Value, executor:ThreadPoolExecutor) -> Future[bool]
Insert a value into the cache asynchronously.
classtorch._inductor.cache.Cache
Abstract base class for cache implementations.
methodtorch._inductor.cache.Cache.get(key:Key) -> Value | None
Retrieve a value from the cache.
methodtorch._inductor.cache.Cache.insert(key:Key, value:Value) -> bool
Insert a value into the cache.
classtorch._inductor.cache.CacheError
Exception raised for errors encountered during cache operations.
methodtorch._inductor.cache.InMemoryCache.from_env_var(env_var:str) -> Self
Create an in-memory cache from an environment variable.
methodtorch._inductor.cache.InMemoryCache.from_file_path(fpath:Path) -> Self
Create an in-memory cache from a file path.
methodtorch._inductor.cache.InMemoryCache.get(key:Key) -> Value | None
Retrieve a value from the cache.
methodtorch._inductor.cache.InMemoryCache.insert(key:Key, value:Value) -> bool
Insert a value into the cache.
classtorch._inductor.cache.InductorOnDiskCache
Inductor-specific on-disk cache implementation.
methodtorch._inductor.cache.InductorOnDiskCache.base_dir() -> Path
Get the base directory for the Inductor cache.
classtorch._inductor.cache.OnDiskCache
On-disk cache implementation using files and file locks.
methodtorch._inductor.cache.OnDiskCache.base_dir() -> Path
Get the base directory for the cache.
methodtorch._inductor.cache.OnDiskCache.get(key:Key) -> Value | None
Retrieve a value from the cache.
methodtorch._inductor.cache.OnDiskCache.insert(key:Key, value:Value) -> bool
Insert a value into the cache.
methodtorch._inductor.cache.OnDiskCache.version_prefix() -> bytes
Get the version prefix for the cache.
classtorch._inductor.choices.Sortable
Anything that can be used as a list.sort() key (int/tuple/etc)
classtorch._inductor.codecache.AotCodeCompiler
Compile AOT Inductor generated code.
classtorch._inductor.codecache.CppCodeCache
Compiles and caches C++ libraries.

この情報について

掲載しているシグネチャは pytorch/pytorch の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る