Text Generation
hinairo commited on
Commit
16d6aec
·
verified ·
1 Parent(s): 80d451e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -39
README.md CHANGED
@@ -41,11 +41,8 @@ Models can be accessed via TheStage AI Python SDK: ElasticModels, or deployed as
41
 
42
  ---
43
 
44
-
45
  ### System Requirements
46
 
47
- ---
48
-
49
  | **Property**| **Value** |
50
  | --- | --- |
51
  | **GPU** | L40s, RTX 5090, H100, B200 |
@@ -56,8 +53,6 @@ Models can be accessed via TheStage AI Python SDK: ElasticModels, or deployed as
56
 
57
  ### TheStage AI Access token setup
58
 
59
- ---
60
-
61
  Install TheStage AI CLI and setup API token:
62
 
63
  ```bash
@@ -67,8 +62,6 @@ thestage config set --access-token <YOUR_ACCESS_TOKEN>
67
 
68
  ### ElasticModels installation
69
 
70
- ---
71
-
72
  Install TheStage Elastic Models package:
73
 
74
  ```bash
@@ -81,7 +74,6 @@ pip install --force-reinstall --no-deps nvidia-cudnn-frontend==1.18.0
81
 
82
  ---
83
 
84
-
85
  Elastic Models provides the same interface as HuggingFace Transformers. Here is an example of how to use the Llama-3.1-8B-Instruct model:
86
 
87
  ```python
@@ -150,15 +142,12 @@ print(f"# A:\n{output}\n")
150
 
151
  ---
152
 
153
-
154
  We have used the `lm_eval` library to validate the models. For each model size (S, M, L, XL), we have run the following tasks: MMLU, PIQA, Arc Challenge, Winogrande.
155
 
156
  ![Quality Benchmarking](https://cdn.thestage.ai/production/cms_file_upload/1773422713-7d51617f-e70a-41db-95f9-abd0d9ff338f/Elastic_Llama_3.1_8B_Instruct_MMLU.png)
157
 
158
  ### Quality Benchmark Results
159
 
160
- ---
161
-
162
  | **Metric/Model Size**| **S**| **M**| **L**| **XL**| **Original**| **W8A8, int8** |
163
  | --- | --- | --- | --- | --- | --- | --- |
164
  | **MMLU** | 67.4 | 68.1 | 68.3 | 68.5 | 68.4 | 24.3 |
@@ -171,7 +160,6 @@ We have used the `lm_eval` library to validate the models. For each model size (
171
 
172
  ---
173
 
174
-
175
  - **MMLU**: Measures model performance on a diverse set of multiple-choice questions covering various academic subjects, testing general knowledge and reasoning.
176
  - **PIQA**: Evaluates physical commonsense reasoning by asking the model to choose the most plausible solution to everyday physical problems.
177
  - **Arc Challenge**: Assesses scientific and factual reasoning using challenging multiple-choice questions from the AI2 Reasoning Challenge dataset.
@@ -181,7 +169,6 @@ We have used the `lm_eval` library to validate the models. For each model size (
181
 
182
  ---
183
 
184
-
185
  - **Accuracy**: Accuracy measures the proportion of model predictions that exactly match the correct answers across evaluation tasks.
186
 
187
 
@@ -189,15 +176,12 @@ We have used the `lm_eval` library to validate the models. For each model size (
189
 
190
  ---
191
 
192
-
193
  We measured TPS (tokens per second) for each model size using 100 input tokens and 300 output tokens.
194
 
195
  ![Latency Benchmarking](https://cdn.thestage.ai/production/cms_file_upload/1779128494-03458602-0144-446d-bebd-6d3ebc8b9907/Elastic_Llama_3.1_8B_Instruct_latency.png)
196
 
197
  ### Latency Benchmark Results
198
 
199
- ---
200
-
201
  Tokens per second for different model sizes on various GPUs.
202
 
203
  | **GPU/Model Size**| **S**| **M**| **L**| **XL**| **Original**| **W8A8_int8** |
@@ -213,7 +197,6 @@ Tokens per second for different model sizes on various GPUs.
213
 
214
  ---
215
 
216
-
217
  The benchmarking was performed on a single GPU with a batch size of 1. Each model was run for 10 iterations, and the average latency was calculated.
218
 
219
  > **Algorithm summary:**
@@ -233,19 +216,16 @@ The benchmarking was performed on a single GPU with a batch size of 1. Each mode
233
 
234
  ---
235
 
236
-
237
  For serving with Nvidia GPUs, we provide ready-to-go Docker containers with OpenAI-compatible API endpoints.
238
  Using our containers you can set up an inference endpoint on any desired cloud/serverless providers as well as on-premise servers.
239
  You can also use this container to run inference through TheStage AI platform.
240
 
241
  ### Prebuilt image from ECR
242
 
243
- ---
244
-
245
  Pull docker image and start inference container:
246
 
247
  ```bash
248
- docker pull public.ecr.aws/i3f7g5s7/thestage/elastic-models:0.2.0-llm-24.09c
249
  ```
250
  ```bash
251
  docker run --rm -ti \
@@ -258,7 +238,7 @@ docker run --rm -ti \
258
  -e HUGGINGFACE_ACCESS_TOKEN=<HUGGINGFACE_ACCESS_TOKEN> \
259
  -e THESTAGE_AUTH_TOKEN=<THESTAGE_ACCESS_TOKEN> \
260
  -v /mnt/hf_cache:/root/.cache/huggingface \
261
- public.ecr.aws/i3f7g5s7/thestage/elastic-models:0.2.0-llm-24.09c
262
  ```
263
 
264
  | **Parameter** | **Description** |
@@ -273,7 +253,6 @@ docker run --rm -ti \
273
 
274
  ---
275
 
276
-
277
  You can invoke the endpoint using CURL as follows:
278
 
279
  ```bash
@@ -316,17 +295,12 @@ print(response.choices[0].message.content)
316
 
317
  ---
318
 
319
-
320
  ### Method
321
 
322
- ---
323
-
324
  > **POST** `/v1/chat/completions`
325
 
326
  ### Header Parameters
327
 
328
- ---
329
-
330
  > `Authorization`: `string`
331
  >
332
  > Bearer token for authentication. Should match the `AUTH_TOKEN` set during container startup.
@@ -341,8 +315,6 @@ print(response.choices[0].message.content)
341
 
342
  ### Input Body
343
 
344
- ---
345
-
346
  > `messages` : `string`
347
  >
348
  > The input text prompt.
@@ -352,13 +324,10 @@ print(response.choices[0].message.content)
352
 
353
  ---
354
 
355
-
356
  For more details please use the tutorial [Modal deployment](https://docs.thestage.ai/tutorials/source/modal_thestage.html)
357
 
358
  ### Clone modal serving code
359
 
360
- ---
361
-
362
  ```shell
363
  git clone https://github.com/TheStageAI/ElasticModels.git
364
  cd ElasticModels/examples/modal
@@ -366,8 +335,6 @@ cd ElasticModels/examples/modal
366
 
367
  ### Configuration of environment variables
368
 
369
- ---
370
-
371
  Set your environment variables in `modal_serving.py`:
372
 
373
  ```python
@@ -386,8 +353,6 @@ ENVS = {
386
 
387
  ### Configuration of GPUs
388
 
389
- ---
390
-
391
  Set your desired GPU type and autoscaling variables in `modal_serving.py`:
392
 
393
  ```python
@@ -414,8 +379,6 @@ def serve():
414
 
415
  ### Run serving
416
 
417
- ---
418
-
419
  ```shell
420
  modal serve modal_serving.py
421
  ```
 
41
 
42
  ---
43
 
 
44
  ### System Requirements
45
 
 
 
46
  | **Property**| **Value** |
47
  | --- | --- |
48
  | **GPU** | L40s, RTX 5090, H100, B200 |
 
53
 
54
  ### TheStage AI Access token setup
55
 
 
 
56
  Install TheStage AI CLI and setup API token:
57
 
58
  ```bash
 
62
 
63
  ### ElasticModels installation
64
 
 
 
65
  Install TheStage Elastic Models package:
66
 
67
  ```bash
 
74
 
75
  ---
76
 
 
77
  Elastic Models provides the same interface as HuggingFace Transformers. Here is an example of how to use the Llama-3.1-8B-Instruct model:
78
 
79
  ```python
 
142
 
143
  ---
144
 
 
145
  We have used the `lm_eval` library to validate the models. For each model size (S, M, L, XL), we have run the following tasks: MMLU, PIQA, Arc Challenge, Winogrande.
146
 
147
  ![Quality Benchmarking](https://cdn.thestage.ai/production/cms_file_upload/1773422713-7d51617f-e70a-41db-95f9-abd0d9ff338f/Elastic_Llama_3.1_8B_Instruct_MMLU.png)
148
 
149
  ### Quality Benchmark Results
150
 
 
 
151
  | **Metric/Model Size**| **S**| **M**| **L**| **XL**| **Original**| **W8A8, int8** |
152
  | --- | --- | --- | --- | --- | --- | --- |
153
  | **MMLU** | 67.4 | 68.1 | 68.3 | 68.5 | 68.4 | 24.3 |
 
160
 
161
  ---
162
 
 
163
  - **MMLU**: Measures model performance on a diverse set of multiple-choice questions covering various academic subjects, testing general knowledge and reasoning.
164
  - **PIQA**: Evaluates physical commonsense reasoning by asking the model to choose the most plausible solution to everyday physical problems.
165
  - **Arc Challenge**: Assesses scientific and factual reasoning using challenging multiple-choice questions from the AI2 Reasoning Challenge dataset.
 
169
 
170
  ---
171
 
 
172
  - **Accuracy**: Accuracy measures the proportion of model predictions that exactly match the correct answers across evaluation tasks.
173
 
174
 
 
176
 
177
  ---
178
 
 
179
  We measured TPS (tokens per second) for each model size using 100 input tokens and 300 output tokens.
180
 
181
  ![Latency Benchmarking](https://cdn.thestage.ai/production/cms_file_upload/1779128494-03458602-0144-446d-bebd-6d3ebc8b9907/Elastic_Llama_3.1_8B_Instruct_latency.png)
182
 
183
  ### Latency Benchmark Results
184
 
 
 
185
  Tokens per second for different model sizes on various GPUs.
186
 
187
  | **GPU/Model Size**| **S**| **M**| **L**| **XL**| **Original**| **W8A8_int8** |
 
197
 
198
  ---
199
 
 
200
  The benchmarking was performed on a single GPU with a batch size of 1. Each model was run for 10 iterations, and the average latency was calculated.
201
 
202
  > **Algorithm summary:**
 
216
 
217
  ---
218
 
 
219
  For serving with Nvidia GPUs, we provide ready-to-go Docker containers with OpenAI-compatible API endpoints.
220
  Using our containers you can set up an inference endpoint on any desired cloud/serverless providers as well as on-premise servers.
221
  You can also use this container to run inference through TheStage AI platform.
222
 
223
  ### Prebuilt image from ECR
224
 
 
 
225
  Pull docker image and start inference container:
226
 
227
  ```bash
228
+ docker pull public.ecr.aws/i3f7g5s7/thestage/elastic-models:0.2.1.post0-llm-24.09a
229
  ```
230
  ```bash
231
  docker run --rm -ti \
 
238
  -e HUGGINGFACE_ACCESS_TOKEN=<HUGGINGFACE_ACCESS_TOKEN> \
239
  -e THESTAGE_AUTH_TOKEN=<THESTAGE_ACCESS_TOKEN> \
240
  -v /mnt/hf_cache:/root/.cache/huggingface \
241
+ public.ecr.aws/i3f7g5s7/thestage/elastic-models:0.2.1.post0-llm-24.09a
242
  ```
243
 
244
  | **Parameter** | **Description** |
 
253
 
254
  ---
255
 
 
256
  You can invoke the endpoint using CURL as follows:
257
 
258
  ```bash
 
295
 
296
  ---
297
 
 
298
  ### Method
299
 
 
 
300
  > **POST** `/v1/chat/completions`
301
 
302
  ### Header Parameters
303
 
 
 
304
  > `Authorization`: `string`
305
  >
306
  > Bearer token for authentication. Should match the `AUTH_TOKEN` set during container startup.
 
315
 
316
  ### Input Body
317
 
 
 
318
  > `messages` : `string`
319
  >
320
  > The input text prompt.
 
324
 
325
  ---
326
 
 
327
  For more details please use the tutorial [Modal deployment](https://docs.thestage.ai/tutorials/source/modal_thestage.html)
328
 
329
  ### Clone modal serving code
330
 
 
 
331
  ```shell
332
  git clone https://github.com/TheStageAI/ElasticModels.git
333
  cd ElasticModels/examples/modal
 
335
 
336
  ### Configuration of environment variables
337
 
 
 
338
  Set your environment variables in `modal_serving.py`:
339
 
340
  ```python
 
353
 
354
  ### Configuration of GPUs
355
 
 
 
356
  Set your desired GPU type and autoscaling variables in `modal_serving.py`:
357
 
358
  ```python
 
379
 
380
  ### Run serving
381
 
 
 
382
  ```shell
383
  modal serve modal_serving.py
384
  ```