Home / Function/ maybe_preserve_compile_debug() — pytorch Function Reference

maybe_preserve_compile_debug() — pytorch Function Reference

Architecture documentation for the maybe_preserve_compile_debug() function in common.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  d39825cb_6f16_dc2a_bb05_5c6f3e7a150a["maybe_preserve_compile_debug()"]
  9bf8449e_2d7f_c370_514b_b3c7bf20f8e1["run_one_model()"]
  9bf8449e_2d7f_c370_514b_b3c7bf20f8e1 -->|calls| d39825cb_6f16_dc2a_bb05_5c6f3e7a150a
  style d39825cb_6f16_dc2a_bb05_5c6f3e7a150a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/common.py lines 2986–3002

    def maybe_preserve_compile_debug(self, name, status):
        if (
            name in CI_PRESERVE_COMPILE_DEBUG
            and status in CI_PRESERVE_COMPILE_DEBUG[name]
        ):
            src_dir = torch._dynamo.utils.get_debug_dir()
            if os.path.isdir(src_dir):
                dbg_dir = os.path.join(
                    os.getcwd(), "test", "debug", "torch_compile_debug"
                )
                dst_dir = os.path.join(dbg_dir, os.path.basename(src_dir))
                try:
                    os.makedirs(dbg_dir, exist_ok=True)
                    os.rename(src_dir, dst_dir)
                    log.warning("Moved %s to %s", src_dir, dst_dir)
                except OSError:
                    log.exception("Failed to preserve %s", src_dir)

Subdomains

Called By

Frequently Asked Questions

What does maybe_preserve_compile_debug() do?
maybe_preserve_compile_debug() is a function in the pytorch codebase.
What calls maybe_preserve_compile_debug()?
maybe_preserve_compile_debug() is called by 1 function(s): run_one_model.

Analyze Your Own Codebase

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

Try Supermodel Free