speeds up will_fusion_create_cycle (#102770)
improves #102622 from ~150s to ~15s.
The way computing recursive predecessors works is if `nodes = node1.recursive_predecessors` then recursive predecessors of any `n` in `nodes` should still be a subset of `nodes`, so we can shortcut computing intersection of `node.recursive_predecessors - combined_predecessors`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102770
Approved by: https://github.com/Chillee
Author
Natalia Gimelshein