Files
ANSCORE/modules/ANSFR
nghianguyenandClaude Opus 4.8 799f755d5a ANSFR: purge stale ServerOptimised zip when engine rebuilds from ONNX
A ServerOptimised zip is a per-GPU cache of a previous engine build. When
the engine profile changes (batch gate, TRT/CUDA upgrade), the cached
engine inside it goes stale: every re-extract (e.g. after Temp cleanup)
restores the old engine and costs a full ONNX rebuild, forever, because
the server only regenerates the zip when the file is missing.

Engine now records rebuiltFromOnnx() + engineFilePath() in
buildLoadNetwork (set only on the generate-from-ONNX branch; cache hits
and alternative-precision loads don't raise it). After a rebuild,
ANSFaceRecognizer::Initialize deletes the stale same-GPU engine variants
from the model folder and the supplied optimised zip, so the server's
next optimize pass recreates it with the fresh engine.

Safety: only zips whose parent folder is ServerOptimised/-ized qualify —
base model zips can never match. Engine purge is scoped to the
"<model>.engine.<GPU>." prefix, leaving other GPUs' engines intact on
multi-GPU machines. All deletes are best-effort (error_code); multi-GPU
pool paths never set the flag, so the purge is a no-op there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-21 11:21:48 +10:00
..
2026-03-28 19:56:39 +11:00
2026-04-24 17:10:29 +10:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-04-24 17:10:29 +10:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00
2026-03-28 19:56:39 +11:00