Skip to content

Commit f5d90f8

Browse files
authored
Merge branch 'main' into issue-1694-picker-span
2 parents 6141586 + b5f8159 commit f5d90f8

83 files changed

Lines changed: 12442 additions & 57 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ linters:
4545
text: "avoid meaningless package names"
4646
- linters: [revive]
4747
text: "avoid package names that conflict with Go standard library package names"
48+
# Packages transferred verbatim from llm-d-kv-cache (#1862); style cleanup tracked separately
49+
- path: pkg/(kvcache|kvevents|telemetry|utils)/
50+
linters:
51+
- revive
52+
- perfsprint
53+
- goconst
54+
- dupword
55+
- prealloc
4856
settings:
4957
importas:
5058
no-unaliased: false # unaliased imports are allowed; only enforce when an alias is used

docs/disaggregation.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ plugins:
285285
- type: prefix-based-pd-decider
286286
parameters:
287287
nonCachedTokens: 8
288+
promptTokens: 0
288289
- type: disagg-profile-handler
289290
parameters:
290291
profiles:
@@ -348,6 +349,7 @@ plugins:
348349
- type: prefix-based-pd-decider
349350
parameters:
350351
nonCachedTokens: 8
352+
promptTokens: 0
351353
- type: disagg-profile-handler
352354
parameters:
353355
profiles:
@@ -397,21 +399,27 @@ The `prefix-based-pd-decider` plugin makes the disaggregation decision according
397399
**How It Works**
398400
- Once a decode pod is selected, the decider checks how many tokens from the incoming prompt have already been sent to this pod
399401

400-
- If the remaining non-cached suffix length is longer than the configured threshold (nonCachedTokens), disaggregation is triggered – the prefill will run remotely on a prefill pod, and decode locally on the decode pod
402+
- If the prompt length is shorter than the configured prompt length threshold (promptTokens), the full request runs locally on the decode worker without remote prefill
401403

402-
- If the non-cached suffix is shorter or equal to the threshold, the full request runs locally on the decode worker without remote prefill
404+
- If the remaining non-cached suffix length is at least the configured threshold (nonCachedTokens), disaggregation is triggered: the prefill will run remotely on a prefill pod, and decode locally on the decode pod
405+
406+
- If the non-cached suffix is shorter than the threshold, the full request runs locally on the decode worker without remote prefill
403407

404408
**Configuration**
405409
```yaml
406410
- type: prefix-based-pd-decider
407411
parameters:
408412
nonCachedTokens: 8
413+
promptTokens: 0
409414
```
410415

411416
**Parameter:**
412417

413418
- `nonCachedTokens`: Number of non-cached tokens that trigger disaggregation
414419
- If set to 0, disaggregation never occurs for any request
420+
- `promptTokens`: Minimum prompt length in tokens before prefix-cache-based disaggregation logic is applied
421+
- If set to 0, the prompt-length gate is disabled
422+
- If set to a positive value, requests with fewer prompt tokens run locally on the decode worker without remote prefill
415423

416424
#### Always-Disagg PD Decider
417425
The `always-disagg-pd-decider` is a simpler alternative used mainly for testing or benchmarking.

go.mod

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ go 1.25.12
44

55
require (
66
cloud.google.com/go/aiplatform v1.124.0
7+
github.com/alicebob/miniredis/v2 v2.38.0
78
github.com/cespare/xxhash/v2 v2.3.0
9+
github.com/dgraph-io/ristretto/v2 v2.4.0
10+
github.com/dustin/go-humanize v1.0.1
811
github.com/envoyproxy/go-control-plane/envoy v1.37.0
912
github.com/felixge/httpsnoop v1.0.4
1013
github.com/fsnotify/fsnotify v1.9.0
14+
github.com/fxamacker/cbor/v2 v2.9.2
1115
github.com/go-chi/chi/v5 v5.3.1
1216
github.com/go-logr/logr v1.4.3
1317
github.com/go-logr/stdr v1.2.2
1418
github.com/go-logr/zapr v1.3.0
19+
github.com/go-zeromq/zmq4 v0.17.0
1520
github.com/google/cel-go v0.26.1
1621
github.com/google/go-cmp v0.7.0
1722
github.com/google/uuid v1.6.0
@@ -24,9 +29,11 @@ require (
2429
github.com/prometheus/client_golang v1.23.2
2530
github.com/prometheus/client_model v0.6.2
2631
github.com/prometheus/common v0.67.5
32+
github.com/redis/go-redis/v9 v9.20.0
2733
github.com/spf13/pflag v1.0.10
2834
github.com/spf13/viper v1.21.0
2935
github.com/stretchr/testify v1.11.1
36+
github.com/vmihailenco/msgpack/v5 v5.4.1
3037
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0
3138
go.opentelemetry.io/otel v1.44.0
3239
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0
@@ -65,12 +72,9 @@ require (
6572
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
6673
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
6774
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
68-
github.com/dgraph-io/ristretto/v2 v2.4.0 // indirect
69-
github.com/dustin/go-humanize v1.0.1 // indirect
7075
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
7176
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
7277
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
73-
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
7478
github.com/go-openapi/jsonpointer v0.22.5 // indirect
7579
github.com/go-openapi/jsonreference v0.21.4 // indirect
7680
github.com/go-openapi/swag v0.25.4 // indirect
@@ -88,7 +92,6 @@ require (
8892
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
8993
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
9094
github.com/go-zeromq/goczmq/v4 v4.2.2 // indirect
91-
github.com/go-zeromq/zmq4 v0.17.0 // indirect
9295
github.com/gobuffalo/flect v1.0.3 // indirect
9396
github.com/google/btree v1.1.3 // indirect
9497
github.com/google/gnostic-models v0.7.0 // indirect
@@ -104,7 +107,6 @@ require (
104107
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
105108
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
106109
github.com/prometheus/procfs v0.19.2 // indirect
107-
github.com/redis/go-redis/v9 v9.20.0 // indirect
108110
github.com/sagikazarmark/locafero v0.11.0 // indirect
109111
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
110112
github.com/spf13/afero v1.15.0 // indirect
@@ -116,9 +118,9 @@ require (
116118
github.com/tidwall/match v1.1.1 // indirect
117119
github.com/tidwall/pretty v1.2.1 // indirect
118120
github.com/tidwall/sjson v1.2.5 // indirect
119-
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
120121
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
121122
github.com/x448/float16 v0.8.4 // indirect
123+
github.com/yuin/gopher-lua v1.1.1 // indirect
122124
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
123125
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
124126
go.opentelemetry.io/otel/metric v1.44.0 // indirect

pkg/epp/framework/interface/requesthandling/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"sort"
2525
"strings"
2626

27-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
28-
"github.com/llm-d/llm-d-kv-cache/pkg/tokenization"
27+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
28+
"github.com/llm-d/llm-d-router/pkg/kvcache/tokenization"
2929
"google.golang.org/protobuf/proto"
3030
)
3131

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/blockkeys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package preciseprefixcache
1919
import (
2020
"context"
2121

22-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
22+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
2323

2424
fwkrh "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/requesthandling"
2525
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/scheduling"

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/extractor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"testing"
2323

2424
"github.com/go-logr/logr"
25-
"github.com/llm-d/llm-d-kv-cache/pkg/kvevents"
25+
"github.com/llm-d/llm-d-router/pkg/kvevents"
2626
"github.com/stretchr/testify/assert"
2727
"github.com/stretchr/testify/require"
2828
k8stypes "k8s.io/apimachinery/pkg/types"

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/prerequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"time"
2323

2424
"github.com/jellydator/ttlcache/v3"
25-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
25+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
2626
"sigs.k8s.io/controller-runtime/pkg/log"
2727

2828
"github.com/llm-d/llm-d-router/pkg/common/observability/logging"

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/prerequest_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"time"
2323

2424
"github.com/jellydator/ttlcache/v3"
25-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
25+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
2626
"github.com/stretchr/testify/assert"
2727
"github.com/stretchr/testify/require"
2828

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/producer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import (
2424
"time"
2525

2626
"github.com/jellydator/ttlcache/v3"
27-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache"
28-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
29-
"github.com/llm-d/llm-d-kv-cache/pkg/kvevents"
30-
"github.com/llm-d/llm-d-kv-cache/pkg/kvevents/engineadapter"
27+
"github.com/llm-d/llm-d-router/pkg/kvcache"
28+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
29+
"github.com/llm-d/llm-d-router/pkg/kvevents"
30+
"github.com/llm-d/llm-d-router/pkg/kvevents/engineadapter"
3131
"go.opentelemetry.io/otel/attribute"
3232
"go.opentelemetry.io/otel/codes"
3333
"go.opentelemetry.io/otel/trace"

pkg/epp/framework/plugins/requestcontrol/dataproducer/preciseprefixcache/producer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"encoding/json"
2222
"testing"
2323

24-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache"
25-
"github.com/llm-d/llm-d-kv-cache/pkg/kvcache/kvblock"
26-
"github.com/llm-d/llm-d-kv-cache/pkg/kvevents"
24+
"github.com/llm-d/llm-d-router/pkg/kvcache"
25+
"github.com/llm-d/llm-d-router/pkg/kvcache/kvblock"
26+
"github.com/llm-d/llm-d-router/pkg/kvevents"
2727
"github.com/stretchr/testify/assert"
2828
"github.com/stretchr/testify/require"
2929
k8stypes "k8s.io/apimachinery/pkg/types"

0 commit comments

Comments
 (0)