-
Notifications
You must be signed in to change notification settings - Fork 863
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
Adding mps support to base handler and regression test #3048
Conversation
ts/torch_handler/base_handler.py
Outdated
@@ -149,6 +149,8 @@ def initialize(self, context): | |||
self.device = torch.device( | |||
self.map_location + ":" + str(properties.get("gpu_id")) | |||
) | |||
elif hasattr(self, "model_yaml_config") and "mps" in self.model_yaml_config and self.model_yaml_config["mps"] == "enable": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add mps
here
serve/model-archiver/README.md
Line 174 in 1a99de4
deviceType: cpu # cpu, gpu, neuron |
cc @lxning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of design, having one config for all deviceType
probably makes sense?
|
MPS is auto detected in the base handler and getAvailableGpu() now supports Mac M1 gpu cores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the User experience for both the cases in the PR/ add this in a README and add a pytest for MPS on/off for a model
cc: @msaroufim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add test cases?
- define deviceType in model-config.yaml on Mac
- cpu
- gpu
- deviceId
- define deviceType in model-config.yaml on gpu host
@udaij12 in general, LGTM. I just left a minor comments #3048 (comment). Thanks. |
@udaij12 Can you please add a document called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Adding MPS as device type for Mac M1. #3022
When Model-config.yaml
deviceType: "gpu"
or deviceType is not specified then default to GPU:MPS enabled
When Model-config.yaml
deviceType: "cpu"
:MPS not enabled
Test cases
Added 4 test cases.
Frontend:
Backend: