-
Notifications
You must be signed in to change notification settings - Fork 26
📝 update deployment examples, add kserve #226
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc84051
:memo: update deployment examples, add kserve
joerunde 356ad82
Apply suggestions from code review
joerunde 273365b
:alembic: try list withi note
joerunde af23869
:bug: add openshift ai doc to nav page
joerunde e0c1f37
:bug: add to nav section too
joerunde 200cec5
:memo: link to kserve docs for inference
joerunde c45d32a
Update docs/deploying/rhoai.md
joerunde 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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,104 @@ | ||
| # Using Red Hat OpenShift AI | ||
|
|
||
| [Red Hat OpenShift AI](https://www.redhat.com/en/products/ai/openshift-ai) is a cloud-native AI platform that bundles together many popular model management projects, including [KServe](https://kserve.github.io/website/latest/). | ||
|
|
||
| This example shows how to use KServe with RHOAI to deploy a model on OpenShift, using a modelcar image to load the model without requiring any connection to Huggingface Hub. | ||
|
|
||
| ## Deploying with KServe | ||
|
|
||
| !!! note "Prerequisites" | ||
| * A running Kubernetes cluster with RHOAI installed | ||
| * Image pull credentials for `registry.redhat.io/rhelai1` | ||
| * Spyre accelerators available in the cluster | ||
|
|
||
| <!-- TODO: Link to public docs for cluster setup --> | ||
|
|
||
| 1. Create a ServingRuntime to serve your models. | ||
|
|
||
| ```yaml | ||
| oc apply -f - <<EOF | ||
| apiVersion: serving.kserve.io/v1alpha1 | ||
| kind: ServingRuntime | ||
| metadata: | ||
| name: vllm-spyre-runtime | ||
| annotations: | ||
| openshift.io/display-name: vLLM IBM Spyre ServingRuntime for KServe | ||
| opendatahub.io/recommended-accelerators: '["ibm.com/aiu_pf"]' | ||
| labels: | ||
| opendatahub.io/dashboard: "true" | ||
| spec: | ||
| multiModel: false | ||
| supportedModelFormats: | ||
| - autoSelect: true | ||
| name: vLLM | ||
| containers: | ||
| - name: kserve-container | ||
| image: quay.io/ibm-aiu/vllm-spyre:latest.amd64 | ||
| args: | ||
| - /mnt/models | ||
| - --served-model-name={{.Name}} | ||
| env: | ||
| - name: HF_HOME | ||
| value: /tmp/hf_home | ||
| # Static batching configurations can also be set on each InferenceService | ||
| - name: VLLM_SPYRE_WARMUP_BATCH_SIZES | ||
| value: '4' | ||
| - name: VLLM_SPYRE_WARMUP_PROMPT_LENS | ||
| value: '1024' | ||
| - name: VLLM_SPYRE_WARMUP_NEW_TOKENS | ||
| value: '256' | ||
| ports: | ||
| - containerPort: 8000 | ||
| protocol: TCP | ||
| EOF | ||
| ``` | ||
|
|
||
| 2. Create an InferenceService for each model you want to deploy. This example demonstrates how to deploy the [Granite](https://www.ibm.com/granite) model `ibm-granite/granite-3.1-8b-instruct`. | ||
|
|
||
| ```yaml | ||
| oc apply -f - <<EOF | ||
| apiVersion: serving.kserve.io/v1beta1 | ||
| kind: InferenceService | ||
| metadata: | ||
| annotations: | ||
| openshift.io/display-name: granite-3-1-8b-instruct | ||
| serving.kserve.io/deploymentMode: RawDeployment | ||
| name: granite-3-1-8b-instruct | ||
| labels: | ||
| opendatahub.io/dashboard: 'true' | ||
| spec: | ||
| predictor: | ||
| imagePullSecrets: | ||
| - name: oci-registry | ||
| maxReplicas: 1 | ||
| minReplicas: 1 | ||
| model: | ||
| modelFormat: | ||
| name: vLLM | ||
| name: '' | ||
| resources: | ||
| limits: | ||
| ibm.com/aiu_pf: '1' | ||
| requests: | ||
| ibm.com/aiu_pf: '1' | ||
| runtime: vllm-spyre-runtime | ||
| storageUri: 'oci://registry.redhat.io/rhelai1/modelcar-granite-3-1-8b-instruct:1.5' | ||
| volumeMounts: | ||
| - mountPath: /dev/shm | ||
| name: shm | ||
| schedulerName: aiu-scheduler | ||
| tolerations: | ||
| - effect: NoSchedule | ||
| key: ibm.com/aiu_pf | ||
| operator: Exists | ||
| spec: | ||
| volumes: | ||
| # This volume may need to be larger for bigger models and running tensor-parallel inference with more cards | ||
| - name: shm | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: "2Gi" | ||
| EOF | ||
| ``` | ||
|
|
||
| 3. To test your InferenceService, refer to the [KServe documentation on model inference with vLLM](https://kserve.github.io/website/latest/modelserving/v1beta1/llm/huggingface/text_generation/#perform-model-inference_1). |
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.
Uh oh!
There was an error while loading. Please reload this page.