Repository navigation
nemotron cuda: a failed ring read mid-batch no longer hangs deinit; end-of-file tests for every uncached reader - #2608
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/nemotron-ring-hang
branch
2 times, most recently
from
November 8, 2026 21:23
24af334 to
1e1645e
Compare
…eir span Every read loop of our own under O_DIRECT, F_NOCACHE, io_uring, native AIO or an aligned span now has a test whose file ends inside the span it asks for (shortened after open): row block and state files, Engram rows in every reader mode, session restore spans, the Qwen-VL tower and GLM's rewritten tensors. Each stops with a named error and serves nothing past the end. GLM's load-copy test, which no build step reached, is now imported from glm.zig, so paced_read's end-of-file case runs too. A new test, failing on main, shortens a Nemotron shard under two io_uring reads that complete in one batch. reap returns at the first failed read, so the other read stays counted in flight with no completion left, and Source.deinit's reap would wait for it forever. The fix is not in this change.
…aiting forever reap takes a batch of completions off the io_uring ring, then read-finishes and copies them one by one. A read or copy that failed returned from the loop at once, so the batch's later completions were never counted: their slots stayed pending, in_flight stayed above zero, and Source.deinit's reap(1) waited for completions already taken. A shard that shrank after open was enough. Every completion is now counted before any read or copy can fail; the first error still returns as before.
ashhart
force-pushed
the
lead/nemotron-ring-hang
branch
from
November 8, 2026 21:32
1e1645e to
dcd8c12
Compare
8 tasks 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.
A hang in Nemotron's io_uring checkpoint reads.
Source.reap(families/nemotron/cuda_source.zig) takes a batch of completions off the ring, then read-finishes and copies them one by one. A read or copy that failed returned from the loop at once, so the batch's later completions were never counted: their slots stayed pending,in_flightstayed above zero, andSource.deinit'sreap(1)waited for completions already taken off the ring. A shard that shrank after open was enough to reach it. Every completion is now counted before any read or copy can fail; the first error still returns as before.End-of-file tests for every reader that skips the page cache or reads aligned spans. An audit of the read loops that use O_DIRECT, F_NOCACHE, io_uring, AIO or aligned spans outside
core/direct_iofound the one hang above; every other loop stops with a named error and copies nothing past the end. Tests now cover the cases that had none, each with a file shortened after open: Nemotron's ring batch (cuda_source_ring_test.zig), row block and state files (core/rows_file.zig), Engram rows in every reader mode (deepseek_v41/engram_rows_test.zig), session restore spans (sessions/lanes.zig) and Qwen-VL tower reads (core/qwen_vl/shards.zig). GLM's load-copy test (glm/weights_fix_test.zig) was reached by no build step; it is now imported, and gains a rewritten-tensor case.Checks (Linux aarch64, ext4)
test-dsv41-shared,test-sessions,test-rows-host,test-qwen-vl-shards-host: pass with and without the fix (those readers were already correct; the new tests pin it), including Engram's off-sector retry and session restore's short span, which return the named short read on this kernel.test-cuda-hostotherwise: only the twodrama_voice_tooldirectory-permission tests fail, identically on main there, because that machine runs tests as root.zig fmt --checkclean; every touched file within 600 lines.