Skip to content

[9.3] [GPU] Handle segments too big for MSAI segment access (#141872)#142210

Merged
ldematte merged 1 commit intoelastic:9.3from
ldematte:backport/9.3/pr-141872
Feb 10, 2026
Merged

[9.3] [GPU] Handle segments too big for MSAI segment access (#141872)#142210
ldematte merged 1 commit intoelastic:9.3from
ldematte:backport/9.3/pr-141872

Conversation

@ldematte
Copy link
Copy Markdown
Contributor

Backports the following commits to 9.3:

MSAI (MemorySegmentAccessInput) provides access to an index input via file memory mapping, returning a MemorySegment.
However, MemorySegmentAccessInput may return null under some circumstances; in our usage, where we try to get a memory mapping for the whole file, it would fail if the file is too big (where "too big" is currently set at 16GB).

This PR adds a fallback for this situation; if we fail to get a MemorySegment from MemorySegmentAccessInput, we assume the input as a whole is too big, and we fall back to using a temp file. Data is copied over to the temp file, and we use the FileChannel Java API directly to map the whole file.
Using a temp file is necessary; if the input as a whole is too big (> 16G) we cannot reliably use directly on or off-heap memory, we need "something" to back that memory in case the OS needs to page it out (e.g. in the likely event we exceed the physical memory available).

Closes elastic#141746
@ldematte ldematte added :Search Relevance/Vectors Vector search >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch test-gpu Run tests using a GPU labels Feb 10, 2026
@ldematte ldematte merged commit 3c5108b into elastic:9.3 Feb 10, 2026
36 of 37 checks passed
@ldematte ldematte deleted the backport/9.3/pr-141872 branch February 10, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch test-gpu Run tests using a GPU v9.3.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants