Skip to content

Commit 54e5d29

Browse files
committed
feat(coordinator): serve encode/prefill/decode from a single EPP
The coordinator's per-phase model required three separate EPP instances (one each for encode, prefill, decode), each with its own Deployment, Service, and InferencePool, even though every coordinator-to-worker call already carries an EPP-Phase header naming the phase. Combining them into one EPP simplifies deployment and is a prerequisite for p2p KV transfer (non-deferred decode). Add a header-phase-profile-handler EPP plugin that runs the single scheduling profile named by the EPP-Phase header, replacing the per-instance single-profile-handler. Merge the three EPPs' scheduling configs into one EndpointPickerConfig with encode/prefill/decode profiles, each still gated by its existing by-label role filter so it only sees its own role's pods out of the combined pool. Replace the three epd-pools/{encode,prefill,decode} deploy components with one epd-pool component: a single EPP Deployment/Service and one InferencePool selecting the app label the worker Deployments already share. Collapse the e2e Envoy test routing from three EPP-Phase-matched ext_proc clusters to one, and update the coordinator e2e test setup/assertions and architecture docs to match. Signed-off-by: roytman <roytman@il.ibm.com>
1 parent 08dce7a commit 54e5d29

17 files changed

Lines changed: 550 additions & 536 deletions

File tree

cmd/epp/runner/runner.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ import (
115115
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/picker/weightedrandom"
116116
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/profilehandler/dataparallel"
117117
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/profilehandler/disagg"
118+
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/profilehandler/headerphase"
118119
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/profilehandler/single"
119120
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/scorer/activerequest"
120121
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/scheduling/scorer/contextlengthaware"
@@ -579,6 +580,7 @@ func (r *Runner) registerInTreePlugins() {
579580
fwkplugin.Register(random.RandomPickerType, random.RandomPickerFactory)
580581
fwkplugin.Register(weightedrandom.WeightedRandomPickerType, weightedrandom.WeightedRandomPickerFactory)
581582
fwkplugin.Register(single.SingleProfileHandlerType, single.SingleProfileHandlerFactory)
583+
fwkplugin.Register(headerphase.HeaderPhaseProfileHandlerType, headerphase.Factory)
582584
fwkplugin.Register(disagg.DisaggHeadersHandlerType, disagg.HeadersHandlerFactory) //nolint:staticcheck // intentional: keep backward compatibility
583585
fwkplugin.Register(disagg.PrefillHeaderHandlerType, disagg.HeadersHandlerFactory) //nolint:staticcheck // intentional: keep backward compatibility
584586
fwkplugin.RegisterWithPluginDependencies(disagg.PdProfileHandlerType, disagg.PdProfileHandlerFactory, //nolint:staticcheck // intentional: keep backward compatibility

deploy/coordinator/components/inference-gateway/epd-pools/prefill/epp.yaml renamed to deploy/coordinator/components/inference-gateway/epd-pool/epp.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
name: ${EPP_NAME}-prefill
4+
name: ${EPP_NAME}
55
---
66
apiVersion: rbac.authorization.k8s.io/v1
77
kind: RoleBinding
88
metadata:
9-
name: ${EPP_NAME}-prefill-binding
9+
name: ${EPP_NAME}-binding
1010
subjects:
1111
- kind: ServiceAccount
12-
name: ${EPP_NAME}-prefill
12+
name: ${EPP_NAME}
1313
roleRef:
1414
apiGroup: rbac.authorization.k8s.io
1515
kind: Role
@@ -18,12 +18,12 @@ roleRef:
1818
apiVersion: v1
1919
kind: Service
2020
metadata:
21-
name: ${EPP_NAME}-prefill
21+
name: ${EPP_NAME}
2222
labels:
23-
app: ${EPP_NAME}-prefill
23+
app: ${EPP_NAME}
2424
spec:
2525
selector:
26-
app: ${EPP_NAME}-prefill
26+
app: ${EPP_NAME}
2727
ports:
2828
- name: default
2929
protocol: TCP
@@ -44,28 +44,28 @@ spec:
4444
apiVersion: apps/v1
4545
kind: Deployment
4646
metadata:
47-
name: ${EPP_NAME}-prefill
47+
name: ${EPP_NAME}
4848
labels:
49-
app: ${EPP_NAME}-prefill
49+
app: ${EPP_NAME}
5050
spec:
5151
replicas: 1
5252
selector:
5353
matchLabels:
54-
app: ${EPP_NAME}-prefill
54+
app: ${EPP_NAME}
5555
template:
5656
metadata:
5757
labels:
58-
app: ${EPP_NAME}-prefill
58+
app: ${EPP_NAME}
5959
spec:
60-
serviceAccountName: ${EPP_NAME}-prefill
60+
serviceAccountName: ${EPP_NAME}
6161
terminationGracePeriodSeconds: 130
6262
containers:
6363
- name: epp
6464
image: ${EPP_IMAGE}
6565
imagePullPolicy: IfNotPresent
6666
args:
6767
- --pool-name
68-
- "${POOL_NAME}-prefill"
68+
- "${POOL_NAME}"
6969
- --pool-namespace
7070
- "${NAMESPACE}"
7171
- --v
@@ -103,4 +103,4 @@ spec:
103103
volumes:
104104
- name: epp-config
105105
configMap:
106-
name: epp-config-prefill
106+
name: epp-config

deploy/coordinator/components/inference-gateway/epd-pools/decode/inference-pool.yaml renamed to deploy/coordinator/components/inference-gateway/epd-pool/inference-pool.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apiVersion: inference.networking.k8s.io/v1
22
kind: InferencePool
33
metadata:
4-
name: ${POOL_NAME}-decode
4+
name: ${POOL_NAME}
55
spec:
66
selector:
77
matchLabels:
8-
llm-d.ai/role: decode
8+
app: ${POOL_NAME}
99
endpointPickerRef:
10-
name: ${EPP_NAME}-decode
10+
name: ${EPP_NAME}
1111
kind: Service
1212
port:
1313
number: 9002

deploy/coordinator/components/inference-gateway/epd-pools/decode/epp.yaml

Lines changed: 0 additions & 100 deletions
This file was deleted.

deploy/coordinator/components/inference-gateway/epd-pools/encode/epp.yaml

Lines changed: 0 additions & 100 deletions
This file was deleted.

deploy/coordinator/components/inference-gateway/epd-pools/encode/inference-pool.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

deploy/coordinator/components/inference-gateway/epd-pools/prefill/inference-pool.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)