diff --git a/thunder/dynamo/compiler.py b/thunder/dynamo/compiler.py index 6168f863d0..c7958be9b1 100644 --- a/thunder/dynamo/compiler.py +++ b/thunder/dynamo/compiler.py @@ -33,7 +33,7 @@ def __init__(self, **thunder_options): Keyword arguments: thunder_options: a dictionary of options to pass to :func:`thunder.jit`. Besides all the arguments to :func:`thunder.jit`, - it accepts `torch_inductor_options` which are passed to `torch.compile` if part of the graph + it accepts ``torch_inductor_options`` which are passed to :func:`torch.compile` if part of the graph is not supported by thunder. Example: @@ -88,18 +88,17 @@ def __call__(self, gm: torch.fx.GraphModule, sample_args: list[torch.SymInt, tor def save_reproducer_to_folder(self, reproducer_folder: str | PathLike, use_pytest_benchmark: bool = False): """ - Save the reproducer script for the GraphModule executed by Thunder to the specified `reproducer_folder`. + Save the reproducer script for the GraphModule executed by Thunder to the specified ``reproducer_folder``. Each saved script is named as "graph[graph_id]_thunder_[module_id]", where: - - `graph_id` indexes the graph generated by Dynamo, which is then passed to Thunder. - - `module_id` indexes the submodule split by the :func:`thunder.dynamo.utils._splitter`. + - ``graph_id`` indexes the graph generated by Dynamo, which is then passed to Thunder. + - ``module_id`` indexes the submodule split by the :func:`thunder.dynamo.utils._splitter`. Args: - reproducer_folder (str | PathLike): The folder where the reproducer code will be written. Can be specified as an absolute or relative path. - use_pytest_benchmark (str): Determines the type of script to create: - - - If use_pytest_benchmark=False: Creates a reproducer script. - - If use_pytest_benchmark=True: Creates a benchmark script to compare the reproducer's performance with other backends, including Torch eager, torch.compile, and torch.compile with `backend="eager"`. + reproducer_folder: The folder where the reproducer code will be written. Can be specified as an absolute or relative path. + use_pytest_benchmark: Determines the type of script to create. When :obj:`False`, create a reproducer script. + Otherwise, creats a benchmark script to compare the reproducer's performance with other backends, including Torch eager, torch.compile, + and torch.compile with ``backend="eager"``. """ if not self.subgraph_infos: raise TypeError(f"{self} doesn't seem to have been called yet.")