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

AutoBatch protect from extreme batch sizes #9209

Merged
merged 1 commit into from
Aug 29, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Aug 29, 2022

If < 1 or > 1024 set output to default batch size 16.

May partially address #9156

Signed-off-by: Glenn Jocher glenn.jocher@ultralytics.com

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved range checking for auto-batching to ensure optimal batch size within safe limits.

πŸ“Š Key Changes

  • Added an upper limit check to prevent the batch size from exceeding 1024.
  • The batch size now defaults to the user-defined batch_size if the calculated batch size falls outside the acceptable range (below 1 or above 1024).

🎯 Purpose & Impact

  • Prevents unrealistic batch sizes that could cause memory issues or degrade performance.
  • Offers more stable and reliable auto-batching by adhering to a reasonable pre-set or user-defined default batch size.
  • Ensures the auto-batching feature provides a balance between speed and resource usage, leading to potentially improved user experience. πŸ”„

If < 1 or > 1024 set output to default batch size 16.

May partially address #9156

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher linked an issue Aug 29, 2022 that may be closed by this pull request
1 task
@glenn-jocher glenn-jocher merged commit 3c64d89 into master Aug 29, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-2 branch August 29, 2022 18:06
@glenn-jocher glenn-jocher mentioned this pull request Aug 29, 2022
1 task
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
If < 1 or > 1024 set output to default batch size 16.

May partially address ultralytics#9156

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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.

About AutoBatch
1 participant