mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4149] [Engine] keep configured vision resident during calibration #4922
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4922
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4149
Author: @Tsury
Created: 10/25/2026
Status: 🔄 Open
Base:
main← Head:fix/calibrate-vision-2301-r2📝 Commits (2)
a68573a[Engine] keep configured vision resident during calibrationc397f5b[Engine] apply serving's vram_elastic rule to the calibration encoder📊 Changes
2 files changed (+138 additions, -21 deletions)
View changed files
📝
tools/calibrate.py(+35 -21)📝
tools/test_calibrate.py(+103 -0)📄 Description
Problem and result
With a configured vision encoder, calibration starts the engine without that encoder. Automatic expert-cache sizing therefore measures different free VRAM from normal serving. The #2301 measurement showed 8343 slots / 16202 MiB in calibration versus 7615 slots / 14786 MiB in image-enabled serving on the same configuration.
After this change, calibration starts the configured encoder before the first engine start, keeps it through every tuner restart, then releases it and its log on success or failure. It also applies serving's rule that
"elastic": trueneeds"vram_elastic": true; otherwise the encoder starts with the model, in calibration as in serving.Related discussion
Fixes #2301. Replaces #2312: its
/reopencheck passed, but GitHub refused to reopen it (https://github.com/Niko1221/Strata/pull/2312#issuecomment-6310187409), so this is the linked new PR the bot suggested.The elastic case from review (https://github.com/Niko1221/Strata/pull/2312#issuecomment-6184304034) is now covered: the second commit copies
serve/server.py'svram_elasticcheck before constructingVision.Approach
Use the existing
Vision, serving's relative-path handling andvision_env, with oneExitStackfor cleanup. Text-only configurations and caller-supplied engine factories keep their current lifetime. No calibration setting, sweep, threshold or default changes.Validation
Revision
c397f5b9, rebased onto main4b9e05a2(v0.2.6). Linux x86_64, Python 3.14; pure tests with stand-in encoders and engines.Passed:
python -m unittest tools.test_calibrate: 37 tests pass (30 existing, 7 vision-lifetime cases).test_elastic_follows_the_servers_vram_elastic_rulefails without the second commit (True is not False) and passes with it.git diff --check origin/main HEAD: clean.Failed:
None observed.
Not run:
Limits
Pure tests establish control flow and cleanup, not GPU sizing on other platforms. CPU vision, other GPUs and multi-GPU configurations were not measured.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.