Skip to content

fix(npu): unblock async FFN teardown - #260

Open
ShwStone wants to merge 1 commit into
vllm-project:mainfrom
ShwStone:fix/npu-async-ffn-shutdown-sentinel
Open

fix(npu): unblock async FFN teardown#260
ShwStone wants to merge 1 commit into
vllm-project:mainfrom
ShwStone:fix/npu-async-ffn-shutdown-sentinel

Conversation

@ShwStone

@ShwStone ShwStone commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a full one-token CAM dispatch/combine shutdown handshake, using an out-of-range layer index as an unambiguous wire marker
  • keep async FFN ranks receiving until they acknowledge the shutdown sentinel, then close HCCL only after the daemon exits
  • preserve close-before-join for control-plane connectors and defer unsafe cleanup when the async handshake cannot complete
  • add focused connector, model-runner, and worker lifecycle regression coverage

Testing

  • NPU async E2E: afd-eager-async-cam
  • NPU async E2E: afd-async-ubatch
  • CPU-only CI: lint
  • DCO

Closes #251

Idle CAM async FFN ranks wait in async_dispatch_recv during teardown. Closing HCCL while that receive is in flight can hang the worker and turn an otherwise successful E2E run into a cleanup failure.

Use a full one-token CAM dispatch/combine shutdown handshake. Attention sends an out-of-range-layer marker and waits for the FFN dummy combine acknowledgement. FFN keeps its connector-driven loop alive despite a local shutdown event, acknowledges the marker without model execution, and exits only after the CAM transaction completes.

Apply join-before-close only to CAMAsyncAFDConnector while preserving close-before-join for control-plane connectors. If the handshake or bounded daemon join fails, defer unsafe connector and model cleanup, and keep async shutdown errors observable.

Add regression coverage for the wire marker, acknowledgement, shutdown races, connector-specific close ordering, timeout retry, and failure propagation. Document the teardown-only cost and removal path once CAM supports cancelling a pending receive.

Fixes vllm-project#251

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: ShwStone <HaowenShi@outlook.com>
@ShwStone
ShwStone force-pushed the fix/npu-async-ffn-shutdown-sentinel branch from e78c52e to 03b57b3 Compare August 20, 2026 06:30
@ShwStone
ShwStone marked this pull request as ready for review August 20, 2026 08:36
Copilot AI lite review requested due to automatic review settings August 20, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jiangkuaixue123 jiangkuaixue123 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.

Overall, this PR introduces a significant amount of shutdown-specific logic into the runtime, including a custom sentinel protocol, additional state handling, and different cleanup paths for different connector types. The resulting lifecycle is fairly complex and may be difficult for future maintainers to understand and reason about.

Could we consider addressing this in the test runner or E2E test cleanup instead—for example, by tolerating or handling forced termination during teardown—rather than adding a new shutdown protocol to the production runtime? That may provide a simpler and more maintainable solution to the original test failure.

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.

NPU async E2E teardown always fails pytest

3 participants