True if the disco NVSHMEM runtime is available (requires CUDA). Probes the runtime global function rather than the ``USE_NVSHMEM`` build flag, since the flag can be set in builds that do not ship the runtime.
()
| 284 | |
| 285 | @functools.cache |
| 286 | def has_nvshmem() -> bool: |
| 287 | """True if the disco NVSHMEM runtime is available (requires CUDA). |
| 288 | |
| 289 | Probes the runtime global function rather than the ``USE_NVSHMEM`` build |
| 290 | flag, since the flag can be set in builds that do not ship the runtime. |
| 291 | """ |
| 292 | try: |
| 293 | return has_cuda() and ( |
| 294 | tvm.get_global_func("runtime.disco.nvshmem.init_nvshmem_uid", allow_missing=True) |
| 295 | is not None |
| 296 | ) |
| 297 | except Exception: # pylint: disable=broad-except |
| 298 | return False |
| 299 | |
| 300 | |
| 301 | # --- version / capability probes ------------------------------------------- |
nothing calls this directly
no test coverage detected
searching dependent graphs…