Skip to content

Handle NIXL abort notifications - #30352

Merged
ishandhanani merged 3 commits into
sgl-project:mainfrom
yichaolemon:codex/nixl-abort-notifications
Jul 13, 2026
Merged

ishandhanani merged 3 commits into
sgl-project:mainfrom
yichaolemon:codex/nixl-abort-notifications

Conversation

@yichaolemon

@yichaolemon yichaolemon commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

NIXL disaggregation can receive a decode-side abort while the prefill transfer worker is still finishing a KV/aux transfer. Without handling the abort prefill bootstrap_thread can fail with assertion error ('ABORT' not recognized). Follow up to #27372 that initially introduced abort msg

Modifications

  • Handle ABORT messages on the NIXL prefill bootstrap socket and mark incomplete rooms as Failed.
  • Keep NIXL Failed status sticky until the sender clears the room.
  • Do not send ABORT_ACK on the NIXL path yet; there is no defined NIXL quiescence/deferred-release contract for safely acknowledging decode-side buffer release, so this PR leaves a TODO instead.
  • Add CPU unit coverage for abort handling, sticky failed status, and mid-transfer abort races.

Accuracy Tests

Not applicable; this only changes disaggregation control-plane state handling.

Speed Tests and Profiling

Not applicable; no inference hot path changes.

Checklist


CI States

Latest PR Test (Base): ❌ Run #28922034696
Latest PR Test (Extra): ❌ Run #28922034519

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@yichaolemon
yichaolemon marked this pull request as ready for review July 7, 2026 06:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Comment on lines +636 to +639
if (
bootstrap_room in self.request_status
and self.request_status[bootstrap_room] == KVPoll.Failed
):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be shorten to if self.request_status.get(bootstrap_room) == KVPoll.Failed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Comment on lines +2344 to +2348
self.update_status(room_to_be_aborted, KVPoll.Failed)
logger.debug(
f"Received abort notification for room {room_to_be_aborted}, "
f"marked as Failed"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe record failure here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +2333 to +2334
if len(msg) != 4:
raise ValueError(f"expected 4 frames, got {len(msg)}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be covered in the following except block

Comment on lines +376 to +381
mgr = self._make_manager({13: KVPoll.WaitingForInput})

handled = mgr._handle_abort_notification([b"ABORT", b"13"])

self.assertTrue(handled)
self.assertEqual(mgr.request_status[13], KVPoll.WaitingForInput)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b"13" has poor readability, maybe change it to b"unvalid-room"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ShangmingCai ShangmingCai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others Look good. cc: @ishandhanani

@yichaolemon
yichaolemon requested a review from ShangmingCai July 7, 2026 16:59
if len(msg) != 4:
raise ValueError(f"expected 4 frames, got {len(msg)}")
room_to_be_aborted = int(msg[1].decode("ascii"))
_, room_frame, _, _ = msg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also not needed; just use msg[sub_id] directly, and catch the error in except Exception as e in this block

@ShangmingCai ShangmingCai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing the remaining issue, no other comment from me, CC @ishandhanani, please check and help continue the approving and merging procoess of this PR.

@iyastreb

iyastreb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

#30301 is fixing the same issue?
I we merge this fix, that one can be closed I think

@ishandhanani
ishandhanani merged commit a74bee2 into sgl-project:main Jul 13, 2026
94 of 108 checks passed
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants