torch.compiler API reference#
Created On: Jun 02, 2023 | Last Updated On: Jun 22, 2025
For a quick overview of torch.compiler
, see torch.compiler.
See |
|
This function clears all compilation caches and restores the system to its initial state. |
|
Tells the compiler frontend (Dynamo) to skip symbolic introspection of the function and instead directly write it to the graph when encountered. |
|
Register a polyfill handler for a function, usually a C function from the C extension, to be used in place of the original function when inlining the original function in the graph. |
|
This function is used to mark a function fn as having a constant result. |
|
Return valid strings that can be passed to torch.compile(..., backend="name"). |
|
This function provides a decorator to disable compilation on a function. |
|
Set the current stance of the compiler. |
|
Enables use of collectives during guard evaluation to synchronize behavior across ranks. |
|
Indicates that a new iteration of inference or training is about to begin. |
|
Indicates whether a graph is executed/traced as part of torch.compile() or torch.export(). |
|
Indicates whether a graph is traced via TorchDynamo. |
|
Indicated whether we're under exporting. |
|
A common function to skip guards on the inbuilt nn modules like torch.nn.Linear. |
|
A common function to skip guards on all nn modules, both user defined as well inbuilt nn modules (like torch.nn.Linear). |
|
A common function to keep tensor guards on all tensors. |
|
A common function to skip guards on all globals. |
|
Tells ``torch.compile`` that the marked set of operations forms a nested compile region (which is often repeated in the full model) whose code can be compiled once and safely reused. |