Skip to content

[Core] Add correctness tests for SpaceToDepth and MobileClip Attention fusion#28168

Merged
hariharans29 merged 5 commits intomainfrom
hari/opt_tests
Apr 24, 2026
Merged

[Core] Add correctness tests for SpaceToDepth and MobileClip Attention fusion#28168
hariharans29 merged 5 commits intomainfrom
hari/opt_tests

Conversation

@hariharans29
Copy link
Copy Markdown
Member

@hariharans29 hariharans29 commented Apr 22, 2026

Description

Add correctness tests for fusions introduced in #27883 and #27747. The tests introduced in those PRs only check if fusion went through but not if the fused nodes produced semantically right results as the unfused subgraphs. Adding those tests to prevent accidental breakage in case something changed in the fused node's backing kernel implementation.

Motivation and Context

Adress test coverage gap

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades existing optimizer fusion tests to validate semantic correctness (fused vs. unfused outputs), not just that the fusion pattern triggered. It targets the SpaceToDepth fusion and the MobileClip Attention fusion added in prior PRs.

Changes:

  • Convert SpaceToDepth fusion tests from TestGraphTransformer graph-structure-only checks to TransformerTester output comparisons plus transformed-graph assertions.
  • Convert MobileClip Attention fusion tests to TransformerTester for correctness verification on CPU and CUDA (when available).
  • Add small adapter helpers to run existing Status-based graph validators from TransformerTester’s void(InferenceSessionWrapper&) callback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hariharans29 hariharans29 requested a review from tianleiwu April 22, 2026 04:38
@hariharans29 hariharans29 changed the title WIP[DO NOT REVIEW]: [Core] Add correctness tests for SpaceToDepth and MobileClip Attention fusion [Core] Add correctness tests for SpaceToDepth and MobileClip Attention fusion Apr 22, 2026
Copy link
Copy Markdown
Contributor

@tianleiwu tianleiwu left a comment

Choose a reason for hiding this comment

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

Reviewed the updated fusion tests against the current head.

The switch to TransformerTester improves these cases by checking unfused-vs-fused output equivalence while still asserting the expected transformed graph shape. I also checked the CUDA path carefully, and the new session-based flow is consistent with the current MobileCLIP fusion logic for unassigned nodes before partitioning.

I did not find any actionable issues in the current patch.

@hariharans29 hariharans29 enabled auto-merge (squash) April 22, 2026 18:01
@hariharans29 hariharans29 merged commit f38dec1 into main Apr 24, 2026
101 of 105 checks passed
@hariharans29 hariharans29 deleted the hari/opt_tests branch April 24, 2026 00:00
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.

3 participants