This repository was archived by the owner on Jul 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
Expose all devices. #1059
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
On a machine with GPU or TPU, I get a segfault if I try to use Device
with CPU type on XLA backend, e.g.:
let device = Device(kind: .CPU, ordinal: 0, backend: .XLA)
let t1 = Tensor([1, 1, 0], on: device)
let t2 = Tensor([1, 1, 0], on: device)
t1 + t2
2020-08-10 15:43:18.077050: E tensorflow/compiler/xla/xla_client/tf_logging.cc:23] Check failed: it != device_contexts_.end()
*** Begin stack trace ***
copyTensor
$sSa23withUnsafeBufferPointeryqd__qd__SRyxGKXEKlF
$s10TensorFlow9XLATensorV4make__2onACSRyxG_SaySiGAA6DeviceVtAA13XLAScalarTypeRzlFZ
$s10TensorFlow0A0V5shape7scalars2onACyxGAA0A5ShapeV_SRyxGAA6DeviceVtcfC
*** End stack trace ***
No such device: CPU:0
2020-08-10 15:43:18.077121: F tensorflow/compiler/xla/xla_client/tf_logging.cc:26] tensorflow/compiler/tf2xla/xla_tensor/tensor.cpp:419 : Check failed: it != device_contexts_.end()
*** Begin stack trace ***
copyTensor
$sSa23withUnsafeBufferPointeryqd__qd__SRyxGKXEKlF
$s10TensorFlow9XLATensorV4make__2onACSRyxG_SaySiGAA6DeviceVtAA13XLAScalarTypeRzlFZ
$s10TensorFlow0A0V5shape7scalars2onACyxGAA0A5ShapeV_SRyxGAA6DeviceVtcfC
*** End stack trace ***
No such device: CPU:0
Current stack trace:
frame #21: 0x00007fb3999eb113 $__lldb_expr218`main at <Cell 28>:2
A workaround is to set the XRT_DEVICE_MAP
environment variable, but all device and backend combinations should be accessible without this.
See swift-models/#654.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request