Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5b31a4c

Browse files
committedFeb 14, 2025·
Add build targets for lora syncer
Signed-off-by: Kunjan <[email protected]>
1 parent 9c367f9 commit 5b31a4c

File tree

3 files changed

+8
-94
lines changed

3 files changed

+8
-94
lines changed
 

‎Makefile

+4-34
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ PLATFORMS ?= linux/amd64
2626
DOCKER_BUILDX_CMD ?= docker buildx
2727
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build
2828
IMAGE_BUILD_EXTRA_OPTS ?=
29+
SYNCER_IMAGE_BUILD_EXTRA_OPTS ?=
2930
IMAGE_REGISTRY ?= us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension
3031
IMAGE_NAME := epp
3132
IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME)
@@ -43,9 +44,11 @@ endif
4344

4445
ifdef EXTRA_TAG
4546
IMAGE_EXTRA_TAG ?= $(IMAGE_REPO):$(EXTRA_TAG)
47+
SYNCER_IMAGE_EXTRA_TAG ?= $(SYNCER_IMAGE_REPO):$(EXTRA_TAG)
4648
endif
4749
ifdef IMAGE_EXTRA_TAG
4850
IMAGE_BUILD_EXTRA_OPTS += -t $(IMAGE_EXTRA_TAG)
51+
SYNCER_IMAGE_BUILD_EXTRA_OPTS += -t $(SYNCER_IMAGE_EXTRA_TAG)
4952
endif
5053

5154
# The name of the kind cluster to use for the "kind-load" target.
@@ -167,31 +170,6 @@ image-build: ## Build the EPP image using Docker Buildx.
167170
image-push: PUSH=--push ## Build the EPP image and push it to $IMAGE_REPO.
168171
image-push: image-build
169172

170-
##@ Lora Syncer
171-
172-
.PHONY: syncer-image-local-build
173-
syncer-image-local-build:
174-
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use)
175-
$(MAKE) image-build PUSH=$(PUSH)
176-
$(DOCKER_BUILDX_CMD) rm $$BUILDER
177-
178-
.PHONY: syncer-image-local-push
179-
syncer-image-local-push: PUSH=--push
180-
syncer-image-local-push: syncer-image-local-build
181-
182-
.PHONY: syncer-image-build
183-
syncer-image-build:
184-
$ cd $(CURDIR)/tools/dynamic-lora-sidecar && $(IMAGE_BUILD_CMD) -t $(SYNCER_IMAGE_TAG) \
185-
--platform=$(PLATFORMS) \
186-
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
187-
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
188-
$(PUSH) \
189-
$(IMAGE_BUILD_EXTRA_OPTS) ./
190-
191-
.PHONY: syncer-image-push
192-
syncer-image-push: PUSH=--push
193-
syncer-image-push: syncer-image-build
194-
195173
.PHONY: image-load
196174
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.
197175
image-load: image-build
@@ -219,20 +197,12 @@ syncer-image-build:
219197
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
220198
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
221199
$(PUSH) \
222-
$(IMAGE_BUILD_EXTRA_OPTS) ./
200+
$(SYNCER_IMAGE_BUILD_EXTRA_OPTS) ./
223201

224202
.PHONY: syncer-image-push
225203
syncer-image-push: PUSH=--push
226204
syncer-image-push: syncer-image-build
227205

228-
.PHONY: image-load
229-
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.
230-
image-load: image-build
231-
232-
.PHONY: image-kind
233-
image-kind: image-build ## Build the EPP image and load it to kind cluster $KIND_CLUSTER ("kind" by default).
234-
kind load docker-image $(IMAGE_TAG) --name $(KIND_CLUSTER)
235-
236206
##@ Docs
237207

238208
.PHONY: build-docs

‎site-src/guides/dynamic-lora.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ Rest of the steps are same as [general setup](https://github.com/kubernetes-sigs
4040
- base-model: meta-llama/Llama-2-7b-hf
4141
id: tweet-summary-1
4242
source: vineetsharma/qlora-adapter-Llama-2-7b-hf-TweetSumm
43+
- base-model: meta-llama/Llama-2-7b-hf
44+
id: tweet-summary-2
45+
source: vineetsharma/qlora-adapter-Llama-2-7b-hf-TweetSumm
4346
```
4447
4548
2. Configure a canary rollout with traffic split using LLMService. In this example, 40% of traffic for tweet-summary model will be sent to the ***tweet-summary-2*** adapter .
@@ -49,7 +52,7 @@ model:
4952
name: tweet-summary
5053
targetModels:
5154
targetModelName: tweet-summary-0
52-
weight: 10
55+
weight: 20
5356
targetModelName: tweet-summary-1
5457
weight: 40
5558
targetModelName: tweet-summary-2

‎tools/dynamic-lora-sidecar/Makefile

-59
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.