Skip to content

Commit 1283bc4

Browse files
committed
fix: address comments
Signed-off-by: Ilana Nguyen <inguyen@nvidia.com>
1 parent 200a664 commit 1283bc4

30 files changed

+214
-355
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Features
6363
| **[Template Endpoint](docs/tutorials/template-endpoint.md)** | Benchmark custom APIs with flexible Jinja2 request templates | Custom API formats, rapid prototyping, non-standard endpoints |
6464
| **[SGLang Image Generation](docs/tutorials/sglang-image-generation.md)** | Benchmark image generation APIs using SGLang with FLUX.1-dev model | Image generation testing, text-to-image benchmarking, extracting generated images |
6565
| **[Visualization & Plotting](docs/tutorials/plot.md)** | Generate PNG visualizations with automatic mode detection (single-run analysis or multi-run comparison) | Parameter sweep analysis, performance debugging, model comparison |
66-
|
6766

6867
### Working with Benchmark Data
6968
- **[Profile Exports](docs/tutorials/working-with-profile-exports.md)** - Parse and analyze `profile_export.jsonl` with Pydantic models, custom metrics, and async processing

docs/tutorials/plot.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Compares metrics across multiple profiling runs to identify optimal configuratio
6262
- Multiple paths specified as arguments
6363

6464
**Example:**
65-
```
65+
```text
6666
artifacts/sweep_qwen/
6767
├── Qwen3-0.6B-concurrency1/
6868
├── Qwen3-0.6B-concurrency2/
@@ -99,7 +99,7 @@ Analyzes performance over time for a single profiling run.
9999
- Directory contains `profile_export.jsonl` directly
100100

101101
**Example:**
102-
```
102+
```text
103103
artifacts/single_run/
104104
└── profile_export.jsonl
105105
```
@@ -231,7 +231,7 @@ experiment_classification:
231231
#### Example
232232

233233
**Directory structure:**
234-
```
234+
```text
235235
artifacts/
236236
├── baseline_moderate_io_isl100_osl200_streaming/ # Grey
237237
│ ├── concurrency_1/
@@ -330,8 +330,10 @@ The dashboard automatically detects visualization mode (multi-run comparison or
330330
- Token Throughput per GPU vs Interactivity
331331

332332
**Single-run plots** (time series):
333+
```text
333334
- GPU Utilization Over Time
334335
- GPU Memory Usage Over Time
336+
```
335337

336338
![GPU Utilization and Throughput Over Time](../diagrams/plot_examples/single_run/time_series/gpu_utilization_and_throughput_over_time.png)
337339

@@ -345,10 +347,12 @@ The dashboard automatically detects visualization mode (multi-run comparison or
345347
When timeslice data is available (via `--slice-duration` during profiling), plots show performance evolution across time windows.
346348

347349
**Generated timeslice plots:**
350+
```text
348351
- TTFT Across Timeslices
349352
- ITL Across Timeslices
350353
- Throughput Across Timeslices
351354
- Latency Across Timeslices
355+
```
352356

353357
**Timeslices enable easy outlier identification and bucketing analysis**. Each time window (bucket) shows avg/p50/p95 statistics, making it simple to spot which periods have outlier performance. Slice 0 often shows cold-start overhead, while later slices may reveal degradation. Flat bars across slices may indicate stable performance; increasing trends can suggest resource exhaustion. Potentially useful for quickly isolating performance issues to specific phases (warmup, steady-state, or degradation).
354358

src/aiperf/common/enums/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
FrequencyMetricUnit,
5757
FrequencyMetricUnitInfo,
5858
GenericMetricUnit,
59-
MetricDictValueTypeT,
6059
MetricFlags,
6160
MetricOverTimeUnit,
6261
MetricOverTimeUnitInfo,
@@ -65,10 +64,8 @@
6564
MetricTimeUnit,
6665
MetricTimeUnitInfo,
6766
MetricType,
68-
MetricUnitT,
6967
MetricValueType,
7068
MetricValueTypeInfo,
71-
MetricValueTypeT,
7269
MetricValueTypeVarT,
7370
PlotMetricDirection,
7471
PowerMetricUnit,
@@ -145,7 +142,6 @@
145142
"LifecycleState",
146143
"MediaType",
147144
"MessageType",
148-
"MetricDictValueTypeT",
149145
"MetricFlags",
150146
"MetricOverTimeUnit",
151147
"MetricOverTimeUnitInfo",
@@ -154,10 +150,8 @@
154150
"MetricTimeUnit",
155151
"MetricTimeUnitInfo",
156152
"MetricType",
157-
"MetricUnitT",
158153
"MetricValueType",
159154
"MetricValueTypeInfo",
160-
"MetricValueTypeT",
161155
"MetricValueTypeVarT",
162156
"ModelSelectionStrategy",
163157
"PlotMetricDirection",

src/aiperf/dataset/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
BaseLoader,
4141
BasePublicDatasetLoader,
4242
CustomDatasetT,
43-
Filename,
4443
MediaConversionMixin,
4544
MooncakeTrace,
4645
MooncakeTraceDatasetLoader,
@@ -71,7 +70,6 @@
7170
"CustomDatasetT",
7271
"DEFAULT_CORPUS_FILE",
7372
"DatasetManager",
74-
"Filename",
7573
"ImageGenerator",
7674
"MP3_SUPPORTED_SAMPLE_RATES",
7775
"MediaConversionMixin",

src/aiperf/dataset/loader/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
MultiTurnDatasetLoader,
3434
)
3535
from aiperf.dataset.loader.random_pool import (
36-
Filename,
3736
RandomPoolDatasetLoader,
3837
)
3938
from aiperf.dataset.loader.sharegpt import (
@@ -49,7 +48,6 @@
4948
"BaseLoader",
5049
"BasePublicDatasetLoader",
5150
"CustomDatasetT",
52-
"Filename",
5351
"MediaConversionMixin",
5452
"MooncakeTrace",
5553
"MooncakeTraceDatasetLoader",

src/aiperf/endpoints/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
SolidoEndpoint,
3636
)
3737
from aiperf.endpoints.template_endpoint import (
38-
NAMED_TEMPLATES,
3938
TemplateEndpoint,
4039
)
4140

@@ -49,7 +48,6 @@
4948
"HFTeiRankingsEndpoint",
5049
"HuggingFaceGenerateEndpoint",
5150
"ImageGenerationEndpoint",
52-
"NAMED_TEMPLATES",
5351
"NIMRankingsEndpoint",
5452
"SolidoEndpoint",
5553
"TemplateEndpoint",

src/aiperf/gpu_telemetry/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from aiperf.gpu_telemetry.constants import (
1010
DCGM_TO_FIELD_MAPPING,
11-
GPU_TELEMETRY_METRICS_CONFIG,
1211
SCALING_FACTORS,
1312
get_gpu_telemetry_metrics_config,
1413
)
@@ -24,7 +23,6 @@
2423

2524
__all__ = [
2625
"DCGM_TO_FIELD_MAPPING",
27-
"GPU_TELEMETRY_METRICS_CONFIG",
2826
"MetricsConfigLoader",
2927
"SCALING_FACTORS",
3028
"TelemetryDataCollector",

src/aiperf/plot/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
DEFAULT_PNG_OUTPUT_DIR,
3232
DERIVED_METRIC_DIRECTIONS,
3333
LIGHT_THEME_COLORS,
34-
METRIC_CATEGORY_RULES,
3534
NON_METRIC_KEYS,
3635
NVIDIA_BORDER_DARK,
3736
NVIDIA_BORDER_LIGHT,
@@ -56,8 +55,6 @@
5655
)
5756
from aiperf.plot.core import (
5857
DEFAULT_IGNORE_PARAMS,
59-
DERIVED_METRICS_REGISTRY,
60-
PLOT_TYPE_METADATA,
6158
DataLoader,
6259
DataSource,
6360
DerivedMetricCalculator,
@@ -243,7 +240,6 @@
243240
"DEFAULT_PLOT_HEIGHT",
244241
"DEFAULT_PLOT_WIDTH",
245242
"DEFAULT_PNG_OUTPUT_DIR",
246-
"DERIVED_METRICS_REGISTRY",
247243
"DERIVED_METRIC_DIRECTIONS",
248244
"DashboardBuilder",
249245
"DashboardServer",
@@ -257,7 +253,6 @@
257253
"ExperimentClassificationConfig",
258254
"HistogramHandler",
259255
"LIGHT_THEME_COLORS",
260-
"METRIC_CATEGORY_RULES",
261256
"MULTI_RUN_PLOT_TYPES",
262257
"MULTI_RUN_STAT_OPTIONS",
263258
"MetricSpec",
@@ -278,7 +273,6 @@
278273
"OUTLIER_RED",
279274
"PLOT_FONT_FAMILY",
280275
"PLOT_LOG_FILE",
281-
"PLOT_TYPE_METADATA",
282276
"PROFILE_EXPORT_AIPERF_JSON",
283277
"PROFILE_EXPORT_GPU_TELEMETRY_JSONL",
284278
"PROFILE_EXPORT_JSONL",

src/aiperf/plot/core/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"""
77

88
from aiperf.plot.core.data_loader import (
9-
DERIVED_METRICS_REGISTRY,
109
DataLoader,
1110
DerivedMetricCalculator,
1211
RunData,
@@ -31,7 +30,6 @@
3130
get_nvidia_color_scheme,
3231
)
3332
from aiperf.plot.core.plot_specs import (
34-
PLOT_TYPE_METADATA,
3533
DataSource,
3634
ExperimentClassificationConfig,
3735
MetricSpec,
@@ -55,14 +53,12 @@
5553

5654
__all__ = [
5755
"DEFAULT_IGNORE_PARAMS",
58-
"DERIVED_METRICS_REGISTRY",
5956
"DataLoader",
6057
"DataSource",
6158
"DerivedMetricCalculator",
6259
"ExperimentClassificationConfig",
6360
"MetricSpec",
6461
"ModeDetector",
65-
"PLOT_TYPE_METADATA",
6662
"PlotGenerator",
6763
"PlotSpec",
6864
"PlotType",

src/aiperf/plot/core/data_loader.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
formats suitable for visualization and analysis.
1010
"""
1111

12-
import json
1312
from fnmatch import fnmatch
1413
from pathlib import Path
1514
from typing import Any
1615

1716
import numpy as np
17+
import orjson
1818
import pandas as pd
1919
from pydantic import Field
2020

@@ -521,7 +521,7 @@ def _read_jsonl_with_error_handling(
521521
try:
522522
record = parse_func(line)
523523
records.append(record)
524-
except (json.JSONDecodeError, Exception) as e:
524+
except (orjson.JSONDecodeError, Exception) as e:
525525
corrupted_lines += 1
526526
self.warning(
527527
f"Skipping invalid line {line_num} in {jsonl_path}: {e}"
@@ -676,8 +676,8 @@ def _load_aggregated_json(self, json_path: Path) -> dict[str, Any]:
676676
raise DataLoadError("Required JSON file not found", path=str(json_path))
677677

678678
try:
679-
with open(json_path, encoding="utf-8") as f:
680-
data = json.load(f)
679+
with open(json_path, "rb") as f:
680+
data = orjson.loads(f.read())
681681

682682
if "metrics" in data and isinstance(data["metrics"], dict):
683683
parsed_metrics = {}
@@ -691,7 +691,7 @@ def _load_aggregated_json(self, json_path: Path) -> dict[str, Any]:
691691

692692
self.info(f"Loaded aggregated data from {json_path}")
693693
return data
694-
except json.JSONDecodeError as e:
694+
except orjson.JSONDecodeError as e:
695695
raise DataLoadError(
696696
f"Failed to parse JSON file: {e}", path=str(json_path)
697697
) from e
@@ -765,7 +765,7 @@ def _load_gpu_telemetry_jsonl(
765765
return None
766766

767767
def parse_line(line: str) -> dict:
768-
data = json.loads(line)
768+
data = orjson.loads(line.encode("utf-8"))
769769

770770
telemetry_data = data.pop("telemetry_data", {})
771771
flat_record = {**data, **telemetry_data}

0 commit comments

Comments
 (0)