Content-Length: 248992 | pFad | http://github.com/pytorch/pytorch/issues/155433

1D [pt2] [Precompile] Store parameters in BundledAOTAutogradCacheEntry · Issue #155433 · pytorch/pytorch · GitHub
Skip to content

[pt2] [Precompile] Store parameters in BundledAOTAutogradCacheEntry #155433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jamesjwu opened this issue Jun 9, 2025 · 2 comments
Open

[pt2] [Precompile] Store parameters in BundledAOTAutogradCacheEntry #155433

jamesjwu opened this issue Jun 9, 2025 · 2 comments
Assignees
Labels
actionable in progress oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@jamesjwu
Copy link
Contributor

jamesjwu commented Jun 9, 2025

🚀 The feature, motivation and pitch

AOTDispatch has an extra wrapper here which adds flattened GraphModule parameters to the runtime arguments passed into the AOTAutograd callable.

full_args.extend(params_flat)

These need to be saved by BundledAOTAutogradCacheEntry or elsewhere for precompile.

Alternatives

No response

Additional context

No response

cc @chauhang @penguinwu

@jamesjwu jamesjwu added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jun 9, 2025
@jamesjwu jamesjwu self-assigned this Jun 9, 2025
@jamesjwu jamesjwu changed the title [Precompile] Store parameters in BundledAOTAutogradCacheEntry [pt2] [Precompile] Store parameters in BundledAOTAutogradCacheEntry Jun 9, 2025
@bdhirsh
Copy link
Contributor

bdhirsh commented Jun 9, 2025

Some quick thoughts: I would have imagined that instead of saving the params in the BundledAOTAutogradCacheEntry, we would want to have some similar logic to lift them at runtime into extra graph arguments. Also, is there a repro that uses inline_inbuilt_nn_modules=True where we see the params/buffers that AOT has to lift?

(1) the params themselves can be large tensors, so won't reading/writing them directly to the cache cause problems? (longer read/write latency, also blowing up the size of the cache)

(2) The background here is that... AOTDispatcher used to lift all params/buffers into graph inputs a while ago, but after @anijain2305 landed inline_inbuilt_nn_modules=True, most params/buffers started getting lifted by dynamo. I don't actually have a good sense of which params/buffers are not handled by this case and still need to be lifted by AOT. Maybe @anijain2305 knows? If we want to avoid saving these params to the cache directly, we probably need to either have dynamo properly lift all of these params/buffers, or figure out what their dynamo source is so we can lift them properly on a cache hit.

@jamesjwu
Copy link
Contributor Author

jamesjwu commented Jun 9, 2025

Ah, it's possible that this is just legacy code, and we don't need to care about it as long as inline_inbuilt_nn_modules=True. I will double check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable in progress oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/pytorch/pytorch/issues/155433

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy