Repository navigation
[precompile] Settle the public docs on the capture/save/load surface - #195929
Closed
bobrenjc93 wants to merge 61 commits into
Closed
bobrenjc93 wants to merge 61 commits into
bobrenjc93 wants to merge 61 commits into
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/195929
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Sep 3, 2026
Closed
Closed
Closed
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 6dd685d Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 7d5cbe8 Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 1db19b4 Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 4261cb4 Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 93346c2 Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 823d52c Pull-Request: #195929 (cherry picked from commit 0b60519)
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 49bf1c7 Pull-Request: #195929
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: 49bf1c7 Pull-Request: #195929
[ghstack-poisoned]
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: c4344dd Pull-Request: #195929
bobrenjc93
added a commit
that referenced
this pull request
Sep 8, 2026
The shipped public surface is two caller-driven entry points, and this commit settles the documentation and the ``torch.compiler`` module comment on exactly that surface. ``precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)`` is a context manager: the caller invokes the returned capture around their own execution, and the ``(python_code, cache)`` artifact is written to the two paths when the block exits. The default ``DynamoTracer`` takes several calls and produces a guarded multi-graph artifact spanning graph breaks and recompilations; ``MakeFxTracer`` takes a single call and produces a self-contained Python source plus an acceleration cache. ``cap.save()`` checkpoints the on-disk artifact partway through the caller's own loop without ending the capture, and ``precompile.load`` reloads one. The API reference, the user-guide walkthrough, and the module comment are rewritten to this surface. That retires the earlier draft vocabulary the docs still carried -- the ``accumulate`` entry point, the ``example_inputs`` calling convention (and its 2.14 positional spelling behind a ``FutureWarning``) and the ``precompile.artifact`` pair accessor -- none of which the shipped code exposes. ``ExampleInput`` belonged to that convention and nothing else references it, so its dataclass is removed from torch/compiler/_precompile_types.py. Test Plan: Docs render through the existing ``eval-rst`` blocks. Removing the unused ``ExampleInput`` is covered by the public-bindings and precompile suites: ``` python test/test_public_bindings.py python test/test_precompile.py python test/dynamo/test_precompile_package.py ``` Authored with an AI assistant. ghstack-source-id: c4344dd Pull-Request: #195929
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
The shipped public surface is two caller-driven entry points, and this commit
settles the documentation and the
torch.compilermodule comment on exactlythat surface.
precompile.capture(fn, *, artifact_path, cache_path, tracer=DynamoTracer(), ...)is a context manager: the caller invokes thereturned capture around their own execution, and the
(python_code, cache)artifact is written to the two paths when the block exits. The default
DynamoTracertakes several calls and produces a guarded multi-graphartifact spanning graph breaks and recompilations;
MakeFxTracertakes asingle call and produces a self-contained Python source plus an acceleration
cache.
cap.save()checkpoints the on-disk artifact partway through thecaller's own loop without ending the capture, and
precompile.loadreloadsone.
The API reference, the user-guide walkthrough, and the module comment are
rewritten to this surface. That retires the earlier draft vocabulary the docs
still carried -- the
accumulateentry point, theexample_inputscallingconvention (and its 2.14 positional spelling behind a
FutureWarning) andthe
precompile.artifactpair accessor -- none of which the shipped codeexposes.
ExampleInputbelonged to that convention and nothing elsereferences it, so its dataclass is removed from
torch/compiler/_precompile_types.py.
Test Plan:
Docs render through the existing
eval-rstblocks. Removing the unusedExampleInputis covered by the public-bindings and precompile suites:Authored with an AI assistant.
[no ci]