Skip to content

[FX][Tests] Use smaller swin transformer to speed up pre-commit#4082

Open
daniil-lyakhov wants to merge 1 commit into
openvinotoolkit:developfrom
daniil-lyakhov:dl/fx/small_swin
Open

[FX][Tests] Use smaller swin transformer to speed up pre-commit#4082
daniil-lyakhov wants to merge 1 commit into
openvinotoolkit:developfrom
daniil-lyakhov:dl/fx/small_swin

Conversation

@daniil-lyakhov
Copy link
Copy Markdown
Collaborator

@daniil-lyakhov daniil-lyakhov commented May 18, 2026

Changes

swin_v2_t is replaced with smaller version for the graph tests - the same graph but with only 2 blocks

Reason for changes

To speed up pre-commit tests as swin_2_t took the most time (~1 min faster)

Related tickets

178804

Tests

Copilot AI review requested due to automatic review settings May 18, 2026 13:08
@daniil-lyakhov daniil-lyakhov requested a review from a team as a code owner May 18, 2026 13:08
@github-actions github-actions Bot added the NNCF PT Pull requests that updates NNCF PyTorch label May 18, 2026
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 replaces the FX graph tests’ swin_v2_t torchvision model with a smaller synthetic Swin V2 fixture to reduce pre-commit runtime.

Changes:

  • Adds a custom Swin V2 test model fixture.
  • Switches FX graph and quantization test cases to the new Swin fixture.
  • Adds regenerated non-dynamic graph/metatype references for the new model and removes the old Swin metatype reference.

Reviewed changes

Copilot reviewed 7 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/torch/test_models/synthetic.py Adds the new Swin V2 synthetic test fixture.
tests/torch/fx/test_models.py Replaces swin_v2_t test cases with the new fixture and updates expected Q/DQ counts.
tests/torch/data/fx/swin_v2_single_block.dot Adds reference FX graph for the new fixture.
tests/torch/data/fx/reference_metatypes/swin_v2_t.json Removes old Swin V2 Tiny metatype reference.
tests/torch/data/fx/reference_metatypes/swin_v2_single_block.json Adds metatype reference for the new fixture.
tests/torch/data/fx/quantized/swin_v2_single_block.dot Adds non-compressed quantized reference graph.
tests/torch/data/fx/post_quantization_compressed/swin_v2_single_block.dot Adds compressed quantized reference graph.

Comment thread tests/torch/test_models/synthetic.py Outdated
Comment thread tests/torch/fx/test_models.py
Comment thread tests/torch/test_models/synthetic.py
Comment thread tests/torch/test_models/synthetic.py Outdated
@daniil-lyakhov daniil-lyakhov force-pushed the dl/fx/small_swin branch 2 times, most recently from 39e37a9 to 17ccb83 Compare May 18, 2026 13:59
@AlexanderDokuchaev
Copy link
Copy Markdown
Collaborator

152.51s call     fx/test_models.py::test_quantized_model[swin_v2_t-True-True]
85.92s call     fx/test_models.py::test_quantized_model[swin_v2_t-False-True]

vs

123.87s call     fx/test_models.py::test_quantized_model[swin_v2_single_block-True-True]
43.73s call     fx/test_models.py::test_quantized_model[swin_v2_single_block-False-True]

Is it better but still too slow, all tests runs for 461s

@daniil-lyakhov
Copy link
Copy Markdown
Collaborator Author

152.51s call     fx/test_models.py::test_quantized_model[swin_v2_t-True-True]
85.92s call     fx/test_models.py::test_quantized_model[swin_v2_t-False-True]

vs

123.87s call     fx/test_models.py::test_quantized_model[swin_v2_single_block-True-True]
43.73s call     fx/test_models.py::test_quantized_model[swin_v2_single_block-False-True]

Is it better but still too slow, all tests runs for 461s

@AlexanderDokuchaev, what would you suggest? Let's remove swin tests all together, otherwise the current version is minimal viable to chech the architecture

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

Labels

NNCF PT Pull requests that updates NNCF PyTorch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants