Skip to content

assert torch!=1.12.0 for DDP training#8621

Merged
glenn-jocher merged 2 commits intomasterfrom
update/torch1_12
Jul 18, 2022
Merged

assert torch!=1.12.0 for DDP training#8621
glenn-jocher merged 2 commits intomasterfrom
update/torch1_12

Conversation

@glenn-jocher
Copy link
Copy Markdown
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 disabled auto-merge July 18, 2022 13:05
@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