result-summary.md 4.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
---
id: result-summary
---

# Result Summary

## Introduction

This tool is to generate a readable summary report based on the raw benchmark results of single or multiple machines.

## Usage

13
1. [Install SuperBench](../getting-started/installation.mdx) on the local machine.
14
15
16

2. Prepare the raw data and rule file on the local machine.

17
3. Generate the result summary automatically using `sb result summary` command. The detailed command can be found from [SuperBench CLI](../cli.md).
18
19
20
21
22

  ```bash
  sb result summary --data-file ./results-summary.jsonl --rule-file ./rule.yaml --output-file-format md --output-dir ${output-dir}
  ```

23
4. Find the output result file named 'results-summary.md' under ${output_dir}.
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

## Input

The input includes 2 files:

- **Raw Data**: jsonl file including multiple nodes' results automatically generated by SuperBench runner.

:::tip Tips
Raw data file can be found at ${output-dir}/results-summary.jsonl after each successful run.
:::

- **Rule File**: It uses YAML format and defines how to generate the result summary including how to classify the metrics and what statistical methods (P50, mean, etc.) are applied.

### Rule File

This section describes how to write rules in **rule file**.

41
The convention is the same as [SuperBench Config File](../superbench-config.mdx), please view it first.
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

Here is an overview of the rule file structure:

```yaml title="Scheme"
version: string
superbench:
  rules:
    ${rule_name}:
      statistics:
        - ${statistic_name}
      categories: string
      aggregate: (optional)[bool|string]
      metrics:
        - ${benchmark_name}/regex
        - ${benchmark_name}/regex
```

```yaml title="Example"
# SuperBench rules
61
version: v0.12
62
63
64
65
66
67
68
69
70
71
72
superbench:
  rules:
    kernel_launch:
      statistics:
        - mean
        - p90
        - min
        - max
      aggregate: True
      categories: KernelLaunch
      metrics:
one's avatar
one committed
73
74
75
76
        - kernel-launch/e2e_latency_us
        - kernel-launch/host_dispatch_us
        - kernel-launch/launch_throughput_mkps
        - kernel-launch/device_launch_us
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
    nccl:
      statistics: mean
      categories: NCCL
      metrics:
        - nccl-bw/allreduce_8388608_busbw
    ib-loopback:
      statistics: mean
      categories: RDMA
      metrics:
        - ib-loopback/IB_write_8388608_Avg_\d+
      aggregate: ib-loopback/IB_write_.*_Avg_(\d+)
```

This rule file describes the rules used for the result summary.

They are organized by the rule name and each rule mainly includes several elements:

#### `metrics`

The list of metrics for this rule. Each metric is in the format of ${benchmark_name}/regex, you can use regex after the first '/', but to be noticed, the benchmark name can not be a regex.

#### `categories`

User-defined category name in string belongs to the rule, which is used to classify and organize the metrics.

#### `aggregate`

This item is used to determine whether to aggregate the benchmark results from multiple devices to treat them as one collection.
For example, aggregate the results of kernel-launch overhead from 8 GPU devices into one collection.

The value of this item should be bool or pattern string with regex​:

- bool:
  - `False`(default): if no aggregation.
  - `True`: aggregate the results of multiple ranks. In detail, the metric names in `metrics` like 'metric:\\d+' will be aggregated and turned into 'metric' for most microbenchmark metrics.
- pattern string with regex: aggregate the results using the pattern string, which is used to match the metric names in `metrics`. In detail, the part of the metric that matches the contents of () in the pattern string will be turned into *, other parts of the metric remain unchanged.

#### `statistics`

A list of statistical functions is used for this rule to get the results statistics from multiple nodes/ranks.

The following illustrates all statistical functions:
- `count`
- `max`
- `mean`
- `min`
- `p${value}`: ${value} can be 1-99. For example, p50, p90, etc.
- `std`
125
126
127
128
129

## Output

We support different output formats for result sumamry including markdown, html, etc.
The output includes the metrics grouped by category and their values obtained by applying statistical methods to all raw results.