---
title: thunder.recipes.BaseRecipe
description: >-
  Compilation recipe with Thunder defaults. The recipe wires a set of executors,
  transforms

  and debug options, while providing a single switch to pick the

  fusion backend (“nvfuser” or “torch.compile”). 
canonical: >-
  https://lightning.ai/docs/thunder/stable/api-reference/generated/thunder.recipes.BaseRecipe
---
# thunder.recipes.BaseRecipe {#thunder-recipes-baserecipe}

### `class thunder.recipes.BaseRecipe(show_progress=False, fuser='nvfuser', interpreter='thunder.jit', plugins=None)` {#thunder.recipes.BaseRecipe}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L51-L165)

Bases: `Recipe`

Compilation recipe with Thunder defaults. The recipe wires a set of executors, transforms and debug options, while providing a single switch to pick the fusion backend (“nvfuser” or “torch.compile”). Should be used as a template to extend.

Parameters:

*   **show\_progress** – bool, default False Print interpreter-side progress bars.
    
*   **fuser** – {“nvfuser”, “torch.compile”}, default “nvfuser” Fusion backend to register. Adjusts `self.executor_names` so the chosen backend is present and any mutually-exclusive one is removed.
    
*   **interpreter** – str, default “thunder.jit” Interpreter identifier forwarded to `Recipe`.
    
*   **plugins** – Iterable | None Extra Thunder plugins to enable.
    

#### `__init__(show_progress=False, fuser='nvfuser', interpreter='thunder.jit', plugins=None)` {#thunder.recipes.BaseRecipe.__init__}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L70-L88)

Methods

- [`__init__([show_progress, fuser, ...])`](#thunder.recipes.BaseRecipe.__init__)
- `add_plugins(plugins)`
- `apply(model)`
- `get_for_model(model)`
- `register(key)`
- [`setup_config()`](#thunder.recipes.BaseRecipe.setup_config) — Build the per-run configuration dictionary.
- [`setup_executors()`](#thunder.recipes.BaseRecipe.setup_executors) — Resolves executor names to concrete Executor objects.
- [`setup_fuser()`](#thunder.recipes.BaseRecipe.setup_fuser) — Reconciles the requested fusion backend with self.executor_names.
- `setup_lookasides()` — rtype:Optional[list[Lookaside]]
- [`setup_transforms()`](#thunder.recipes.BaseRecipe.setup_transforms) — Constructs the list of graph-level transforms.
- `validate(model)`

#### `setup_config()` {#thunder.recipes.BaseRecipe.setup_config}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L90-L101)

Build the per-run configuration dictionary.

Returns:

`{}` when `show_progress` is _False_; otherwise `{"debug_options": DebugOptions(show_interpreter_progress=True)}`.

Return type:

[dict](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), Any\]

#### `setup_executors()` {#thunder.recipes.BaseRecipe.setup_executors}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L133-L165)

Resolves executor names to concrete `Executor` objects.

Returns:

Instantiated executors in the order given by `self.executor_names`.

Return type:

[list](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[Executor](/docs/thunder/extend/thunder.extend.Executor#thunder.extend.Executor "thunder.extend.Executor")\]

Raises:

*   [**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError "(in Python v3.15)") – If `self.executor_names` is not a list.
    
*   [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If a non-nvfuser executor cannot be found.
    

#### `setup_fuser()` {#thunder.recipes.BaseRecipe.setup_fuser}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L114-L131)

Reconciles the requested fusion backend with `self.executor_names`.

Raises:

[**NotImplementedError**](https://docs.python.org/3/builtins/exceptions.html#NotImplementedError "(in Python v3.15)") – If _fuser_ is not `"nvfuser"` or `"torch.compile"`.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `setup_transforms()` {#thunder.recipes.BaseRecipe.setup_transforms}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/recipes/base.py#L103-L112)

Constructs the list of graph-level transforms.

Returns:

Currently `[PrunePrologueChecks()]`; extend as needed.

Return type:

[list](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[Transform\]

---

**Navigation**

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