Complete PJRT copy futures via event callbacks instead of awaiter threads - #681
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_965614436
branch
10 times, most recently
from
August 19, 2026 08:46
a3b0e7e to
c6cd39b
Compare
…eads PjRtCopyFuture::OnReady parked a detached thread in PJRT_Event_Await per in-flight copy; on the transfer receive path that is one short-lived thread per layer per transfer, and sustained decode-side load crashed schedulers with a segfault in the detach on the push-handler path. Register a PJRT_Event_OnReady callback per event instead, joined by a countdown that preserves the first error; completion callbacks now run on PJRT completion threads rather than a dedicated awaiter. Core dump before the CL: https://github.com/sgl-project/sglang-torchtpu/actions/runs/31962643994 ``` !!!!!!! Segfault encountered !!!!!!! File "<unknown>", line 0, in raise File "<unknown>", line 0, in pthread_detach File "<unknown>", line 0, in std::thread::detach() File "<unknown>", line 0, in tpu_raiden::KVCacheManagerWithTransfer::OnLayerReceived(unsigned long, unsigned long) File "<unknown>", line 0, in tpu_raiden::transport::BlockTransport::HandleIncomingPush(int, tpu_raiden::transport::lib::ChunkHeader const&) File "<unknown>", line 0, in tpu_raiden::transport::BlockTransport::HandleCustomRequest(int, tpu_raiden::transport::lib::ChunkHeader const&) File "<unknown>", line 0, in tpu_raiden::transport::lib::RawBufferTransport::ProcessPeerRequest(int) File "<unknown>", line 0, in tpu_raiden::transport::lib::RawBufferTransport::ConnectionWorker(int) File "<unknown>", line 0, in 0xffffffffffffffff ``` PiperOrigin-RevId: 967085230
copybara-service
Bot
force-pushed
the
test_965614436
branch
from
August 19, 2026 09:34
c6cd39b to
fd4754d
Compare
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.
Complete PJRT copy futures via event callbacks instead of awaiter threads
PjRtCopyFuture::OnReady parked a detached thread in PJRT_Event_Await per
in-flight copy; on the transfer receive path that is one short-lived
thread per layer per transfer, and sustained decode-side load crashed
schedulers with a segfault in the detach on the push-handler path.
Register a PJRT_Event_OnReady callback per event instead, joined by a
countdown that preserves the first error; completion callbacks now run
on PJRT completion threads rather than a dedicated awaiter.
Core dump before the CL:
https://github.com/sgl-project/sglang-torchtpu/actions/runs/31962643994