perf(tagger): multi-thread CPU inference instead of pinning to one core
The ONNX session was built with intra_threads(1) unconditionally. That's correct for DirectML (compute is on the GPU), but on the CPU execution provider it pinned all matmul/conv work to a single core — ~1.78s/image, ~14s for an 8-image batch. Derive the intra-op thread count from available_parallelism() for the CPU EP (leaving 2 logical cores free for the UI and a possible concurrent scan; tagging is the lowest-priority worker, so heavier workers are idle when it runs). DirectML/Auto keep a single thread. Measured ~2.7x on a representative machine (14s -> 5.3s per 8-image batch); sublinear because swinv2 inference is memory-bandwidth-bound. The selected thread count is logged at load.
This commit is contained in:
@@ -59,6 +59,10 @@ aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
||||
- **Explore cluster layout** — clusters are now sized by image count (busier
|
||||
clusters are larger and stack on top) and repositioned to avoid overlapping, so
|
||||
every cluster stays viewable and clickable even in dense libraries.
|
||||
- **Faster CPU tagging** — when AI tagging runs on the CPU provider (no usable
|
||||
GPU) it now uses multiple cores instead of being pinned to one, several times
|
||||
faster on multi-core machines. A couple of cores are left free so the rest of
|
||||
the app stays responsive. GPU (DirectML) tagging is unchanged.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user