thunder.recipes.BaseRecipe¶
- class thunder.recipes.BaseRecipe(show_progress=False, fuser='nvfuser', interpreter='thunder.jit', plugins=None)[source]¶
Bases:
RecipeCompilation 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_namesso 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.
Methods
__init__([show_progress, fuser, ...])add_plugins(plugins)apply(model)get_for_model(model)register(key)Build the per-run configuration dictionary.
Resolves executor names to concrete
Executorobjects.Reconciles the requested fusion backend with
self.executor_names.setup_lookasides()Constructs the list of graph-level transforms.
validate(model)- setup_executors()[source]¶
Resolves executor names to concrete
Executorobjects.- Returns:
Instantiated executors in the order given by
self.executor_names.- Return type:
- Raises:
TypeError – If
self.executor_namesis not a list.ValueError – If a non-nvfuser executor cannot be found.
- setup_fuser()[source]¶
Reconciles the requested fusion backend with
self.executor_names.- Raises:
NotImplementedError – If fuser is not
"nvfuser"or"torch.compile".- Return type: