@@ -217,7 +217,7 @@ func createRequest(prompt string) *scheduling.LLMRequest {
217217 return & scheduling.LLMRequest {
218218 Body : & scheduling.LLMRequestBody {
219219 Completions : & scheduling.CompletionsRequest {
220- Prompt : prompt ,
220+ Prompt : scheduling. Prompt { Raw : prompt } ,
221221 },
222222 },
223223 }
@@ -257,16 +257,16 @@ func TestPdProfileHandler_Pick(t *testing.T) {
257257 {
258258 name : "decode not executed yet → run decode" ,
259259 nonCachedTokensLimit : 10 ,
260- prefixPluginType : prefix .PrefixCachePluginType ,
261- prefixPluginName : prefix .PrefixCachePluginType ,
260+ prefixPluginType : prefix .PrefixCacheScorerPluginType ,
261+ prefixPluginName : prefix .PrefixCacheScorerPluginType ,
262262 profileResults : map [string ]* scheduling.ProfileRunResult {},
263263 expectedProfiles : []string {defaultDecodeProfile },
264264 },
265265 {
266266 name : "decode failed (nil result) → run nothing" ,
267267 nonCachedTokensLimit : 10 ,
268- prefixPluginType : prefix .PrefixCachePluginType ,
269- prefixPluginName : prefix .PrefixCachePluginType ,
268+ prefixPluginType : prefix .PrefixCacheScorerPluginType ,
269+ prefixPluginName : prefix .PrefixCacheScorerPluginType ,
270270 profileResults : map [string ]* scheduling.ProfileRunResult {
271271 defaultDecodeProfile : nil ,
272272 },
@@ -275,8 +275,8 @@ func TestPdProfileHandler_Pick(t *testing.T) {
275275 {
276276 name : "all profiles already executed → run nothing" ,
277277 nonCachedTokensLimit : 10 ,
278- prefixPluginType : prefix .PrefixCachePluginType ,
279- prefixPluginName : prefix .PrefixCachePluginType ,
278+ prefixPluginType : prefix .PrefixCacheScorerPluginType ,
279+ prefixPluginName : prefix .PrefixCacheScorerPluginType ,
280280 profileResults : map [string ]* scheduling.ProfileRunResult {
281281 defaultDecodeProfile : newMockProfileRunResult (DefaultTestPodPort , "pod1" ),
282282 defaultPrefillProfile : newMockProfileRunResult (DefaultTestPodPort , "pod2" ),
@@ -289,8 +289,8 @@ func TestPdProfileHandler_Pick(t *testing.T) {
289289 // In this case: prompt length is 35 chars (8 tokens), cached length is 2 tokens -> disaggregated prefill should trigger
290290 nonCachedTokensLimit : 4 ,
291291 cachedTokens : 2 ,
292- prefixPluginType : prefix .PrefixCachePluginType ,
293- prefixPluginName : prefix .PrefixCachePluginType ,
292+ prefixPluginType : prefix .PrefixCacheScorerPluginType ,
293+ prefixPluginName : prefix .PrefixCacheScorerPluginType ,
294294 profileResults : map [string ]* scheduling.ProfileRunResult {
295295 defaultDecodeProfile : newMockProfileRunResult (DefaultTestPodPort , "pod1" ),
296296 },
@@ -302,8 +302,8 @@ func TestPdProfileHandler_Pick(t *testing.T) {
302302 // In this case: prompt length is 35 chars (8 tokens), cached length is 5 tokens -> skip prefill
303303 nonCachedTokensLimit : 4 ,
304304 cachedTokens : 5 ,
305- prefixPluginType : prefix .PrefixCachePluginType ,
306- prefixPluginName : prefix .PrefixCachePluginType ,
305+ prefixPluginType : prefix .PrefixCacheScorerPluginType ,
306+ prefixPluginName : prefix .PrefixCacheScorerPluginType ,
307307 profileResults : map [string ]* scheduling.ProfileRunResult {
308308 defaultDecodeProfile : newMockProfileRunResult (DefaultTestPodPort , "pod1" ),
309309 },
@@ -327,7 +327,7 @@ func TestPdProfileHandler_Pick(t *testing.T) {
327327 assert .NoError (t , err )
328328
329329 // set prefix to the given cached tokens number for pod "pod1" in decode profile results
330- inputTokens := len (request .Body .Completions .Prompt ) / AverageCharactersPerToken
330+ inputTokens := len (request .Body .Completions .Prompt . PlainText () ) / AverageCharactersPerToken
331331
332332 for profileName , profileRes := range tt .profileResults {
333333 if profileName == defaultDecodeProfile && profileRes != nil {
@@ -377,7 +377,7 @@ func TestPdProfileHandler_PickSeries(t *testing.T) {
377377 expectedProfiles : []string {defaultPrefillProfile },
378378 }, {
379379 request : request ,
380- cachedTokens : len (request .Body .Completions .Prompt ) / AverageCharactersPerToken ,
380+ cachedTokens : len (request .Body .Completions .Prompt . PlainText () ) / AverageCharactersPerToken ,
381381 expectedProfiles : []string {},
382382 }},
383383 }, {
@@ -391,7 +391,7 @@ func TestPdProfileHandler_PickSeries(t *testing.T) {
391391 expectedProfiles : []string {defaultPrefillProfile },
392392 }, {
393393 request : longerRequest ,
394- cachedTokens : len (request .Body .Completions .Prompt ) / AverageCharactersPerToken ,
394+ cachedTokens : len (request .Body .Completions .Prompt . PlainText () ) / AverageCharactersPerToken ,
395395 expectedProfiles : []string {},
396396 }},
397397 }, {
@@ -405,7 +405,7 @@ func TestPdProfileHandler_PickSeries(t *testing.T) {
405405 expectedProfiles : []string {defaultPrefillProfile },
406406 }, {
407407 request : longRequest ,
408- cachedTokens : len (request .Body .Completions .Prompt ) / AverageCharactersPerToken ,
408+ cachedTokens : len (request .Body .Completions .Prompt . PlainText () ) / AverageCharactersPerToken ,
409409 expectedProfiles : []string {defaultPrefillProfile },
410410 }},
411411 },
@@ -419,8 +419,8 @@ func TestPdProfileHandler_PickSeries(t *testing.T) {
419419 handler , err := NewPdProfileHandler (
420420 defaultPrefillProfile ,
421421 defaultDecodeProfile ,
422- prefix .PrefixCachePluginType ,
423- prefix .PrefixCachePluginType ,
422+ prefix .PrefixCacheScorerPluginType ,
423+ prefix .PrefixCacheScorerPluginType ,
424424 0 ,
425425 deciderPlugin ,
426426 )
@@ -431,7 +431,7 @@ func TestPdProfileHandler_PickSeries(t *testing.T) {
431431 cs := & scheduling.CycleState {}
432432
433433 // set prefix to the given cached tokens number for pod "pod1" in decode profile results
434- inputTokens := len (innerTest .request .Body .Completions .Prompt ) / AverageCharactersPerToken
434+ inputTokens := len (innerTest .request .Body .Completions .Prompt . PlainText () ) / AverageCharactersPerToken
435435
436436 for profileName , profileRes := range profileResults {
437437 if profileName == defaultDecodeProfile && profileRes != nil {
@@ -519,8 +519,8 @@ func TestPdProfileHandler_ProcessResults(t *testing.T) {
519519 handler , err := NewPdProfileHandler (
520520 defaultPrefillProfile ,
521521 defaultDecodeProfile ,
522- prefix .PrefixCachePluginType ,
523- prefix .PrefixCachePluginType ,
522+ prefix .PrefixCacheScorerPluginType ,
523+ prefix .PrefixCacheScorerPluginType ,
524524 tt .primaryPort ,
525525 deciderPlugin ,
526526 )
0 commit comments