-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tgis-standalone/caikit-standalone manifests #186
Merged
openshift-merge-bot
merged 5 commits into
opendatahub-io:main
from
dtrifiro:caikit-standalone-manifests
Jan 17, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a6d8279
docs: add caikit-standalone/tgis-standalone InferenceService/ServingR…
dtrifiro 0354b5b
docs: tgis templates formatting
dtrifiro d22f5d3
docs: cleanup
dtrifiro 4b8de48
docs: update README with new architecture
dtrifiro 5b13980
docs: fix caikit paths in install script/docs
dtrifiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Caikit serving | ||
|
||
This directory includes [InferenceService](https://kserve.github.io/website/latest/reference/api/#serving.kserve.io/v1beta1.InferenceService) and [ServingRuntime](https://kserve.github.io/website/latest/reference/api/#serving.kserve.io/v1alpha1.ServingRuntime) definitions for language model serving using [caikit](https://github.com/caikit/caikit) and [caikit-nlp](https://github.com/caikit/caikit-nlp). | ||
|
||
- [caikit-standalone](./caikit-standalone): caikit-only solution | ||
- [caikit-tgis](./caikit-tgis): caikit frontend with a [text-generation-inference](https://github.com/IBM/text-generation-inference) (tgis) backend solution. See [tgis](../tgis/) for a tgis-only solution. |
17 changes: 17 additions & 0 deletions
17
demo/kserve/custom-manifests/caikit/caikit-standalone/caikit-standalone-isvc-grpc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: serving.kserve.io/v1beta1 | ||
kind: InferenceService | ||
metadata: | ||
annotations: | ||
serving.knative.openshift.io/enablePassthrough: "true" | ||
sidecar.istio.io/inject: "true" | ||
sidecar.istio.io/rewriteAppHTTPProbers: "true" | ||
name: caikit-standalone-isvc-grpc | ||
spec: | ||
predictor: | ||
serviceAccountName: sa | ||
model: | ||
# https://github.com/kserve/modelmesh-serving/blob/main/docs/predictors/setup-storage.md#3-add-a-storage-entry-to-the-storage-config-secret | ||
modelFormat: | ||
name: caikit | ||
runtime: caikit-standalone-runtime-grpc | ||
storageUri: s3://modelmesh-example-models/llm/models/flan-t5-small-caikit # single model here: target directory must contain a config.yml |
22 changes: 22 additions & 0 deletions
22
demo/kserve/custom-manifests/caikit/caikit-standalone/caikit-standalone-isvc-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: serving.kserve.io/v1beta1 | ||
kind: InferenceService | ||
metadata: | ||
annotations: | ||
serving.knative.openshift.io/enablePassthrough: "true" | ||
sidecar.istio.io/inject: "true" | ||
sidecar.istio.io/rewriteAppHTTPProbers: "true" | ||
name: caikit-standalone-isvc | ||
spec: | ||
predictor: | ||
# replace in following <NameOfAServiceAccount> with the name | ||
# of a ServiceAccount that has the secret for accessing the model | ||
serviceAccountName: <NameOfAServiceAccount> | ||
model: | ||
modelFormat: | ||
name: caikit | ||
# Replace with the actual name of the deployed ServingRuntime | ||
runtime: <NameOfTheServingRuntime> | ||
storageUri: s3://modelmesh-example-models/llm/models/flan-t5-small-caikit # single model here: target directory must contain a config.yml | ||
# Example, using a pvc: | ||
# storageUri: pvc://caikit-pvc/flan-t5-small-caikit/ | ||
# Target directory must contain a config.yml |
17 changes: 17 additions & 0 deletions
17
demo/kserve/custom-manifests/caikit/caikit-standalone/caikit-standalone-isvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: serving.kserve.io/v1beta1 | ||
kind: InferenceService | ||
metadata: | ||
annotations: | ||
serving.knative.openshift.io/enablePassthrough: "true" | ||
sidecar.istio.io/inject: "true" | ||
sidecar.istio.io/rewriteAppHTTPProbers: "true" | ||
name: caikit-standalone-isvc | ||
spec: | ||
predictor: | ||
serviceAccountName: sa | ||
model: | ||
# https://github.com/kserve/modelmesh-serving/blob/main/docs/predictors/setup-storage.md#3-add-a-storage-entry-to-the-storage-config-secret | ||
modelFormat: | ||
name: caikit | ||
runtime: caikit-standalone-runtime | ||
storageUri: s3://modelmesh-example-models/llm/models/flan-t5-small-caikit # single model here: target directory must contain a config.yml |
39 changes: 39 additions & 0 deletions
39
...erve/custom-manifests/caikit/caikit-standalone/caikit-standalone-servingruntime-grpc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: serving.kserve.io/v1alpha1 | ||
kind: ServingRuntime | ||
metadata: | ||
name: caikit-standalone-runtime-grpc | ||
spec: | ||
multiModel: false | ||
supportedModelFormats: | ||
# Note: this currently *only* supports caikit format models | ||
- autoSelect: true | ||
name: caikit | ||
containers: | ||
- name: kserve-container | ||
image: quay.io/opendatahub/caikit-nlp:stable | ||
command: ["python", "-m", "caikit.runtime.grpc_server"] | ||
env: | ||
- name: RUNTIME_LOCAL_MODELS_DIR | ||
value: /mnt/models | ||
ports: | ||
- containerPort: 8085 | ||
name: h2c | ||
protocol: TCP | ||
# resources: # configure as required | ||
# requests: | ||
# cpu: 8 | ||
# memory: 16Gi | ||
readinessProbe: | ||
exec: | ||
command: | ||
- python | ||
- -m | ||
- caikit_health_probe | ||
- readiness | ||
livenessProbe: | ||
exec: | ||
command: | ||
- python | ||
- -m | ||
- caikit_health_probe | ||
- liveness |
38 changes: 38 additions & 0 deletions
38
demo/kserve/custom-manifests/caikit/caikit-standalone/caikit-standalone-servingruntime.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: serving.kserve.io/v1alpha1 | ||
kind: ServingRuntime | ||
metadata: | ||
name: caikit-standalone-runtime | ||
spec: | ||
multiModel: false | ||
supportedModelFormats: | ||
# Note: this currently *only* supports caikit format models | ||
- autoSelect: true | ||
name: caikit | ||
containers: | ||
- name: kserve-container | ||
image: quay.io/opendatahub/caikit-nlp:stable | ||
command: ["python", "-m", "caikit.runtime.http_server"] | ||
env: | ||
- name: RUNTIME_LOCAL_MODELS_DIR | ||
value: /mnt/models | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
# resources: # configure as required | ||
# requests: | ||
# cpu: 8 | ||
# memory: 16Gi | ||
readinessProbe: | ||
exec: | ||
command: | ||
- python | ||
- -m | ||
- caikit_health_probe | ||
- readiness | ||
livenessProbe: | ||
exec: | ||
command: | ||
- python | ||
- -m | ||
- caikit_health_probe | ||
- liveness |
128 changes: 128 additions & 0 deletions
128
demo/kserve/custom-manifests/caikit/caikit-standalone/working/working-grpc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: caikit-tgis-config | ||
namespace: kserve-test | ||
data: | ||
caikit.yml: | | ||
runtime: | ||
library: caikit_nlp | ||
local_models_dir: /mnt/models/ | ||
lazy_load_local_models: true | ||
grpc: | ||
server_thread_pool_size: 64 | ||
|
||
model_management: | ||
finders: | ||
default: | ||
type: MULTI | ||
config: | ||
finder_priority: | ||
- tgis-auto | ||
tgis-auto: | ||
type: TGIS-AUTO | ||
config: | ||
test_connection: true | ||
initializers: | ||
default: | ||
type: LOCAL | ||
config: | ||
backend_priority: | ||
- type: TGIS | ||
config: | ||
connection: | ||
hostname: localhost:8033 | ||
--- | ||
apiVersion: serving.kserve.io/v1alpha1 | ||
kind: ServingRuntime | ||
metadata: | ||
name: caikit-runtime | ||
annotations: | ||
serving.knative.openshift.io/enablePassthrough: "true" | ||
sidecar.istio.io/inject: "true" | ||
sidecar.istio.io/rewriteAppHTTPProbers: "true" | ||
namespace: kserve-test | ||
spec: | ||
multiModel: false | ||
supportedModelFormats: | ||
# Note: this currently *only* supports caikit format models | ||
- autoSelect: true | ||
name: caikit | ||
containers: | ||
- name: kserve-container | ||
image: quay.io/opendatahub/text-generation-inference:stable-bafd218 | ||
imagePullPolicy: IfNotPresent | ||
command: ["text-generation-launcher"] | ||
args: [ | ||
# NOTE:--num-shard defaults to 1 | ||
"--model-name=/mnt/models/artifacts/", | ||
"--max-batch-size=256", | ||
"--max-concurrent-requests=64", | ||
] | ||
# ports: | ||
# - containerPort: 8033 | ||
# name: h2c | ||
# protocol: TCP | ||
env: | ||
- name: TRANSFORMERS_CACHE | ||
value: /tmp/transformers_cache | ||
# resources: # configure as required | ||
# requests: | ||
# cpu: 8 | ||
# memory: 16Gi | ||
# livenessProbe: | ||
# grpc: | ||
# port: 8083 | ||
# readinessProbe: | ||
# exec: | ||
# command: | ||
# - curl --fail http://localhost:3000/health | ||
# # TODO: Add grpc endpoint | ||
# # grpc: | ||
# # port: 8033 | ||
# # httpGet: | ||
# # path: /health | ||
# # port: 3000 | ||
- name: transformer-container | ||
image: quay.io/opendatahub/caikit-tgis-serving:fast | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
# Optional values: | ||
# - name: PT2_COMPILE # Slows down model loading, but provides a speedup in inference | ||
# value: true | ||
# - name: FLASH_ATTENTION # Optimizes certain models, see https://github.com/IBM/text-generation-inference#converting-weights-to-safetensors-format | ||
# value: true | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /caikit/config/ | ||
readOnly: true | ||
ports: | ||
- containerPort: 8085 | ||
protocol: TCP | ||
# - containerPort: 8080 # http | ||
# protocol: TCP | ||
# grpc: | ||
# port: 8085 | ||
# livenessProbe: | ||
# grpc: | ||
# port: 8085 | ||
# initialDelaySeconds: 10 | ||
# readinessProbe: # http readiness | ||
# httpGet: | ||
# path: /health | ||
# port: 8080 | ||
# initialDelaySeconds: 10 | ||
# livenessProbe: # http liveness | ||
# httpGet: | ||
# path: /health | ||
# port: 8080 | ||
|
||
# resources: # configure as required | ||
# requests: | ||
# cpu: 8 | ||
# memory: 16Gi | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: caikit-tgis-config |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image isn't available (yet). Waiting on openshift/release#46641 for the workflows required to push the image on quay and the creation of a release branch on https://github.com/opendatahub-io/caikit-nlp