[bugfix] preserve absent KJT weights in exported graphs - #679
Conversation
FBGEMM CUDA can return an undefined tensor for absent weights, causing native TorchScript inference to fail on a subsequent permutation. Insert FX guards after TorchRec MC and quantized permutations so unweighted inputs retain None in exported models.
Review summary (static, multi-area)Verdict: the fix is sound and the testing is unusually thorough. All findings are minor/style-level — see 3 inline comments on Cross-checked against the pinned deps (
Low-severity observations (no action strictly required):
Review logistics: five areas were dispatched (code quality, performance, security, documentation accuracy, test coverage). The first four completed; the test-coverage reviewer stalled and was stopped, so test adequacy was verified manually instead (permutation math, FX placeholder handling of the 🤖 Generated with Claude Code |
Keep private TorchRec imports within tracing and skip graph recompilation when no guard is inserted. Document guard mutation and retracing, preserve native-test timeout output, and cover torch.export with and without weights.
|
Follow-up to the review summary: changes are pushed in 701fbc5, with replies on all three inline comments.
Validation: all 10 tests in |
FBGEMM CUDA can return an undefined tensor for absent weights, causing native TorchScript inference to fail on a subsequent permutation. Insert FX guards after TorchRec MC and quantized permutations so unweighted inputs retain None in exported models.