Skip to content

Commit a750ece

Browse files
committed
Add gpt-oss-120b example
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
1 parent 6c2aac2 commit a750ece

2 files changed

Lines changed: 110 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## Getting dataset:
2+
The dataset can be obtained from the LLM task-force which is in the process of finalizing the contents of the dataset for both performance and accuracy. The dataset is in a parquet format.
3+
4+
5+
## Launch server:
6+
Common configs:
7+
```
8+
export HF_HOME=<your_hf_home_dir>
9+
export HF_TOKEN=<your_hf_token>
10+
export MODEL_NAME=openai/gpt-oss-120b
11+
12+
```
13+
14+
`vLLM` can be lanuched via:
15+
16+
```
17+
docker run --runtime nvidia --gpus all -v ${HF_HOME}:/root/.cache/huggingface --env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN" -p 8000:8000 --ipc=host vllm/vllm-openai:latest --model ${MODEL_NAME} --gpu_memory_utilization 0.95
18+
```
19+
`SGLang` can be launched via:
20+
```
21+
docker run --runtime nvidia --gpus all --net host -v ${HF_HOME}:/root/.cache/huggingface --env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN" --ipc=host lmsysorg/sglang:latest python3 -m sglang.launch_server --model-path ${MODEL_NAME} --host 0.0.0.0 --port 3000 --data-parallel-size=1 --max-running-requests 512 --mem-fraction-static 0.85 --chunked-prefill-size 16384 --ep-size=1 --enable-metrics --stream-interval 500
22+
```
23+
24+
25+
## Launch benchmark:
26+
27+
```
28+
inference-endpoint benchmark from-config -c examples/04_GPTOSS120B_Example/gptoss_120b_example.yaml --timeout 6000
29+
```
30+
31+
## vllm bench:
32+
`vllm bench serve` provided support for custom datasets only via the `jsonl` format. We can convert the parquet files to `jsonl` via the following script:
33+
34+
```
35+
import pandas as pd
36+
37+
parquet_file = 'examples/04_GPTOSS120B_Example/data/perf_eval_ref.parquet'
38+
json_file = 'examples/04_GPTOSS120B_Example/data/perf_eval_ref.jsonl'
39+
40+
# 1. Read the original file
41+
df = pd.read_parquet(parque_file)
42+
43+
# 2. Rename the column(s)
44+
# Use a dictionary mapping old names to new names
45+
df = df.rename(columns={'prompt': 'raw_prompt'})
46+
df = df.rename(columns={'text_input': 'prompt'})
47+
48+
# 3. Write the renamed DataFrame to a new file
49+
df.to_json(json_file, orient='records', lines=True)
50+
51+
```
52+
Note that it also renames the column from `text_input` to `prompt` as the custom dataloader requires the `jsonl` to have the pre-processed prompt under that name.
53+
We can launch the benchmarking command but it has to be pointed to the `completions` endpoint instead of the `chat-completions` endpoint as the prompt is preprocessed. While the numbers generated cannot be directly compared to inference-endpoint (which uses the `chat-completion` endpoint), it can provide a good reference for relative performance given the output token distribution.
54+
55+
```
56+
vllm bench serve --backend vllm --model ${MODEL_NAME} --endpoint /v1/completions --dataset-name custom --dataset-path /home/scratch.rkaleem_gpu/datasets/gpt-oss/v3/acc/acc_eval_inputs.jsonl --custom-output-len 2000 --num-prompts 6396 --max-concurrency 512 --save-result --save-detailed
57+
58+
```
59+
60+
## Debugging:
61+
[mitmproxy](https://www.mitmproxy.org/) is a tool that can help debug HTTP requests and responses to understand the differences in payload for different scenarios. For our use case, we would like to be able to inspect the HTTP requests and responses between the benchmarking client and the server. We can run `mitmproxy` in a reverse-proxy mode as below:
62+
63+
```
64+
mitmproxy -p 8001 --mode reverse:http://localhost:8000/
65+
```
66+
This launches `mitmproxy` at port `8081` and forwards it to `8000` on the local machine. Now our server (`vLLM` or `SGLang`) can run on port `8000` and our client will send requests to `8001` which will be logged and forwarded to the server. The client will recieve the response back transparently with the responses being logged as well. This allows us to inspect the exact
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "gpt-oss-120b-benchmark"
2+
version: "1.0"
3+
type: "online"
4+
5+
model_params:
6+
name: "openai/gpt-oss-120b"
7+
temperature: 1.0
8+
max_new_tokens: 32768
9+
top_k: -1
10+
top_p: 1.0
11+
streaming: "on"
12+
13+
datasets:
14+
- name: "perf-test"
15+
type: "performance"
16+
path: "examples/04_GPTOSS120B_Example/data/perf_eval_ref.parquet"
17+
18+
settings:
19+
runtime:
20+
min_duration_ms: 300 # 3 minutes
21+
max_duration_ms: 6000 # 8 minutes
22+
scheduler_random_seed: 42 # For Poisson/distribution sampling
23+
dataloader_random_seed: 42 # For dataset shuffling
24+
25+
load_pattern:
26+
type: "concurrency"
27+
target_concurrency: 512 # works for 120b
28+
29+
client:
30+
workers: 4
31+
record_worker_events: true
32+
33+
metrics:
34+
collect:
35+
- "throughput"
36+
- "latency"
37+
- "ttft"
38+
- "tpot"
39+
40+
endpoint_config:
41+
endpoint: "http://localhost:3000"
42+
api_key: null
43+
44+
report_dir: "results/gptoss_120b_benchmark_mlperf_18DEC/"

0 commit comments

Comments
 (0)