Skip to content

Exclude EPContext Op from Common Subexpression Elimination graph optimization #25296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025

Conversation

chilo-ms
Copy link
Contributor

@chilo-ms chilo-ms commented Jul 6, 2025

In the context of a model containing EPContext nodes, it's highly unlikely that two EPContext nodes will produce the same results.
Furthermore, the EquivalenceClass constructor includes the node and all its attributes in the hash calculation, which can be particularly time-consuming when the "ep_cache_context" attribute contains a large binary blob.

Therefore, we exclude EPContext op from CSE.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You can commit the suggested changes from lintrunner.

@chilo-ms chilo-ms merged commit f0097fc into main Jul 7, 2025
91 checks passed
@chilo-ms chilo-ms deleted the chi/disable_node_attr_hash_for_ep_context_node branch July 7, 2025 22:51
daijh pushed a commit to daijh/onnxruntime that referenced this pull request Jul 10, 2025
…mization (microsoft#25296)

In the context of a model containing EPContext nodes, it's highly
unlikely that two EPContext nodes will produce the same results.
Furthermore, the EquivalenceClass constructor includes the node and all
its attributes in the hash calculation, which can be particularly
time-consuming when the "ep_cache_context" attribute contains a large
binary blob.

Therefore, we exclude EPContext op from CSE.
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