Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow Torch half models #3130

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ProgramadorArtificial
Copy link

@ProgramadorArtificial ProgramadorArtificial commented Sep 24, 2024

Motivation

Running the model in float16 takes up less memory, less disk space and runs faster. So, I added an option to publish the model and run inference as float16.

Modification

Added a new parameter when publish the model and a condition to check if the model is in float16 to change the input image.

BC-breaking (Optional)

Use cases (Optional)

This PR was created and tested using MMEngine and a PR was created there too: open-mmlab/mmengine#1577
PS: The code works even if one of the libraries (MMPose or MMEngine) is not updated with the new suggested changes.

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Sep 24, 2024

CLA assistant check
All committers have signed the CLA.

@ProgramadorArtificial ProgramadorArtificial changed the title Programadorartificial/allow torch half models Allow Torch half models Sep 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants