Skip to content

feat(cli): warn on torch/onnxruntime version mismatch in export cache#219

Merged
rylinjames merged 3 commits into
FastCrest:mainfrom
mvanhorn:fix/47-export-cache-torch-ort-version
Jun 17, 2026
Merged

feat(cli): warn on torch/onnxruntime version mismatch in export cache#219
rylinjames merged 3 commits into
FastCrest:mainfrom
mvanhorn:fix/47-export-cache-torch-ort-version

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

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 current torch.__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.

… 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>
@mvanhorn mvanhorn requested a review from rylinjames as a code owner June 7, 2026 16:14
…orch-ort-version

# Conflicts:
#	tests/test_cli.py
rylinjames
rylinjames previously approved these changes Jun 17, 2026

@rylinjames rylinjames left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
rylinjames previously approved these changes Jun 17, 2026

@rylinjames rylinjames left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rylinjames left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after conflict fix and CI rerun. Local targeted checks passed: go_export_cache tests plus shadow rollout banner check.

@rylinjames rylinjames merged commit 019e7c7 into FastCrest:main Jun 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Reliability] Expand Export Cache Invalidation to Track Torch/ORT Versions

2 participants