Skip to content

Conversation

haifeng-jin
Copy link
Collaborator

@haifeng-jin haifeng-jin commented Jun 2, 2025

Resolves #9117

The UncachedCompile metric was cleared at every fx graph compile and execution, when used with torch.compile.
This PR ensures the values are not cleared between the graphs.

@haifeng-jin haifeng-jin self-assigned this Jun 2, 2025
@haifeng-jin haifeng-jin changed the title do not clear UncachedCompile between node runs Do not clear UncachedCompile between graph executions Jun 2, 2025
@haifeng-jin
Copy link
Collaborator Author

@ghpvnist Would you mind help explain how the following functions related to the number of fx or HLO graphs?
I am not very familiar with the dyanmo_bridge.
I just followed the existing code to make the changes.

Why do we port over the DynamoExtractCompiledGraph in UnsupportedNodesCollector.run_node() and incremented it by 1 in extract_compiled_graph()?

Thank you!

@haifeng-jin
Copy link
Collaborator Author

As I further inspect the code. The UncachedCompile was correctly counted.
We do not need to increment it in dynamo_bridge.py.
We only need to prevent it from being cleared between the graph executions.

@haifeng-jin haifeng-jin marked this pull request as ready for review June 4, 2025 18:46
@haifeng-jin haifeng-jin requested a review from bhavya01 June 4, 2025 18:46
Copy link
Collaborator

@ghpvnist ghpvnist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can you add an unit test?

@haifeng-jin haifeng-jin enabled auto-merge (squash) June 5, 2025 20:58
@haifeng-jin
Copy link
Collaborator Author

Unit test added.

@haifeng-jin haifeng-jin merged commit c7a9671 into master Jun 5, 2025
24 checks passed
@haifeng-jin haifeng-jin deleted the haifeng/bridge branch June 6, 2025 05:03
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.

Get the number of graphs with dynamo for the models in benchmarks
3 participants