Skip to content

Commit 9cac78f

Browse files
committed
fix(sidecar): sweep stale p2p key references from comments and specs
The kv_transfer_params nesting key is remote_kv_source; comments and test descriptions that still call it the p2p key or p2p params read as if the secondary-tier type (p2p, unchanged) were the request-field key. Signed-off-by: nilig <nili.ifergan@gmail.com>
1 parent 8b389d4 commit 9cac78f

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

pkg/sidecar/proxy/connector_nixlv2_p2p_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var _ = Describe("NIXL Connector with P2P pull", func() {
103103
// NIXL fields still drive the NixlConnector under MultiConnector.
104104
Expect(kv).To(HaveKeyWithValue(requestFieldDoRemoteDecode, true))
105105
Expect(kv).To(HaveKeyWithValue(requestFieldDoRemotePrefill, false))
106-
// The p2p block drives the OffloadingConnector's cached-prefix pull.
106+
// The remote_kv_source block drives the OffloadingConnector's cached-prefix pull.
107107
p2p, ok := kv[requestFieldP2PParams].(map[string]any)
108108
Expect(ok).To(BeTrue())
109109
Expect(p2p[requestFieldKVRequestID]).ToNot(BeEmpty())
@@ -157,7 +157,7 @@ var _ = Describe("NIXL Connector with P2P pull", func() {
157157
body, _ := io.ReadAll(resp.Body) //nolint:errcheck
158158
Expect(resp.StatusCode).To(Equal(http.StatusOK), string(body))
159159

160-
// Prefill leg keeps the NIXL WRITE fields and gains the composed p2p block.
160+
// Prefill leg keeps the NIXL WRITE fields and gains the composed remote_kv_source block.
161161
pkv := kvParams(env.prefillHandler, 0)
162162
Expect(pkv).To(HaveKeyWithValue(requestFieldDoRemoteDecode, true))
163163
p2p, ok := pkv[requestFieldP2PParams].(map[string]any)

pkg/sidecar/proxy/connector_p2p.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,20 @@ func (s *Server) handleP2PConcurrentRequests(w http.ResponseWriter, r *http.Requ
213213
// KVConnector is offloading, or is composed alongside NIXL via MultiConnector
214214
// (declared with --enable-p2p-pull) when the PD connector is NIXLv2. On any
215215
// other connector --enable-p2p-pull has no effect, since no MultiConnector
216-
// routes the p2p params to an OffloadingConnector.
216+
// routes the remote_kv_source params to an OffloadingConnector.
217217
func (s *Server) p2pPullAvailable() bool {
218218
return s.config.KVConnector == KVConnectorOffloading ||
219219
(s.config.EnableP2PPull && s.config.KVConnector == KVConnectorNIXLV2)
220220
}
221221

222-
// addP2PPullToPrefill adds the OffloadingConnector p2p pull block to a prefill
222+
// addP2PPullToPrefill adds the OffloadingConnector P2P pull block to a prefill
223223
// leg's kv_transfer_params so the prefiller pulls cached prefix from
224224
// kvCacheSource while keeping its own computed blocks available for the
225225
// decoder. It is a no-op when no source is set or the source resolves to the
226-
// prefiller itself, since there is nothing to pull from oneself. The p2p key
227-
// composes with NIXL params: vLLM's MultiConnector routes it to the
228-
// OffloadingConnector and the NIXL fields to the NixlConnector.
226+
// prefiller itself, since there is nothing to pull from oneself. The
227+
// remote_kv_source key composes with NIXL params: vLLM's MultiConnector
228+
// routes it to the OffloadingConnector and the NIXL fields to the
229+
// NixlConnector.
229230
func (s *Server) addP2PPullToPrefill(prefillKVParams map[string]any, kvCacheSource, prefillPodHostPort string) {
230231
if kvCacheSource != "" && extractHost(kvCacheSource) != extractHost(prefillPodHostPort) {
231232
prefillKVParams[requestFieldP2PParams] = s.p2pSourceParams(kvCacheSource)

pkg/sidecar/proxy/connector_p2p_source_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var _ = Describe("P2P KV cache source header", func() {
7373
return sendBody(proxyBaseAddr, chatCompletionsRequestBodyWithMaxCompletionTokens, headers)
7474
}
7575

76-
It("should inject p2p params on the local request without disaggregation", func() {
76+
It("should inject remote_kv_source params on the local request without disaggregation", func() {
7777
proxyBaseAddr := testInfo.startProxy()
7878

7979
sendRequest(proxyBaseAddr, map[string]string{routing.KVCacheSourceHeader: kvCacheSource})
@@ -99,7 +99,7 @@ var _ = Describe("P2P KV cache source header", func() {
9999
<-testInfo.stoppedCh
100100
})
101101

102-
It("should add p2p params to the prefill leg under disaggregation", func() {
102+
It("should add remote_kv_source params to the prefill leg under disaggregation", func() {
103103
proxyBaseAddr := testInfo.startProxy()
104104

105105
prefillHostPort := testInfo.prefillBackend.URL[len("http://"):]
@@ -162,7 +162,7 @@ var _ = Describe("P2P KV cache source header", func() {
162162
<-testInfo.stoppedCh
163163
})
164164

165-
It("should not inject p2p params without the header", func() {
165+
It("should not inject remote_kv_source params without the header", func() {
166166
proxyBaseAddr := testInfo.startProxy()
167167

168168
sendRequest(proxyBaseAddr, nil)
@@ -198,7 +198,7 @@ var _ = Describe("P2P KV cache source header", func() {
198198
Expect(decodeReqs).To(HaveLen(1))
199199
kvParams, ok := decodeReqs[0][requestFieldKVTransferParams].(map[string]any)
200200
Expect(ok).To(BeTrue())
201-
// Only the sidecar-owned p2p key survives; the client's keys are gone.
201+
// Only the sidecar-owned remote_kv_source key survives; the client's keys are gone.
202202
Expect(kvParams).To(HaveLen(1))
203203
p2p, ok := kvParams[requestFieldP2PParams].(map[string]any)
204204
Expect(ok).To(BeTrue())
@@ -221,7 +221,7 @@ var _ = Describe("P2P KV cache source header", func() {
221221
<-testInfo.stoppedCh
222222
})
223223

224-
It("should not inject p2p params when the source is the local pod", func() {
224+
It("should not inject remote_kv_source params when the source is the local pod", func() {
225225
GinkgoT().Setenv("POD_IP", "10.9.9.9")
226226
proxyBaseAddr := testInfo.startProxy()
227227

0 commit comments

Comments
 (0)