Skip to content
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

Increase number of cores used to calculate upsample for UNET #16351

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nkpatel-tt
Copy link
Contributor

@nkpatel-tt nkpatel-tt commented Dec 30, 2024

Ticket

Link to Github Issue

Problem description

Currently, Upsample processes one row per core, which can impact the performance.

What's changed

Instead single row per core granularity, make it work for minimum possible shard size for each core. More than 5% of perf improvement is seen.

Checklist

  • Post commit CI passes
  • Blackhole Post commit (if applicable)
  • Model regression CI testing passes (if applicable)
  • Device performance regression CI testing passes (if applicable)
  • (For models and ops writers) Full new models tests passes
  • New/Existing tests provide coverage for changes

@nkpatel-tt
Copy link
Contributor Author

nkpatel-tt commented Dec 30, 2024

As of now current branch has this branch merged which is being review at PR.

Once that branch is merged, will remove those changes and rebase.

@nkpatel-tt nkpatel-tt changed the title Upsample increase number of cores for YOLO and Stable diffusion Increase number of cores used to calculate upsample for YOLO and Stable diffusion Dec 30, 2024
@nkpatel-tt nkpatel-tt self-assigned this Dec 30, 2024
@nkpatel-tt nkpatel-tt force-pushed the nkpatel/upsample_perf_improve branch from 52cdc41 to 893a523 Compare January 24, 2025 09:22
@nkpatel-tt nkpatel-tt changed the title Increase number of cores used to calculate upsample for YOLO and Stable diffusion Increase number of cores used to calculate upsample for UNET, YOLO and Stable diffusion Jan 24, 2025
@nkpatel-tt nkpatel-tt force-pushed the nkpatel/upsample_perf_improve branch from 893a523 to ff77bb7 Compare January 24, 2025 10:46
overall performace is increased by more than 5%.

Signed-off-by: Nilaykumar Patel <[email protected]>
@nkpatel-tt nkpatel-tt force-pushed the nkpatel/upsample_perf_improve branch from ff77bb7 to 9e97e87 Compare January 27, 2025 06:50
@nkpatel-tt nkpatel-tt changed the title Increase number of cores used to calculate upsample for UNET, YOLO and Stable diffusion Increase number of cores used to calculate upsample for UNET Jan 27, 2025
@nkpatel-tt nkpatel-tt marked this pull request as ready for review January 27, 2025 07:50
@nkpatel-tt nkpatel-tt requested review from esmalTT, uaydonat and a team as code owners January 27, 2025 07:50
@@ -17,7 +17,7 @@
@pytest.mark.models_device_performance_bare_metal
@pytest.mark.parametrize(
"batch, groups, expected_device_perf_fps",
((1, 2, 1035.0),),
((1, 2, 978.0),),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a pretty big perf regression for UNet upsample, why is this happening?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main reason is next convolutions internally has to perform reshard. Let me just put it back in draft and see if I can manage to bypass those reshard by changing something in model(mainly while concating).

@nkpatel-tt nkpatel-tt marked this pull request as draft January 27, 2025 18:29
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