Return a list of devices for each worker in the system.
(session)
| 160 | |
| 161 | |
| 162 | def all_worker_devices(session): |
| 163 | """Return a list of devices for each worker in the system.""" |
| 164 | devices = session.list_devices() |
| 165 | |
| 166 | devices_that_support_heartbeats = [] |
| 167 | |
| 168 | for device in devices: |
| 169 | name = device.name |
| 170 | # Pick devices that have a TPU but target the attached CPU |
| 171 | if ':TPU:0' in name and 'coordinator' not in name: |
| 172 | devices_that_support_heartbeats.append(name.replace('TPU', 'CPU')) |
| 173 | |
| 174 | return devices_that_support_heartbeats |
| 175 | |
| 176 | |
| 177 | class WatchdogManager(threading.Thread): |
no test coverage detected