Unverified Commit eeee1c3b authored by Woosuk Kwon's avatar Woosuk Kwon Committed by GitHub
Browse files

[TPU] Avoid initializing TPU runtime in is_tpu (#7763)

parent aae74ef9
...@@ -8,8 +8,10 @@ current_platform: Platform ...@@ -8,8 +8,10 @@ current_platform: Platform
is_tpu = False is_tpu = False
try: try:
import torch_xla.core.xla_model as xm # While it's technically possible to install libtpu on a non-TPU machine,
xm.xla_device(devkind="TPU") # this is a very uncommon scenario. Therefore, we assume that libtpu is
# installed if and only if the machine has TPUs.
import libtpu # noqa: F401
is_tpu = True is_tpu = True
except Exception: except Exception:
pass pass
......
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