[executorch][webgpu] Test linear embedding dynamic reuse - #21406
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21406
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 11 Unrelated FailuresAs of commit e975971 with merge base 2439920 ( NEW FAILURE - The following job has failed:
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. |
This PR needs a
|
|
@claude Thoroughly review for redundancy or areas of modularization or any high value changes |
|
Claude finished @JCNTH's task in 2m 31s —— View job Review: redundancy, modularization & high-value changes
Overall this is a clean, well-scoped test addition. The 🟢 High-value: the import-path fix is a real correctness change
🟡 Redundancy: the golden-writing loop is near-duplicatedThe new linear block ( def _write_emb_goldens(out_dir, prefix, ns, golden_fn):
for n in ns:
idx = (torch.arange(n, dtype=torch.long) * 7) % EMB_VOCAB
golden_fn(n, idx) # raises if non-discriminating / does the equal() guard
idx.detach().numpy().astype("<i8").tofile(
os.path.join(out_dir, f"{prefix}.S{n}.idx.bin"))
golden_fn.golden(n, idx).detach().numpy().astype("<f4").tofile(
os.path.join(out_dir, f"{prefix}.S{n}.golden.bin"))That may be over-engineering for two call sites given the differing golden/guard logic — reasonable to leave as-is. But at minimum the repeated 🟡 Minor: two C++ diagnostic messages still hardcode
|
Pull Request resolved: #21406 **Dynamic-shape coverage now locks linear-packed Q4 embedding reuse.** The fixture exports a discriminating linear-packed model and reuses one loaded graph across N=16,8,1,16, covering the resize transition that previously reset nibble order. Key changes: - `test_dynamic_shape_export.py` — export deterministic true-packing artifacts and torch goldens for N=16,8,1. - `test_dynamic_shape.cpp` — add one-graph linear-packed reuse coverage while preserving the nonlinear control. The explicit true-vs-false output guard prevents a non-discriminating fixture. Co-authored-with: Claude Code. ghstack-source-id: 407350695 @exported-using-ghexport Differential Revision: [D113627869](https://our.internmc.facebook.com/intern/diff/D113627869/)
SS-JIA
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Stack from ghstack (oldest at bottom):
Dynamic-shape coverage now locks linear-packed Q4 embedding reuse.
The fixture exports a discriminating linear-packed model and reuses one loaded graph across N=16,8,1,16, covering the resize transition that previously reset nibble order.
Key changes:
test_dynamic_shape_export.py— export deterministic true-packing artifacts and torch goldens for N=16,8,1.test_dynamic_shape.cpp— add one-graph linear-packed reuse coverage while preserving the nonlinear control.The explicit true-vs-false output guard prevents a non-discriminating fixture.
Co-authored-with: Claude Code.
@exported-using-ghexport
Differential Revision: D113627869
Differential Revision: D113627869