Uh oh!
There was an error while loading. Please reload this page.
[cuda backend] share AOTI weights by FQN across methods - #21823
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21823
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit fa7c98a with merge base d2f97d5 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
071b477 to
b7d877fCompareb7d877f to
0b7f1cbCompare6b88a80 to
198e047CompareGasoonjia
commented
Aug 19, 2026
@claude review this PR plz |
Claude finished @Gasoonjia's task in 3m 54s —— View job PR Review — share AOTI weights by FQN across methodsNice work — this is a substantial and well-reasoned change. The manifest format, overflow-hardened view validation, content-addressed dedup, and the mutable/immutable sharing distinction are all thoughtfully done. Below are findings grouped by severity. 🟠 Correctness / robustness1. Thread-local capture is fragile if AOTI materializes on a worker thread 2. 3. Unsupported dtypes fail at runtime rather than export 🟡 Minor / performance4. O(entries × keys) scan for mutable weights 5. Comment placement between 6. Behavior change scope — confirm intended 🟢 Things I liked / verified
Suggestions
Overall the design is sound and the safety checks are thorough. The main things I'd want resolved before merge are #1 (TLS coupling) and #3 (late dtype failure); #2 is worth at least a documented contract. |
198e047 to
e92f159Compare0b7f1cb to
579c580CompareUh oh!
There was an error while loading. Please reload this page.
c884d6f to
1bf1117CompareAuthored with Codex.
Generated with Codex.
Generated with Codex.
Generated with Codex.
Move structured CUDA weight collection into a dedicated export-side collector, key values by device and FQN, and reject conflicting values or metadata. Keep the runtime backend integration small by delegating manifest loading and cross-method allocation reuse to a focused CUDA weight cache.\n\nGenerated with Codex.
Keep serialized FQN metadata parsing, validation, allocation, and AOTI binding behind CudaWeightCache, and remove the standalone manifest abstraction.\n\nGenerated with Codex.
Split named-data merging and FQN registration into focused collector helpers to satisfy complexity lint without changing serialization behavior.\n\nGenerated with Codex.
Generated with Codex.
Generated with Codex.
Generated with Codex.
Generated with Codex.
Gasoonjia
commented
Aug 25, 2026
/easycla |
| // methods are independent sub-graphs that may have FQN collisions | ||
| // (e.g. parakeet). |
There was a problem hiding this comment.
what about this, how do we handle this if the fqns are same but content is indeed different?
There was a problem hiding this comment.
Right now we just raised error: from eager model perspective different methods are different "forward" functions in a same model, which means they shouldn't contain weights sharing same fqn.
digantdesai
commented
Aug 26, 2026
@claude review this PR. |
digantdesai
left a comment
There was a problem hiding this comment.
what were the memory footprint gains?
Claude finished @digantdesai's task in 3m 48s —— View job PR Review — share AOTI weights by FQN across methodsFocused on @digantdesai's two open questions, plus what changed since my last review. ❓ "How do we handle same FQN but different content?" ( |
Gasoonjia
commented
Aug 26, 2026
no obvious memory footprint change, but ptd size reduced a lot |
Summary
Currently we store weight in method granularity: if two methods do not share identical weight we have to keep two weight copies, even if they may just one tensor different.
This PR stores the weight in tensor granularity: we store the weight pickle format and use FQN as the key for each tensor. With this PR weight can be shared across different methods even if they are partially overlapped.