Pull requests / #2286
#2286 fix(vision): retain image ownership through request preparation
open · @Tsury · 0 comments · View on GitHub
Server & APIAMD / HIPModels & quants
Description
The current image cache keeps records during encode_all, but releases the service FIFO before preparing the combined embedding file. Another request can evict those files between encoding and stat/copy. A refused request with more than 64 cached images can also leave the cache above its bound. Keep the FIFO and a reentrant image batch lock through encoding, validation and combined-file copying. Defer eviction to the outermost batch's finally block. Preserve combined-file ownership and trim back to 64 afterward. Close encoder pipes during teardown and clean failed startup. On the specific native decoder refusal, retry once through the existing Pillow normalization path; conversion failures retain temporary-file cleanup. Based on main `a0116b2782a5b82622358c04a06496485d12b2d6`. #1072/#1207 addressed retention during encoding; the stock source still exposes the interval through combined-copy. This PR covers that remaining ownership interval instead of duplicating the shipped encode_all change. Validation: 20 focused model-free vision tests pass. The nine cache-lifetime methods fail on stock for eviction/copy ordering or failure-path bounds. Scheduled two-request races check the real cache and copy boundary, with no GPU/model. Existing image marker, temporary-file and shutdown checks pass. The normalization retry tests isolate protocol behavior; they do not qualify a new image decoder. Command: `python3 -m unittest serve.test_vision_cache serve.test_server.VisionDecode serve.test_server.ImageMarkers serve.test_server.VisionTempFiles serve.test_server.VisionShutdown`. No new device build, GPU campaign or deployment. The longer FIFO hold protects request ownership; its throughput cost is unmeasured.
Related on strata.com
Editorial links to help you install, pick models, or read release notes — not part of the upstream thread.