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

assert torch!=1.12.0 for DDP training #8621

Merged
merged 2 commits into from
Jul 18, 2022
Merged

assert torch!=1.12.0 for DDP training #8621

merged 2 commits into from
Jul 18, 2022

Conversation

glenn-jocher
Copy link
Member

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

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Updated dependencies and streamlined Distributed Data Parallel (DDP) model instantiation.

πŸ“Š Key Changes

  • πŸ”— Removed specific version exclusions for torch and torchvision in requirements.txt, previously excluding problematic versions.
  • πŸ›  Replaced explicit DDP version checks and creations in train.py with a new smart_DDP function.
  • 😌 Simplified import and function calls in train.py, resulting in cleaner code.
  • πŸ›‘ Introduced smart_DDP function in utils/torch_utils.py that includes version checks and conditions for DDP instantiation, ensuring compatibility and preventing usage with unsupported versions.

🎯 Purpose & Impact

  • πŸ“¦ The changes to torch and torchvision dependencies may allow for wider compatibility with different versions of these libraries, potentially easing installation and upgrade processes.
  • 🧠 The new smart_DDP function centralizes DDP logic, making it easier to manage compatibility issues with PyTorch versions and reducing potential errors during multi-GPU training setups.
  • 🐍 By streamlining code in train.py and utils/torch_utils.py, the codebase becomes more maintainable and understandable, which benefits contributors and users alike.
  • πŸ’» Users might experience smoother installation and less friction when setting up distributed training, thanks to the handling of specific PyTorch version incompatibilities.

@glenn-jocher glenn-jocher self-assigned this Jul 18, 2022
@glenn-jocher glenn-jocher enabled auto-merge (squash) July 18, 2022 12:59
@glenn-jocher glenn-jocher merged commit 9cf5fd5 into master Jul 18, 2022
@glenn-jocher glenn-jocher deleted the update/torch1_12 branch July 18, 2022 13:06
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* assert torch!=1.12.0 for DDP training

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

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

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

Torch v1.12 fixes bug to train a model, but YoloV5 rejects the version. About pyotrch version
1 participant