[Issue]: Improve the Iris allocator
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 202
- Forks
- 47
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 4
Description
Problem Description
Iris currently implements a very simple bump allocator with a noop deallocate. See:
https://github.com/ROCm/iris/blob/f7876ba15db4992e90184861f538526087c3288a/iris/iris.py#L266-L267
This causes out-of-memory errors and memory usage going up all the time. There were two solutions in mind (please suggest others as well):
- Implement a better allocator in Python (from a simple free-list to more complex ones),
- Use a Python-bindings around a C/C++ allocator (e.g., dlmalloc.cpp)
A simple free-list of tensors will likely be sufficient and is probably the easiest approach for now. Since it's still unclear how Iris will integrate with inference frameworks, the level of effort we should invest in this is uncertain. Use your best judgment when deciding how far to take the implementation. Feel free to discuss here or offline.
See initial freelist implementation here: https://gist.github.com/maawad/763c981d3caeeca012858ee45fa1803b A solution using an ordered map would be better.
We will need a C++ implementation.
Operating System
Any
CPU
Any
GPU
Any
ROCm Version
Any
ROCm Component
No response
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
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 current allocator is referenced at iris/iris.py#L266-L267; start there, then compare the linked freelist gist and rocSHMEM's dlmalloc.cpp. Define the C++ allocator scope and validate that deallocation prevents the reported memory growth and out-of-memory behavior; the issue does not specify tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100