Skip to content

Conversation

glenn-jocher
Copy link
Member

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

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Implemented a more accurate and granular profiling system in YOLOv5.

📊 Key Changes

  • Replaced simple timing with Profile class instances for timing blocks.
  • Amended code to use context management (with Profile():) for precise measurements.
  • Introduced Profile class to handle timing with automatic CUDA synchronization if necessary.
  • Accumulated profiling time over the course of the program.
  • Removed explicit calls to time_sync() function in favor of Profile class.

🎯 Purpose & Impact

  • 📈 Enhanced Profiling Accuracy: With Profile, there's fine-grained timing which should lead to better optimization decisions.
  • 💡 Clearer Code Intent: Replacing ad-hoc timing with a context manager clarifies the intent and scope of code being timed.
  • 💾 Easier Maintenance: Centralized timing logic within Profile makes future updates to profiling easier and less error-prone.
  • 🚀 Potential Performance Improvements: Accurate profiling could guide optimization, potentially leading to performance gains for end-users.

@glenn-jocher glenn-jocher self-assigned this Aug 18, 2022
@glenn-jocher glenn-jocher merged commit d40cd0d into master Aug 18, 2022
@glenn-jocher glenn-jocher deleted the update/Profile_class branch August 18, 2022 17:55
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Improved `Profile()` class

* Update predict.py

* Update val.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update val.py

* Update AutoShape

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
wombat70 added a commit to wombat70/vespai that referenced this pull request Sep 16, 2024
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.

1 participant