viable/strict/1789203000: [inductor] Make manual wait-user repair linear (#195616)
This PyTorch release optimizes the manual wait-user repair process for the inductor by converting it to a linear, more scalable approach. A stable topological sort is run once when a backward data edge is introduced, preserving ordering while avoiding re-scanning inputs after every wakeup.
The update also ensures cycles are detected, preventing invalid graphs from being left behind. Tests validate behavior on transitive chains, multiple replacements, and cycle scenarios, with explicit test plans provided.
Why it matters: Makes graph repairs scale better with large graphs and long dependency chains. Improves correctness by reliably detecting cycles and maintaining semantics during repair.
AI-assisted brief
official source
Add a comment
No account required