damccorm commented on code in PR #29999:
URL: https://github.com/apache/beam/pull/29999#discussion_r1467873818
##########
sdks/python/apache_beam/ml/inference/pytorch_inference.py:
##########
@@ -91,6 +91,12 @@ def _load_model(
"Model handler specified a 'GPU' device, but GPUs are not available. "
"Switching to CPU.")
device = torch.device('cpu')
+ if device == torch.device('mps') and not (torch.backend.mps.is_available()
and
Review Comment:
Ah, it also looks like `torch.device('mps')` causes older versions of
pytorch to throw. To maintain compat with older versions, could we wrap this in
a try except? It should be fine to silently swallow the exception since we'll
throw below if someone tries to set the device to mps and the pytorch version
doesn't support it.
This is why the test checks are failing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]