Skip to main content

read_active

Function read_active 

Source
pub fn read_active(root: &Path) -> Option<LibtorchInfo>
Expand description

Read the active libtorch variant from <root>/libtorch/.active and parse its .arch metadata.

On heterogeneous rigs (multiple hosts sharing the same checkout via NFS / virtiofs / S3-FUSE) a single .active file can’t represent “PT 2.10 on the Blackwell host AND PT 2.7 on the Pascal host” at the same time. The FDL_LIBTORCH_CASE env var selects an alternative pointer file libtorch/.active.<case>; the file’s content is read identically to .active.

Setting FDL_LIBTORCH_CASE=<case> with no corresponding pointer file is a hard misconfiguration: this function logs the missing file to stderr and returns None (callers surface this as “libtorch not configured”) rather than silently falling back to .active, which would otherwise mask the user’s explicit selection.