Home / Function/ _run_torchbench_from_args() — pytorch Function Reference

_run_torchbench_from_args() — pytorch Function Reference

Architecture documentation for the _run_torchbench_from_args() function in cachebench.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  0888c17f_2107_6a74_1c6a_de217ecb2d2a["_run_torchbench_from_args()"]
  e689bf38_d776_1fe3_5224_2226c424159c["_run_torchbench_model()"]
  e689bf38_d776_1fe3_5224_2226c424159c -->|calls| 0888c17f_2107_6a74_1c6a_de217ecb2d2a
  a0be0909_592c_396f_91d6_4ab57192f40a["get_compile_time()"]
  0888c17f_2107_6a74_1c6a_de217ecb2d2a -->|calls| a0be0909_592c_396f_91d6_4ab57192f40a
  style 0888c17f_2107_6a74_1c6a_de217ecb2d2a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/cachebench.py lines 55–79

def _run_torchbench_from_args(
    cmd_args: argparse.Namespace,
    model: str,
    args: list[str],
) -> tuple[list[float], list[float]]:
    cold_compile_time: list[float] = []
    warm_compile_time: list[float] = []

    for _ in range(cmd_args.repeat):
        with fresh_cache():
            env = os.environ.copy()
            with tempfile.NamedTemporaryFile(suffix=".csv") as file:
                args.append("--output=" + file.name)
                logger.info(f"Performing cold-start run for {model}")  # noqa: G004
                subprocess.check_call(args, timeout=TIMEOUT, env=env)
                cold_compile_time.append(get_compile_time(file))

            args.pop()
            with tempfile.NamedTemporaryFile(suffix=".csv") as file:
                args.append("--output=" + file.name)
                logger.info(f"Performing warm-start run for {model}")  # noqa: G004
                subprocess.check_call(args, timeout=TIMEOUT, env=env)
                warm_compile_time.append(get_compile_time(file))

    return cold_compile_time, warm_compile_time

Subdomains

Frequently Asked Questions

What does _run_torchbench_from_args() do?
_run_torchbench_from_args() is a function in the pytorch codebase.
What does _run_torchbench_from_args() call?
_run_torchbench_from_args() calls 1 function(s): get_compile_time.
What calls _run_torchbench_from_args()?
_run_torchbench_from_args() is called by 1 function(s): _run_torchbench_model.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free