Skip to content

[DSV4.1][PD][3/N] Avoid host synchronization in DeepSeek V4.1 CP prefill - #40335

Closed
BJWang-ant wants to merge 1 commit into
sgl-project:mainfrom
BJWang-ant:main-v4.1-cp-bcg-opt-sync
Closed

BJWang-ant wants to merge 1 commit into
sgl-project:mainfrom
BJWang-ant:main-v4.1-cp-bcg-opt-sync

Conversation

@BJWang-ant

@BJWang-ant BJWang-ant commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

issue:#39700
base pr:#40333

Summary

image image The DeepSeek V4.1 CP prefill indexer introduces host synchronization when uploading CPU metadata and indexing the request-to-token table with a CUDA scalar. These waits prevent the CPU from submitting subsequent work asynchronously.
  • Upload query lengths and key offsets through the existing pinned-memory, non-blocking transfer helper.
  • Keep request indices as one-dimensional CUDA tensors to avoid implicit device-to-host scalar reads.
  • Add a regression test that rejects CUDA scalar reads during mixed-length prefill, including requests with zero query tokens.

perf

image

CI States

Latest PR Test (Base): ❌ Run #35436933948
Latest PR Test (Extra): ❌ Run #35436933799
Latest PR Test (AMD ROCm 10): ❌ Run #35436933971

@BJWang-ant BJWang-ant mentioned this pull request Sep 19, 2026
2 tasks done
@BJWang-ant
BJWang-ant force-pushed the main-v4.1-cp-bcg-opt-sync branch from b79508d to 5105960 Compare September 19, 2026 10:16
@Oasis-Git Oasis-Git mentioned this pull request Oct 2, 2026
17 of 56 tasks
@BJWang-ant

Copy link
Copy Markdown
Contributor Author

#41125 same work

@BJWang-ant BJWang-ant closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Multi-modal multi-modal language model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant