as_symmetric: deduplicate repeated imports of the same tensor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 202
- Forks
- 47
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 4
Description
Problem
Calling as_symmetric() twice on the same external tensor (or on tensors backed by the same physical allocation) repeats all the work with no deduplication:
- DMA-BUF export/import/map — full
export_dmabuf_handle→mem_import_from_shareable_handle→mem_map→mem_set_accesscycle each call - VA space consumption — each call bumps
current_offset, burning heap VA space for a redundant mapping to the same physical memory - Collective peer refresh —
refresh_peer_access()fires every time, triggering TCP FD exchange + barriers across all ranks
Suggested fix
Add a lookup in VMemAllocator.import_external_tensor() keyed on alloc_base (from get_address_range). If the same physical allocation was already imported, return a view into the existing VA mapping at the correct offset instead of creating a new one.
Should also batch refresh_peer_access() — if the same segments are already mapped on peers, skip the re-exchange.
References
iris/allocators/vmem_allocator.py:220-296—import_external_tensoriris/symmetric_heap.py:276-298—as_symmetric+ unconditionalrefresh_peer_access()
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
Start with iris/allocators/vmem_allocator.py:220-296 and inspect import_external_tensor(), including get_address_range and alloc_base handling. Then read iris/symmetric_heap.py:276-298 to trace as_symmetric() and refresh_peer_access(). Done means repeated imports reuse the existing VA mapping and avoid redundant peer refresh exchanges.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100