-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathap_llama2-7b.yaml
More file actions
121 lines (120 loc) · 4.16 KB
/
Copy pathap_llama2-7b.yaml
File metadata and controls
121 lines (120 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# [START gke_ai_ml_gke_ray_rayserve_ap_llama2_7b]
apiVersion: ray.io/v1
kind: RayService
metadata:
name: rayllm
spec:
serviceUnhealthySecondThreshold: 1200 # Config for the health check threshold for service. Default value is 60.
deploymentUnhealthySecondThreshold: 1200 # Config for the health check threshold for deployments. Default value is 60.
serveConfigV2: |
applications:
- name: ray-llm
route_prefix: /
import_path: rayllm.backend:router_application
args:
models:
- "./models/meta-llama--Llama-2-7b-chat-hf.yaml"
rayClusterConfig:
# Ray head pod template
headGroupSpec:
# The `rayStartParams` are used to configure the `ray start` command.
# See https://github.com/ray-project/kuberay/blob/master/docs/guidance/rayStartParams.md for the default settings of `rayStartParams` in KubeRay.
# See https://docs.ray.io/en/latest/cluster/cli.html#ray-start for all available options in `rayStartParams`.
rayStartParams:
resources: '"{\"accelerator_type_cpu\": 2}"'
dashboard-host: '0.0.0.0'
block: 'true'
#pod template
template:
spec:
containers:
- name: ray-head
image: anyscale/ray-llm:0.5.0
resources:
limits:
cpu: "2"
memory: "8Gi"
requests:
cpu: "2"
memory: "8Gi"
volumeMounts:
- mountPath: /home/ray/models
name: model
ports:
- containerPort: 6379
name: gcs-server
- containerPort: 8265 # Ray dashboard
name: dashboard
- containerPort: 10001
name: client
- containerPort: 8000
name: serve
volumes:
- name: model
configMap:
name: meta-llama2-7b-chat-hf
items:
- key: meta-llama--Llama-2-7b-chat-hf.yaml
path: meta-llama--Llama-2-7b-chat-hf.yaml
workerGroupSpecs:
# the pod replicas in this group typed worker
- replicas: 1
minReplicas: 0
maxReplicas: 1
# logical group name, for this called small-group, also can be functional
groupName: gpu-group
rayStartParams:
block: 'true'
resources: '"{\"accelerator_type_cpu\": 20, \"accelerator_type_l4\": 1}"'
# pod template
template:
spec:
securityContext:
runAsUser: 1000
fsGroup: 100
containers:
- name: llm
image: anyscale/ray-llm:0.5.0
env:
- name: HUGGING_FACE_HUB_TOKEN
valueFrom:
secretKeyRef:
name: hf-secret
key: hf_api_token
lifecycle:
preStop:
exec:
command: ["/bin/sh","-c","ray stop"]
resources:
limits:
cpu: "20"
memory: "20Gi"
ephemeral-storage: "20Gi"
nvidia.com/gpu: "1"
requests:
cpu: "20"
memory: "20Gi"
ephemeral-storage: "20Gi"
nvidia.com/gpu: "1"
# Please ensure the following taint has been applied to the GPU node in the cluster.
tolerations:
- key: "ray.io/node-type"
operator: "Equal"
value: "worker"
effect: "NoSchedule"
nodeSelector:
cloud.google.com/gke-accelerator: nvidia-l4
# [END gke_ai_ml_gke_ray_rayserve_ap_llama2_7b]