Repository navigation
umbp: hugepage-backed ranged scratch arenas - #830
Merged
Merged
Conversation
…page limit Each ranged scratch arena (GET and PUT) is plain 4 KiB anonymous memory registered as ONE RDMA memory region. On AINIC (ionic) that caps its size: - above 2^19 entries (2 GiB at 4 KiB pages) ibv_reg_mr fails with ENOMEM, mori falls back to dmabuf export, and hipMemRetainAllocationHandle segfaults on the host pointer. With registration lazy, the standalone server dies on its first remote put. - between 2^18 and 2^19 entries (1-2 GiB) the region registers, but the NIC translates only the first 2^18 entries: RDMA past 1 GiB silently lands 1 GiB lower. So today the arena cannot safely exceed 1 GiB, which is what limited scaling the ranged GET shard count. - ranged_scratch_use_hugepages / ranged_scratch_hugepage_size back both arenas with hugetlb pages (2 MiB: one region translates up to 512 GiB), falling back to 4 KiB pages like the SSD staging arena does. - ranged_scratch_max_mr_pages (default 2^18; 0 disables) rejects an arena that spans more pages than that at startup, measured on the pages actually mapped so a hugepage request that fell back is caught too. - Standalone server env: UMBP_DISTRIBUTED_RANGED_SCRATCH_USE_HUGEPAGES, _HUGEPAGE_SIZE, _MAX_MR_PAGES; pybind fields of the same names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The staging arena is one buffer registered as one RDMA region, default 4 GiB, and staging hugepages silently fall back to 4 KiB pages. With an RDMA engine that region is over ionic's 2^19 entries and the first remote access segfaults in the dmabuf fallback, like the ranged scratch arenas. - Rename ranged_scratch_max_mr_pages -> max_mr_pages (UMBP_DISTRIBUTED_MAX_MR_PAGES): one limit for every NIC region. - SsdBackend::Init rejects a staging arena over max_mr_pages, measured on the pages actually mapped; PoolClient passes the limit only when io_engine.host builds an RDMA engine. - test_ssd_backend: InitRejectsAStagingArenaOverMaxMrPages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
E2E on AINIC: 4 GiB / 32-shard ranged scratch on 2 MiB hugepages ran 15 min of warmup plus 40 min of profiling (14.1 TiB of ranged GETs) on a cross-node DSv4 run, with 0 transfer, CQE or registration errors. The same config on 4 KiB pages segfaulted on the first remote put. Throughput matched the 512 MiB / 8 baseline within noise (251.7k vs 249.9k input tok/s over the same 40 min). |
A NIC's per-region translation limit changes with firmware and driver, so UMBP should not encode one. Remove max_mr_pages (UMBP_DISTRIBUTED_MAX_MR_PAGES) and its startup checks on the ranged scratch and SSD staging arenas. Keep hugepage-backed ranged scratch and the startup line that shows which page size was actually mapped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Each ranged scratch arena (GET and PUT,
ranged_scratch_sizeeach) is one host buffer registered as one RDMA memory region, on plain 4 KiB anonymous pages. A region's translation entries are its pages, and NICs cap entries per region, so a large 4 KiB-page arena can be more than the NIC takes.We hit this on AINIC raising
UMBP_DISTRIBUTED_RANGED_SCRATCH_BYTESto 4 GiB / 32 shards (and 8 GiB / 32 on another node pair) to cut ranged-GET shard wait, which was 24% of ranged GET time on a cross-node DSv4 run.ibv_reg_mrfailed, andRegisterRdmaMemoryRegionAuto's dmabuf fallback segfaulted on the host pointer (rdma: name likely causes in fatal MR registration errors; document the HIP non-VMM retain crash #821).Change
ranged_scratch_use_hugepages/ranged_scratch_hugepage_size: back both scratch arenas with hugetlb pages, which on 2 MiB pages means 512x fewer entries per region. Falls back to 4 KiB pages when no hugetlb pages are free, as the SSD staging arena does.UMBP_DISTRIBUTED_RANGED_SCRATCH_USE_HUGEPAGESandUMBP_DISTRIBUTED_RANGED_SCRATCH_HUGEPAGE_SIZE; pybind fields of the same names;runtime-env-vars.mdrows.[DistributedClient] ranged scratch: 2 arenas x 4096 MiB, 2048 KiB pages (hugetlb).No size limit is hardcoded. A NIC's per-region limit changes with firmware and driver, so a region the NIC cannot take fails at registration (with #821, as an error instead of a segfault). An earlier revision of this PR added a
max_mr_pagesstartup check for the scratch and SSD staging arenas; it was removed for that reason.Defaults are unchanged: hugepages are off, and CI's 512 MiB scratch arenas behave as before.
Testing
test_umbp_pool_client_rangesat 6db3c20 on an MI355X + AINIC node (gfx950): 30/30 pass, includingDistributedScratchHugepageRequestFallsBack. That test requests an unusable hugepage size; the arena falls back to 4 KiB pages and the client still starts.-LE integration) at 6db3c20: 47/47 pass.ranged scratch: 2 arenas x 4096 MiB, 2048 KiB pages (hugetlb). They ran 15 min of warmup plus 40 min of profiling (14.1 TiB of ranged GETs) with 0 transfer, CQE or registration errors. The same 4 GiB / 32 config on 4 KiB pages crashed on the first remote put.🤖 Generated with Claude Code