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

Link fuse() to AutoShape() for Hub models #8599

Merged
merged 1 commit into from
Jul 16, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

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

This PR disables fusing for autoshape=False Hub models.

@AyushExel

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Update to model loading with optional layer fusion in hubconf.py and DetectMultiBackend class.

πŸ“Š Key Changes

  • The DetectMultiBackend class has a new fuse parameter that controls whether model layers are fused beneficial for inference time.
  • In hubconf.py, the layer fusion is now linked to the autoshape parameter when preloading a model.

🎯 Purpose & Impact

  • Purpose: To give users the option to speed up model inference by fusing the layers of the neural network when the model is loaded.
  • Impact:
    • πŸš€ Could improve inference speed by reducing the number of operations performed during a forward pass.
    • βœ… Offers a flexible choice to users: they can turn layer fusion on or off, potentially trading off between model speed and adaptability based on their requirements.

@glenn-jocher glenn-jocher self-assigned this Jul 16, 2022
@glenn-jocher glenn-jocher merged commit a34b376 into master Jul 16, 2022
@glenn-jocher glenn-jocher deleted the update/autoshape-fuse branch July 16, 2022 21:46
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
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