Skip to content

Commit 0cdafc7

Browse files
committed
feat: Add Helm chart
1 parent e771e39 commit 0cdafc7

File tree

13 files changed

+406
-204
lines changed

13 files changed

+406
-204
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,5 @@ Cargo.lock
170170
*.json
171171
*.txt
172172
results
173-
*.parquet
173+
*.parquet
174+
*.dev.*

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,19 @@ values, sampling token counts from a normal distribution with the specified vari
193193
--decode-options "num_tokens=50,max_tokens=60,min_tokens=40,variance=10"
194194
```
195195

196+
## Deploy on Kubernetes
197+
198+
You can deploy the benchmarking tool on Kubernetes using the provided Helm chart.
199+
200+
Review the values (especially model, HF token and resources), and install the chart:
201+
```shell
202+
$ helm install tgi-benchmark ./extra/k8s/text-generation-inference-benchmark
203+
```
204+
205+
## Deploy on Slurm
206+
207+
Slurm example is provided in `extra/slurm`.
208+
196209
## Development
197210

198211
You need [Rust](https://rustup.rs/) installed to build the benchmarking tool.

extra/k8s/benchmark.yaml

Lines changed: 0 additions & 195 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: text-generation-inference-benchmark
3+
description: A Helm chart to run a text generation inference benchmark
4+
type: application
5+
version: 0.1.0
6+
appVersion: "2.3.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "text-generation-inference-benchmark.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "text-generation-inference-benchmark.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "text-generation-inference-benchmark.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "text-generation-inference-benchmark.labels" -}}
37+
helm.sh/chart: {{ include "text-generation-inference-benchmark.chart" . }}
38+
{{ include "text-generation-inference-benchmark.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "text-generation-inference-benchmark.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "text-generation-inference-benchmark.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "text-generation-inference-benchmark.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "text-generation-inference-benchmark.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)