pub fn variant_vendor(variant: &str) -> Option<GpuVendor>Expand description
Which GPU stack a libtorch variant path targets, from its basename.
None means a CPU-only variant. The variant path (precompiled/cu128,
builds/sm61-sm120, precompiled/cpu) is the single source of truth
here – no .arch metadata file is required – because the cluster
arch: field names exactly this path and must resolve without
reading the remote host’s filesystem.
| Basename starts with | Target |
|---|---|
cpu | CPU-only |
cu<digit> (cu128, cu126-pt27) or sm<digit> (sm61-sm120) | NVIDIA |
rocm<digit> or gfx<digit> (gfx1030-gfx1100) | AMD |
An unrecognised basename warns and is treated as NVIDIA. That
preserves the pre-multi-vendor behaviour exactly, which matters
because a user may well have a hand-named CUDA variant
(builds/mybuild) that works today; hard-erroring would break a
running setup for the sake of a naming convention. The warning is
the point: the old code made the same assumption in silence, and an
unrecognised basename on an AMD box would otherwise be cross-built
for NVIDIA without a word.