forked from aws-deadline/deadline-cloud-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
165 lines (148 loc) · 5.06 KB
/
Copy pathtemplate.yaml
File metadata and controls
165 lines (148 loc) · 5.06 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
specificationVersion: 'jobtemplate-2023-09'
name: vLLM Leaderboard Matrix Evaluation
description: |
Evaluates multiple LLMs on a set of benchmarks in a single Deadline Cloud job.
The `EvalModels` step has a parameter space over models — each task runs one
model. The task script starts vLLM for that model, runs every benchmark via
EleutherAI's lm-evaluation-harness against the local vLLM endpoint, then
stops vLLM. Tasks run in parallel across workers.
A final step aggregates per-model JSON results into a ranked leaderboard
(CSV + Markdown).
Dependencies (vLLM, PyTorch, transformers, lm_eval) are provided by the
queue's Conda queue environment via the `CondaPackages` parameter. Your
queue must have a Conda queue environment configured — see
https://docs.aws.amazon.com/deadline-cloud/latest/userguide/create-queue-environment.html
To change the model list, edit the `range` of the `ModelName` task parameter.
To change benchmarks, edit the `Benchmarks` job parameter at submit time.
parameterDefinitions:
- name: Benchmarks
type: STRING
default: "hellaswag,arc_easy,arc_challenge,winogrande"
description: "Comma-separated lm-evaluation-harness task names to run against every model."
userInterface:
control: LINE_EDIT
label: Benchmarks
groupLabel: Evaluation Settings
- name: ResultsDir
type: PATH
objectType: DIRECTORY
dataFlow: OUT
default: leaderboard_results
description: "Output directory for per-model results and the final leaderboard."
userInterface:
control: CHOOSE_DIRECTORY
label: Results Directory
groupLabel: Output
- name: NumConcurrent
type: INT
default: 4
minValue: 1
maxValue: 64
description: "Number of concurrent requests lm_eval sends to vLLM."
userInterface:
control: SPIN_BOX
label: Concurrent Requests
groupLabel: Evaluation Settings
- name: MaxModelLen
type: INT
default: 2048
minValue: 512
maxValue: 32768
description: "Max sequence length for vLLM. Set to the smallest context window among your models."
userInterface:
control: SPIN_BOX
label: Max Model Length
groupLabel: Server Settings
- name: GpuMemoryUtilization
type: STRING
default: "0.90"
description: "Fraction of GPU memory for vLLM KV cache (0.0-1.0)."
userInterface:
control: LINE_EDIT
label: GPU Memory Utilization
groupLabel: Server Settings
- name: HfToken
type: STRING
default: ""
description: "HuggingFace token for gated models (Llama, etc.). Leave empty if not needed."
userInterface:
control: LINE_EDIT
label: HuggingFace Token
groupLabel: Model Settings
- name: JobScriptDir
description: Directory containing bundled scripts.
type: PATH
objectType: DIRECTORY
dataFlow: IN
default: scripts
userInterface:
control: HIDDEN
# Dependencies resolved by the queue's Conda queue environment. Three groups:
# 1. vLLM stack: vLLM (cuda build) transitively pulls PyTorch, transformers,
# tokenizers. cuda-toolkit provides the headers and libcuda.so stub that
# Triton needs for JIT kernel compilation on the worker.
# 2. lm_eval[api] extras: conda-forge lm_eval doesn't declare these (they're
# a pip-only extra upstream), but local-completions needs them.
# 3. typepy[datetime] extras: pytablewriter -> dataproperty -> typepy lazily
# imports pytz/dateutil when rendering the final markdown results table.
# conda-forge typepy hides these behind the [datetime] extra.
- name: CondaPackages
type: STRING
default: "python=3.11 vllm=0.19.1=cuda* cuda-toolkit=12.9 lm_eval=0.4.11 requests aiohttp tenacity tqdm tiktoken pytz python-dateutil"
userInterface:
control: HIDDEN
- name: CondaChannels
type: STRING
default: "conda-forge"
userInterface:
control: HIDDEN
jobEnvironments:
- name: UnbufferedOutput
variables:
PYTHONUNBUFFERED: "True"
steps:
# Each task evaluates one model. The task script starts vLLM for the model,
# runs all benchmarks against it sequentially, then stops vLLM.
- name: EvalModels
parameterSpace:
taskParameterDefinitions:
- name: ModelName
type: STRING
range:
- "Qwen/Qwen2.5-0.5B"
- "Qwen/Qwen2.5-1.5B"
- "EleutherAI/pythia-1.4b"
script:
actions:
onRun:
command: bash
args:
- '{{Param.JobScriptDir}}/eval-model.sh'
- '{{Task.Param.ModelName}}'
- '{{Param.Benchmarks}}'
- '{{Param.ResultsDir}}'
- '{{Param.NumConcurrent}}'
- '{{Param.GpuMemoryUtilization}}'
- '{{Param.MaxModelLen}}'
- '{{Param.HfToken}}'
- '{{Session.WorkingDirectory}}'
hostRequirements:
attributes:
- {name: attr.worker.os.family, anyOf: [linux]}
amounts:
- {name: amount.worker.gpu, min: 1}
- {name: amount.worker.memory, min: 32768}
- name: Aggregate
dependencies:
- dependsOn: EvalModels
script:
actions:
onRun:
command: python
args:
- '{{Param.JobScriptDir}}/aggregate_leaderboard.py'
- '--results-dir'
- '{{Param.ResultsDir}}'
hostRequirements:
attributes:
- {name: attr.worker.os.family, anyOf: [linux]}