MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / read_metadata

Function read_metadata

benchmarking/plot-triton-bench.py:73–87  ·  view source on GitHub ↗

Read metadata.json dumped by the benchmark runner. Falls back to args.json and logs.txt for older result directories.

(folder: Path)

Source from the content-addressed store, hash-verified

71
72
73def read_metadata(folder: Path) -> dict:
74 """Read metadata.json dumped by the benchmark runner.
75
76 Falls back to args.json and logs.txt for older result directories.
77 """
78 metadata_file = folder / "metadata.json"
79 if metadata_file.exists():
80 return json.loads(metadata_file.read_text())
81
82 # defaults for old results that don't have metadata.json
83 metadata: dict = {
84 "gpu_name": _read_gpu_name_from_logs(folder),
85 "device_count": 1,
86 }
87 return metadata
88
89
90def _read_gpu_name_from_logs(folder: Path) -> str | None:

Callers 1

Calls 1

_read_gpu_name_from_logsFunction · 0.85

Tested by

no test coverage detected