microsoft / microsoft/onnxruntime
Can onnxruntime use memory mapped file to minimize RAM use for loading ort model?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 179
Description
Is your feature request related to a problem? Please describe.
Currently loading an ort model seems to consume all the RAM on the device, which causes sometimes memory limit to exceed.
System information
- ONNX Runtime version (you are using): 1.8.0
Describe the solution you'd like
If onnxruntime can use a memory-mapped file when accessing the ort model file, it does not have to allocate RAM for the ort model file but just accessing it directly from the file. This may also reduce loading time.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by tracing ONNX Runtime’s model-loading path and establish how ORT models are currently read; done means defining and validating memory-mapped loading that reduces RAM use without breaking inference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- machine-learning, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100