feat(cli): warn on torch/onnxruntime version mismatch in export cache#219
Conversation
… on mismatch Stores build-time torch and onnxruntime versions in cache metadata and warns at load when they differ from the current environment, so a stale/incompatible cached export isn't reused silently. Closes FastCrest#47 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…orch-ort-version # Conflicts: # tests/test_cli.py
rylinjames
left a comment
There was a problem hiding this comment.
Resolved current-main test conflict by keeping both the export-cache runtime-version tests and newer CLI tests. Targeted cache tests passed locally: 4 passed. Full local test_cli run aborts in unrelated Python 3.13 torch/transformers import path; GitHub CI covers supported versions.
rylinjames
left a comment
There was a problem hiding this comment.
Resolved current-main test conflict by keeping both the export-cache runtime-version tests and newer CLI tests. Targeted cache tests passed locally: 4 passed. Full local test_cli run aborts in unrelated Python 3.13 torch/transformers import path; GitHub CI covers supported versions.
rylinjames
left a comment
There was a problem hiding this comment.
Approved after conflict fix and CI rerun. Local targeted checks passed: go_export_cache tests plus shadow rollout banner check.
Summary
Export caches were reused even when the torch / onnxruntime versions had changed, which can silently produce a stale or incompatible cached artifact (#47). The CLI now records the build-time torch and ORT versions in the cache metadata and warns on a mismatch at load.
Changes
cli.py: capture currenttorch.__version__/onnxruntime.__version__(falling back to"unknown"when unavailable) and store them in the cache metadata; on load, compare against the cached values and emit a clear mismatch warning.Testing
PYTHONPATH=src python3 -m pytest tests/test_cli.py— 15 passed, including version-match (no warning) and version-mismatch (warns) cases.Closes #47
AI was used for assistance.