freenode
AI & ML

PyTorch device capability API breaks non-CUDA heuristics

CUDA returns a version tuple while XPU returns a dict, so shared autoheuristic metadata never matches on those backends.

PyTorch's device capability query does not present a uniform contract across backends, causing automatic heuristic selection to fail silently on non-CUDA accelerators.

According to rogerchen838, the CUDA path returns a (major, minor) version tuple while the XPU path returns a dictionary, and some third-party accelerator modules omit the call entirely. Downstream autoheuristic logic stores that value in metadata and compares it against fixed CUDA-style capability pairs, or string-matches the tuple form. When the return type differs, no heuristic matches and the metadata path effectively goes dead for those devices.

The reporter asked maintainers to normalize the value into a backend-independent representation, such as a stable string key or a documented major/minor extraction with a fallback, before it is written into heuristic metadata.