microsoft / microsoft/onnxruntime

[Feature Request] Universal cache invalidation

Open
#27,487 2 comments 1 reaction 0 assignees View on GitHub
ep:CoreML ep:MIGraphX feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

From my research only TensorRT has proper cache invalidation, once onnxruntime has been updated the outdated caches are causing onnxruntime to crash.

| EP | Auto-invalidation | Version Detection |
|---|---|---|
| TensorRT (ORT 1.20+) | Yes | Runtime |
| MIGraphX | Partial | Compile-time |
| CoreML | No | None |

For now I use this workaround.

```python
import os
import onnxruntime

cache_path = os.path.join('.caches', onnxruntime.get_version_string())

session = onnxruntime.InferenceSession('model.onnx', providers = [('CoreMLExecutionProvider',
{
'ModelCacheDirectory': cache_path
})])
```

### Describe scenario use case

I recommend a universal solution to handle caches, it should not be EP specific.

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are identified. Start by comparing the listed execution providers and their current cache behavior, using the Python workaround as the concrete scenario. Done means stale caches are invalidated through a universal solution rather than provider-specific handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.