Skip to content

Commit e6f4121

Browse files
atchernychhhzhang16
authored andcommitted
feat: Deployment for Dynamo EPP - aware gateway (#2633)
Signed-off-by: atchernych <atchernych@nvidia.com> Co-authored-by: hhzhang16 <54051230+hhzhang16@users.noreply.github.com> Signed-off-by: Jason Zhou <jasonzho@jasonzho-mlt.client.nvidia.com>
1 parent e9fa569 commit e6f4121

7 files changed

Lines changed: 938 additions & 30 deletions

File tree

deploy/inference-gateway/README.md

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
## Inference Gateway Setup with Dynamo
22

33
This guide demonstrates two setups.
4-
The EPP-unaware setup treats each Dynamo deployment as a black box and routes traffic randomly among the deployments.
5-
The EPP-aware setup first uses Dynamo Router to pick the worker instance id for serving the model. Then traffic gets directed straight to the selected worker.
4+
5+
- The basic setup treats each Dynamo deployment as a black box and routes traffic randomly among the deployments.
6+
- The EPP-aware setup uses a custom Dynamo plugin `dyn-kv` to pick the best worker.
7+
8+
EPP’s default approach is token-aware only `by approximation` because it relies on the non-tokenized text in the prompt. But the Dynamo plugin uses a token-aware KV algorithm. It employs the dynamo router which implements kv routing by running your model’s tokenizer inline. The EPP plugin configuration lives in [`helm/dynamo-gaie/epp-config-dynamo.yaml`](helm/dynamo-gaie/epp-config-dynamo.yaml) per EPP [convention](https://gateway-api-inference-extension.sigs.k8s.io/guides/epp-configuration/config-text/).
9+
610
Currently, these setups are only supported with the kGateway based Inference Gateway.
711

812
## Table of Contents
@@ -18,12 +22,12 @@ Currently, these setups are only supported with the kGateway based Inference Gat
1822

1923
## Installation Steps
2024

21-
1. **Install Dynamo Platform**
25+
### 1. Install Dynamo Platform ###
2226

2327
[See Quickstart Guide](../../docs/guides/dynamo_deploy/README.md) to install Dynamo Cloud.
2428

2529

26-
2. **Deploy Inference Gateway**
30+
### 2. Deploy Inference Gateway ###
2731

2832
First, deploy an inference gateway service. In this example, we'll install `kgateway` based gateway implementation.
2933
You can use the script below or follow the steps manually.
@@ -72,7 +76,7 @@ kubectl get gateway inference-gateway -n my-model
7276
# inference-gateway kgateway x.x.x.x True 1m
7377
```
7478

75-
3. **Deploy model**
79+
### 3. Deploy Your Model ###
7680

7781
Follow the steps in [model deployment](../../components/backends/vllm/deploy/README.md) to deploy `Qwen/Qwen3-0.6B` model in aggregate mode using [agg.yaml](../../components/backends/vllm/deploy/agg.yaml) in `my-model` kubernetes namespace.
7882

@@ -81,51 +85,85 @@ Sample commands to deploy model:
8185
cd <dynamo-source-root>/components/backends/vllm/deploy
8286
kubectl apply -f agg.yaml -n my-model
8387
```
88+
Take a note of or change the DYNAMO_IMAGE in the model deployment file.
8489

85-
4. **Install Dynamo GAIE helm chart**
90+
### 4. Install Dynamo GAIE helm chart ###
8691

8792
The Inference Gateway is configured through the `inference-gateway-resources.yaml` file.
8893

8994
Deploy the Inference Gateway resources to your Kubernetes cluster by running one of the commands below.
9095

91-
For the EPP-unaware black box integration run:
96+
#### Basic Black Box Integration ####
97+
98+
For the basic black box integration run:
9299

93100
```bash
94101
cd deploy/inference-gateway
95102
helm install dynamo-gaie ./helm/dynamo-gaie -n my-model -f ./vllm_agg_qwen.yaml
96103
```
97104

98-
For the EPP-aware integration run:
105+
#### EPP-aware Integration with the custom Dynamo Plugin ####
106+
107+
##### 1. Build the custom EPP image #####
108+
109+
We provide git patches for you to use.
110+
111+
##### 1.1 Clone the official GAIE repo in a separate folder #####
99112

100113
```bash
101-
cd deploy/inference-gateway
114+
git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension.git
115+
cd gateway-api-inference-extension
116+
git checkout v0.5.1
117+
```
102118

103-
helm install dynamo-gaie ./helm/dynamo-gaie \
104-
-n my-model \
105-
-f ./vllm_agg_qwen.yaml \
106-
-f ./values-epp-aware.yaml
119+
##### 1.2 Apply patch(es) #####
120+
121+
```bash
122+
git apply <dynamo-folder>/deploy/inference-gateway/epp-patches/v0.5.1-1/epp-v0.5.1-dyn1.patch
123+
```
124+
125+
##### 1.3 Build the custom EPP image #####
126+
127+
```bash
128+
# Build the image <your-docker-registry/dynamo-custom-epp:<your-tag> and then manually push
129+
make image-local-load \
130+
IMAGE_REGISTRY=<your-docker-registry> \
131+
IMAGE_NAME=dynamo-custom-epp \
132+
EXTRA_TAG=<your-tag>
133+
134+
# Or run the command below to build push to your registry
135+
make image-local-push \
136+
IMAGE_REGISTRY=<your-docker-registry> \
137+
IMAGE_NAME=dynamo-custom-epp \
138+
EXTRA_TAG=<your-tag>
107139
```
108140

109-
Or customize the EPP further using flags, i.e:
141+
##### 2. Install through helm #####
110142

111143
```bash
112-
helm install dynamo-gaie ./helm/dynamo-gaie \
144+
cd deploy/inference-gateway
145+
146+
# Export the Dynamo image you have used when deploying your model in Step 3.
147+
export DYNAMO_IMAGE=<the-dynamo-image-you-have-used-when-deploying-the-model>
148+
export EPP_IMAGE=<the-epp-image-you-built> # i.e. docker.io/lambda108/epp-inference-extension-dynamo:v0.5.1-1
149+
150+
helm upgrade --install dynamo-gaie ./helm/dynamo-gaie \
113151
-n my-model \
114152
-f ./vllm_agg_qwen.yaml \
153+
-f ./values-epp-aware.yaml \
115154
--set eppAware.enabled=true \
116-
--set eppAware.eppImage=docker.io/lambda108/epp-inference-extension-dynamo:1.0.0 \
117-
--set imagePullSecrets='{docker-imagepullsecret}' \
118-
--set-string epp.extraEnv[0].name=USE_STREAMING \
119-
--set-string epp.extraEnv[0].value=true
155+
--set-string eppAware.eppImage=$EPP_IMAGE \
156+
--set-string eppAware.sidecar.image=$DYNAMO_IMAGE
120157
```
121158

159+
122160
Key configurations include:
123161
- An InferenceModel resource for the Qwen model
124162
- A service for the inference gateway
125163
- Required RBAC roles and bindings
126164
- RBAC permissions
127165

128-
5. **Verify Installation**
166+
### 5. Verify Installation ###
129167

130168
Check that all resources are properly deployed:
131169

@@ -153,11 +191,11 @@ NAME HOSTNAMES AGE
153191
qwen-route 33m
154192
```
155193

156-
## Usage
194+
### 6. Usage ###
157195

158196
The Inference Gateway provides HTTP endpoints for model inference.
159197

160-
### 1: Populate gateway URL for your k8s cluster
198+
#### 1: Populate gateway URL for your k8s cluster ####
161199
```bash
162200
export GATEWAY_URL=<Gateway-URL>
163201
```
@@ -183,7 +221,7 @@ kubectl port-forward svc/inference-gateway 8000:80 -n my-model
183221
GATEWAY_URL=http://localhost:8000
184222
```
185223

186-
### 2: Check models deployed to inference gateway
224+
#### 2: Check models deployed to inference gateway ####
187225

188226

189227
a. Query models:

0 commit comments

Comments
 (0)