xzyao commited on
Commit
ad8af3c
·
verified ·
1 Parent(s): deb1a52

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +48 -31
README.md CHANGED
@@ -11,15 +11,6 @@ tags:
11
  - qwen3
12
  size_categories:
13
  - 10M<n<100M
14
- configs:
15
- - config_name: trace
16
- data_files:
17
- - split: train
18
- path: trace.jsonl
19
- - config_name: qwen3-32b-buckets
20
- data_files:
21
- - split: train
22
- path: qwen3-32b-buckets.jsonl
23
  ---
24
 
25
  # LLM Serving Trace
@@ -37,30 +28,51 @@ input-token buckets. It is packaged as newline-delimited JSON.
37
 
38
  ## Loading
39
 
 
 
 
 
 
40
  ```python
41
- from datasets import load_dataset
 
 
 
42
 
43
- trace = load_dataset("eth-easl/swissai-serving-trace", "trace", split="train")
44
- qwen_buckets = load_dataset(
45
- "eth-easl/swissai-serving-trace",
46
- "qwen3-32b-buckets",
47
- split="train",
48
  )
 
 
 
 
 
49
  ```
50
 
51
- For low-memory iteration, use streaming:
 
52
 
53
  ```python
54
- from datasets import load_dataset
55
 
56
- rows = load_dataset(
57
- "eth-easl/swissai-serving-trace",
58
- "qwen3-32b-buckets",
59
- split="train",
60
- streaming=True,
61
  )
 
 
 
 
 
 
 
62
 
63
- first_row = next(iter(rows))
 
 
64
  ```
65
 
66
  ## Schema
@@ -80,16 +92,21 @@ Each row contains:
80
  | `reported_token_input` | int64 | Reported input-token count, or `-1` when unavailable. |
81
  | `reported_token_output` | int64 | Reported output-token count, or `-1` when unavailable. |
82
 
83
- `model_parameters` contains:
 
 
84
 
85
- | Field | Type |
86
  | --- | --- |
87
- | `temperature` | float64 |
88
- | `max_tokens` | string |
89
- | `top_p` | float64 |
90
- | `frequency_penalty` | float64 |
91
- | `presence_penalty` | float64 |
92
- | `seed` | int64 |
 
 
 
93
 
94
  ### `qwen3-32b-buckets`
95
 
 
11
  - qwen3
12
  size_categories:
13
  - 10M<n<100M
 
 
 
 
 
 
 
 
 
14
  ---
15
 
16
  # LLM Serving Trace
 
28
 
29
  ## Loading
30
 
31
+ The files are distributed as raw newline-delimited JSON. The `model_parameters`
32
+ field is heterogeneous across requests (mixed types and occasional extra keys),
33
+ so the schema is not friendly to `datasets.load_dataset`'s automatic Arrow
34
+ inference. Download the files with `huggingface_hub` and read them directly.
35
+
36
  ```python
37
+ import json
38
+ from pathlib import Path
39
+
40
+ from huggingface_hub import snapshot_download
41
 
42
+ local_dir = snapshot_download(
43
+ repo_id="eth-easl/swissai-serving-trace",
44
+ repo_type="dataset",
45
+ allow_patterns=["trace.jsonl"], # or ["qwen3-32b-buckets.jsonl"], or both
 
46
  )
47
+
48
+ with (Path(local_dir) / "trace.jsonl").open("r", encoding="utf-8") as handle:
49
+ for line in handle:
50
+ record = json.loads(line)
51
+ # process record
52
  ```
53
 
54
+ To grab a single file without materialising the whole snapshot tree, use
55
+ `hf_hub_download`:
56
 
57
  ```python
58
+ from huggingface_hub import hf_hub_download
59
 
60
+ path = hf_hub_download(
61
+ repo_id="eth-easl/swissai-serving-trace",
62
+ filename="qwen3-32b-buckets.jsonl",
63
+ repo_type="dataset",
 
64
  )
65
+ ```
66
+
67
+ If you prefer a dataframe and have enough memory, pandas can read the JSONL
68
+ directly (`trace.jsonl` is ~7 GB, so consider `chunksize=`):
69
+
70
+ ```python
71
+ import pandas as pd
72
 
73
+ frames = pd.read_json(path, lines=True, chunksize=100_000)
74
+ for chunk in frames:
75
+ ... # process chunk
76
  ```
77
 
78
  ## Schema
 
92
  | `reported_token_input` | int64 | Reported input-token count, or `-1` when unavailable. |
93
  | `reported_token_output` | int64 | Reported output-token count, or `-1` when unavailable. |
94
 
95
+ `model_parameters` is the raw user-supplied generation config and is
96
+ deliberately not normalised. Most rows contain the keys below, but values are
97
+ mixed JSON types because they reflect what the client sent:
98
 
99
+ | Field | Observed JSON types |
100
  | --- | --- |
101
+ | `temperature` | number, `"null"` string, missing |
102
+ | `max_tokens` | number, string, `null` |
103
+ | `top_p` | number, `"null"` string, missing |
104
+ | `frequency_penalty` | number, string, list, `null`, missing |
105
+ | `presence_penalty` | number, string, bool, `null`, missing |
106
+ | `seed` | integer, missing |
107
+
108
+ A small number of rows also carry an extra `n` integer key. Coerce these to
109
+ your preferred schema at read time.
110
 
111
  ### `qwen3-32b-buckets`
112