Export page: defer format pruning until hardware info is authoritative

The availableFormats prune effect ran on the initial render before
/api/system/hardware resolves, when hasNvidia is false and the NVIDIA-only
compressed-tensors formats are transiently absent. On a fresh Export mount
with the module cache empty (cold start, or a remount during
refreshHardwareInfo), a running FP8/NVFP4 selection was pruned permanently,
since the later hardware response only adds formats back to availableFormats
and never restores selectedFormats. Gate the effect on hardware.loaded so it
prunes only against the authoritative capability set, matching the effect's
stated intent.
This commit is contained in:
Daniel Han 2026-07-15 14:49:43 +00:00
commit 3be31947dd

View file

@ -260,13 +260,17 @@ export function ExportPage() {
}, []);
// Drop any already-selected format that the gate just removed (e.g. torchao once win32Rocm
// resolves after /api/system/hardware lands), so a stale pick isn't summarized or exported.
// Gate on hardware.loaded: before the authoritative response hasNvidia is false, so the
// NVIDIA-only compressed formats are transiently absent and pruning here would permanently
// drop a running FP8/NVFP4 selection that the later response cannot restore.
useEffect(() => {
if (!hardware.loaded) return;
const allowed = new Set(availableFormats.map((f) => f.value));
setSelectedFormats((prev) => {
const next = prev.filter((v) => allowed.has(v));
return next.length === prev.length ? prev : next;
});
}, [availableFormats]);
}, [availableFormats, hardware.loaded]);
// IQ quants are imatrix-only: force imatrix on when one is selected, else llama.cpp rejects it.
const requiresImatrix = quantLevels.some(
(q) => QUANT_OPTIONS.find((o) => o.value === q)?.imatrix,