Skip to content

Commit

Permalink
[docs] cosmetic changes of thunder.dynamo.ThunderCompiler docstring (
Browse files Browse the repository at this point in the history
  • Loading branch information
crcrpar authored Dec 9, 2024
1 parent 21929d8 commit 087637f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions thunder/dynamo/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 087637f

Please sign in to comment.