Skip to content

Conversation

keshavvinayak01
Copy link

@keshavvinayak01 keshavvinayak01 commented Oct 10, 2025

This PR adds support for emitting graphs for Pytorch HOPs, beginning with torch._higher_order_ops.while_loop.

The proposed change is to modify the import_program to call function _import_all_child_modules, which recursively imports the stateless graph for all the children modules.

Since HOP operator graphs are stateless graphs with no mutation, it is correct to import them as stateless graphs, although the method import_stateless_graph is marked as "deprecated".

@keshavvinayak01 keshavvinayak01 changed the title [WIP] Modified fx_imoprter to support hop_while_loop [WIP] Modified fx_importer to support hop_while_loop Oct 10, 2025
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
@keshavvinayak01 keshavvinayak01 marked this pull request as ready for review October 13, 2025 09:33
@keshavvinayak01 keshavvinayak01 marked this pull request as draft October 13, 2025 19:36
@keshavvinayak01 keshavvinayak01 marked this pull request as ready for review October 15, 2025 15:14
@keshavvinayak01 keshavvinayak01 changed the title [WIP] Modified fx_importer to support hop_while_loop [TORCH] Modified fx_importer to support hop_while_loop Oct 15, 2025
@zjgarvey
Copy link
Collaborator

I'm working on resolving ci issues right now. Once that lands, I'll ping here to have you sync your branch with main and review.

@keshavvinayak01
Copy link
Author

I'm working on resolving ci issues right now. Once that lands, I'll ping here to have you sync your branch with main and review.

Sounds good, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants