Skip to content

Commit 462cd1c

Browse files
deepseek is working
1 parent ccf5f2b commit 462cd1c

File tree

5 files changed

+322
-98
lines changed

5 files changed

+322
-98
lines changed

harness/USAGE_EXAMPLES.md

Lines changed: 13 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ This document provides detailed examples for using the MLPerf Inference Harness
1717
python harness_main.py --model-category llama3.1-8b --model RedHatAI/Meta-Llama-3.1-8B-Instruct-FP8 --dataset-path cnn_eval.json --dataset-name llama3.1-8b --server-config backendserver/simple.yaml --scenario Server --test-mode performance --batch-size 13368 --num-samples 13368 --output-dir TEST-SERVER --lg-model-name llama3_1-8b --server-target-qps 40
1818
```
1919

20+
### Sample command for Deepseek
21+
```bash
22+
python harness_main.py --model-category deepseek-r1 --model deepseek-ai/DeepSeek-R1-0528 --dataset-path mlperf_deepseek_r1_dataset_4388_fp8_eval.pkl --dataset-name deepseek-r1 --scenario Offline --test-mode performance --batch-size 4388 --num-samples 4388 --output-dir <output_dir> --lg-model-name deepseek-r1 --server-config backendserver/deepseek.yaml --mlflow-experiment-name testing-stuff --mlflow-host ip --enable-metrics
23+
```
24+
25+
### Sample command with MLflow auto-upload
26+
```bash
27+
python harness_main.py --model-category llama3.1-8b --model RedHatAI/Meta-Llama-3.1-8B-Instruct-FP8 --dataset-path cnn_eval.json --dataset-name llama3.1-8b --server-config backendserver/simple.yaml --scenario Server --test-mode performance --batch-size 13368 --num-samples 13368 --output-dir TEST-SERVER-2 --lg-model-name llama3_1-8b --server-target-qps 40 --mlflow-experiment-name testing-stuff --mlflow-host 150.239.115.202
28+
```
29+
30+
**Note:** When `--mlflow-experiment-name` and `--mlflow-host` are provided, results are automatically uploaded to MLflow after the test completes successfully. No separate upload step is needed.
31+
2032
## Basic Usage
2133

2234
### Example 1: Simplest Case - Using Model Name Auto-Detection
@@ -81,86 +93,7 @@ python harness/harness_main.py \
8193
### Example 5: DeepSeek R1 Model
8294

8395
```bash
84-
python language/deepseek-r1/harness_deepseek_r1.py \
85-
--model deepseek-ai/DeepSeek-R1-0528 \
86-
--dataset-path ./deepseek_dataset.pkl \
87-
--dataset-name deepseek-r1
88-
```
89-
90-
### Example 6: Using Model Config File
91-
92-
```bash
93-
# Model config is auto-loaded from configs/models/llama3.1-8b.yaml
94-
python harness/harness_main.py \
95-
--model llama3.1-8b \
96-
--dataset-path ./cnn_eval.json
97-
```
98-
99-
## Dataset Configuration
100-
101-
### Example 7: Using Dataset Config File
102-
103-
```bash
104-
# Specify exact config file to use
105-
python harness/harness_main.py \
106-
--model meta-llama/Llama-3.1-8B-Instruct \
107-
--dataset-path ./my_dataset.pkl \
108-
--dataset-config-file configs/datasets/my-dataset.yaml
109-
```
110-
111-
### Example 8: Overriding Column Names
112-
113-
```bash
114-
# Override column mappings without creating config file
115-
python harness/harness_main.py \
116-
--model my-model/MyModel \
117-
--dataset-path ./dataset.pkl \
118-
--input-column prompt \
119-
--input-ids-column token_ids \
120-
--output-column target
121-
```
122-
123-
### Example 9: Combining Config and Overrides
124-
125-
```bash
126-
# Use config file but override specific column
127-
python harness/harness_main.py \
128-
--model meta-llama/Llama-3.1-8B-Instruct \
129-
--dataset-path ./cnn_eval.json \
130-
--dataset-config-file configs/datasets/llama3.1-8b.yaml \
131-
--input-column custom_input # Overrides config's input_column
132-
```
133-
134-
### Example 10: Different Dataset Formats
135-
136-
```bash
137-
# JSON dataset
138-
python harness/harness_main.py \
139-
--model llama3.1-8b \
140-
--dataset-path ./cnn_eval.json \
141-
--dataset-name llama3.1-8b
142-
143-
# Pickle dataset
144-
python harness/harness_main.py \
145-
--model deepseek-r1 \
146-
--dataset-path ./deepseek_dataset.pkl \
147-
--dataset-name deepseek-r1
148-
149-
# CSV dataset (needs config with column mappings)
150-
python harness/harness_main.py \
151-
--model my-model \
152-
--dataset-path ./my_dataset.csv \
153-
--dataset-name my-dataset
154-
```
155-
156-
## Endpoint Configuration
157-
158-
### Example 11: Using Completions Endpoint (Default)
159-
160-
```bash
161-
# Explicitly specify completions endpoint
162-
python harness/harness_main.py \
163-
--model llama3.1-8b \
96+
model llama3.1-8b \
16497
--dataset-path ./cnn_eval.json \
16598
--api-server-url http://localhost:8000 \
16699
--endpoint-type completions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Example YAML configuration for inference server
2+
# This file demonstrates how to configure an inference server
3+
4+
# Backend type: 'vllm' or 'sglang'
5+
backend: vllm
6+
7+
# Model name or path
8+
model: deepseek-ai/DeepSeek-R1-0528
9+
10+
# Server port
11+
port: 8000
12+
13+
# Output directory for server logs
14+
#output_dir: ./test_dir
15+
16+
# Heartbeat configuration
17+
heartbeat_interval: 100 # Interval between heartbeat checks (seconds)
18+
heartbeat_timeout: 30 # Timeout for heartbeat checks (seconds)
19+
startup_timeout: 1200 # Timeout for server startup (seconds)
20+
21+
# Debug mode - verify cleanup of server and child processes
22+
# Especially useful for tensor parallel/data parallel setups
23+
debug_mode: false # Enable debug mode for process cleanup verification
24+
25+
# Path to Python binary (default: 'python')
26+
#binary_path: python
27+
28+
# Custom launch command (optional - overrides default command generation)
29+
# If specified, this command will be used instead of the backend's default command
30+
# launch_command:
31+
# - python
32+
# - -m
33+
# - vllm.entrypoints.openai.api_server
34+
# - --model
35+
# - meta-llama/Llama-2-7b-hf
36+
# - --port
37+
# - "8000"
38+
39+
# Environment variables to set
40+
env_vars:
41+
CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
42+
OMP_NUM_THREADS: "16"
43+
VLLM_STATS_LOG_INTERVAL: "5"
44+
# Add any other environment variables here
45+
46+
# Backend-specific configuration
47+
config:
48+
# For vLLM
49+
api_server_args:
50+
- --tensor-parallel-size
51+
- "8"
52+
- --gpu-memory-utilization
53+
- "0.9"
54+
# Add any other vLLM arguments here
55+
56+
# For SGLang
57+
# server_args:
58+
# - --tp
59+
# - "1"
60+

harness/data/dataset_processor.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ def _process_data(self):
226226
if hasattr(self, 'processed_data') and PANDAS_AVAILABLE:
227227
df = self.processed_data
228228

229+
# Print dataset column names and types
230+
self.logger.info("=" * 80)
231+
self.logger.info("DATASET COLUMNS AND TYPES")
232+
self.logger.info("=" * 80)
233+
for col_name, col_type in df.dtypes.items():
234+
self.logger.info(f" {col_name}: {col_type}")
235+
self.logger.info(f"Total columns: {len(df.columns)}")
236+
self.logger.info(f"Total rows: {len(df)}")
237+
self.logger.info("=" * 80)
238+
229239
# Extract input column
230240
if self.input_column in df.columns:
231241
self.input = df[self.input_column].tolist()
@@ -255,6 +265,33 @@ def _process_data(self):
255265

256266
elif hasattr(self, 'raw_data'):
257267
# Handle raw dict/list data
268+
# Print dataset column names and types for raw data
269+
self.logger.info("=" * 80)
270+
self.logger.info("DATASET COLUMNS AND TYPES")
271+
self.logger.info("=" * 80)
272+
if isinstance(self.raw_data, dict):
273+
# Dict with lists as values
274+
for key, value in self.raw_data.items():
275+
if isinstance(value, list) and len(value) > 0:
276+
sample_type = type(value[0]).__name__
277+
self.logger.info(f" {key}: list[{sample_type}] (length: {len(value)})")
278+
else:
279+
self.logger.info(f" {key}: {type(value).__name__}")
280+
self.logger.info(f"Total columns: {len(self.raw_data)}")
281+
elif isinstance(self.raw_data, list):
282+
# List of dicts
283+
if len(self.raw_data) > 0:
284+
first_item = self.raw_data[0]
285+
if isinstance(first_item, dict):
286+
for key, value in first_item.items():
287+
self.logger.info(f" {key}: {type(value).__name__}")
288+
self.logger.info(f"Total columns: {len(first_item)}")
289+
self.logger.info(f"Total rows: {len(self.raw_data)}")
290+
else:
291+
self.logger.info(f" (list item type: {type(first_item).__name__})")
292+
self.logger.info(f"Total items: {len(self.raw_data)}")
293+
self.logger.info("=" * 80)
294+
258295
if isinstance(self.raw_data, dict):
259296
# Dict with lists as values
260297
self.input = self.raw_data.get(self.input_column, [])

0 commit comments

Comments
 (0)