Unverified Commit 5353c9b0 authored by Itay Alroy's avatar Itay Alroy Committed by GitHub
Browse files

platforms: Fix Ray DP startup crash (#36665)


Signed-off-by: default avatarItay Alroy <ialroy@nvidia.com>
parent 13e79fc8
......@@ -638,6 +638,11 @@ class Platform:
"""Raises if this request is unsupported on this platform"""
def __getattr__(self, key: str):
# Pickle checks dunder methods like __getstate__. If we return None
# for them, pickle treats it like a real value and tries to call it.
if key.startswith("__") and key.endswith("__"):
raise AttributeError(key)
device = getattr(torch, self.device_type, None)
if device is not None and hasattr(device, key):
attr = getattr(device, key)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment