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

Fixed device selection #1193

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ambitious-octopus
Copy link
Contributor

@ambitious-octopus ambitious-octopus commented Aug 28, 2024

Pull Request Description:

This PR fixes issue #1189. This PR also allows better import of the set_working_device function, facilitating more effective DeviceManager singleton management.

Example Usage:

from model_compression_toolkit.core.pytorch import set_working_device

# Set the working device to 'GPU' or 'CPU'
set_working_device('GPU')

With this change, the set_working_device function can be easily imported and used to configure the DeviceManager's device context. This also allows a quantization to be tested on a specific device.

cc: @Idan-BenAmi

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

Copy link
Contributor Author

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Idan-BenAmi just FYI, I removed the additional import!

@ofirgo ofirgo marked this pull request as draft September 10, 2024 07:50
@Idan-BenAmi
Copy link
Collaborator

Hi @ambitious-octopus,
we've found the root cause of this issue (model.to() error), and we think #1204 is a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants