---
title: thunder.executors.torch_compile.TorchCompileExecutor
description: Fusion executor using torch.compile as the backend.
canonical: >-
  https://lightning.ai/docs/thunder/stable/api-reference/generated/thunder.executors.torch_compile.TorchCompileExecutor
---
# thunder.executors.torch_compile.TorchCompileExecutor {#thunder-executors-torch-compile-torchcompileexecutor}

### `class thunder.executors.torch_compile.TorchCompileExecutor(name, required_ops=None, *, mode=None)` {#thunder.executors.torch_compile.TorchCompileExecutor}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/executors/torch_compile.py#L100-L185)

Bases: `FusionExecutor`

Fusion executor using torch.compile as the backend.

Parameters:

*   **name** ([`Hashable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable "(in Python v3.15)")) – unique name of the executor
    
*   **required\_ops** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`set`](https://docs.python.org/3/builtins/stdtypes.html#set "(in Python v3.15)")\]) – set of syms to fuse
    
*   **mode** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ _optional_) –
    
*   **name** ([_Hashable_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable "(in Python v3.15)")) –
    
*   **required\_ops** ([_set_](https://docs.python.org/3/builtins/stdtypes.html#set "(in Python v3.15)") _|_ _None_) –
    
*   **mode** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_) –
    

#### `__init__(name, required_ops=None, *, mode=None)` {#thunder.executors.torch_compile.TorchCompileExecutor.__init__}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/executors/torch_compile.py#L109-L112)

Parameters:

*   **name** ([_Hashable_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable "(in Python v3.15)")) –
    
*   **required\_ops** ([_Optional_](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")_\[_[_set_](https://docs.python.org/3/builtins/stdtypes.html#set "(in Python v3.15)")_\]_) –
    
*   **mode** ([_Optional_](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_) –
    

Methods

- [`__init__(name[, required_ops, mode])`](#thunder.executors.torch_compile.TorchCompileExecutor.__init__)
- `can_execute(bsym)` — rtype:bool
- `can_execute_or_fuse(bsym)` — rtype:bool
- `can_fuse(bsym)` — rtype:bool
- `fuse(region, fusion_counter)` — rtype:BoundSymbol
- `fusion_pass(trace)` — rtype:TraceCtx
- `get_execution_transform(bsym)` — rtype:Optional[Callable]
- `get_fuel([amount])` — rtype:bool
- `get_grad_transform(sym)` — rtype:Optional[Callable]
- `register_operator(name, *[, like, meta, ...])` — rtype:Symbol
- `register_supported(sym_or_id[, checker, ...])`
- `register_temporary_operation(name, fn, *, ...)` — rtype:BoundSymbol
- `set_fuel(value)`

Attributes

- `implmap`
- `name`
- `opmap`
- `version`

---

**Navigation**

- Parent: [Generated](/docs/thunder/0.2.6/api-reference/generated.md)
