Skip to content

Commit ae4e481

Browse files
committed
fix summary table hardware
1 parent 5ec3378 commit ae4e481

2 files changed

Lines changed: 5 additions & 29 deletions

File tree

benchmarks/benchmark_lib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ append_lm_eval_summary() {
324324
"tp": ${TP:-1},
325325
"ep": ${EP_SIZE:-1},
326326
"dp_attention": ${dp_json},
327-
"model": "${model_name:-}"
327+
"model": "${model_name:-}",
328+
"hw": "${RUNNER_TYPE:-unknown}"
328329
}
329330
META
330331

utils/collect_eval_results.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,6 @@ def scan_jsons(paths: List[Path]) -> Tuple[List[Tuple[float, Path]], List[Tuple[
109109
return lm_path, le_path
110110

111111

112-
def parse_pretty_env(pretty_env: str) -> str:
113-
try:
114-
lines = [l for l in pretty_env.splitlines() if l.startswith('GPU ')]
115-
names = [l.split(':', 1)[1].strip() for l in lines]
116-
if not names:
117-
return 'Unknown GPU'
118-
# Compress identical names (roughly)
119-
from collections import Counter
120-
c = Counter(names)
121-
return ' + '.join([f"{n}× {name}" for name, n in c.items()])
122-
except Exception:
123-
return 'Unknown GPU'
124-
125-
126112
def extract_lm_metrics(json_path: Path, task: Optional[str] = None) -> Dict[str, Any]:
127113
data = load_json(json_path) or {}
128114
results = data.get('results') or {}
@@ -220,11 +206,6 @@ def get_pair(fname: Optional[str]) -> Tuple[Optional[float], Optional[float]]:
220206
if isinstance(td, dict):
221207
n_eff = td.get('effective') or td.get('n_eff')
222208

223-
hardware = 'Unknown GPU'
224-
pe = data.get('pretty_env_info')
225-
if isinstance(pe, str) and pe:
226-
hardware = parse_pretty_env(pe)
227-
228209
model = (
229210
data.get('model_name')
230211
or (data.get('configs', {}).get(t, {}) or {}).get('metadata', {}).get('model')
@@ -239,7 +220,7 @@ def get_pair(fname: Optional[str]) -> Tuple[Optional[float], Optional[float]]:
239220
'strict_se': strict_se,
240221
'flex_se': flex_se,
241222
'n_eff': n_eff,
242-
'hardware': hardware,
223+
'hardware': 'Unknown GPU',
243224
'model': model,
244225
'source': str(json_path)
245226
}
@@ -313,14 +294,8 @@ def main():
313294
continue
314295

315296
# Merge with meta
316-
# Prefer explicit hardware identifiers from meta (if present) and fall back to parsed pretty_env_info
317-
hw_meta = (
318-
meta.get('hw')
319-
or meta.get('runner')
320-
or meta.get('RUNNER_TYPE')
321-
or None
322-
)
323-
hw_value = hw_meta if hw_meta else m.get('hardware', 'Unknown GPU')
297+
# Only use explicit hardware label written to meta_env.json ('hw')
298+
hw_value = meta.get('hw', 'Unknown GPU')
324299
row = {
325300
'model': m.get('model') or meta.get('model') or 'unknown',
326301
'hw': hw_value,

0 commit comments

Comments
 (0)