SuperBench Documentation
repository·main·Indexed 18 days ago
https://github.com/microsoft/superbenchmarkA validation and profiling tool for AI infrastructure designed to improve cloud AI reliability through proactive validation. SuperBench provides a CLI (`sb`) for managing, deploying, and executing benchmarks across local and distributed environments (100 to 1000 nodes). It features a hierarchical execution model consisting of a CLI, Runner, and Executor, supporting E2E model benchmarks (training and inference), micro-benchmarks, and Docker-based workloads.
What's inside SuperBench
- SuperBench is a validation and profiling tool designed for AI infrastructure. It is used to improve cloud AI infrastructure reliability through proactive validation. For more detailed information, visit the official website at aka.ms/superbench.
Overview of the SuperBench CLI
mainThe SuperBench CLI (sb) is a command-line interface designed to help users manage, deploy, and execute benchmarks. It provides a centralized way to list available benchmarks, inspect parameters, deploy environments, execute runs, and analyze results.Overview of SuperBench features and capabilities
mainSuperBench is a validation and profiling tool designed for AI infrastructure. It serves two primary purposes:
AI Infrastructure Validation and Diagnosis:
- Automates distributed validation for hundreds or thousands of servers.
- Validates both raw hardware and end-to-end (E2E) model performance using ML workload patterns.
- Establishes contracts to identify hardware issues.
- Provides infrastructure-oriented criteria to act as Performance/Quality Gates for hardware and system releases.
- Generates detailed performance reports and provides advanced analysis tools.
AI Workload Benchmarking and Profiling:
- Enables comprehensive performance comparisons across different hardware platforms.
- Provides insights for hardware and software co-design.
SuperBench achieves this through a combination of micro-benchmarks (for primitive computation and communication) and model-benchmarks (for domain-aware, end-to-end deep learning workloads).
SuperBench 0.3.0 Framework Features
mainThe SuperBench 0.3.0 release introduced several core framework improvements:
- Runner: Now supports MPI mode for distributed execution.
- Benchmarks: Added support for Docker benchmarks.
New Platform and Hardware Support in SuperBench 0.9.0
mainThe 0.9.0 release expanded support for the following environments and hardware:
- Windows Docker: Support for VDI/Gaming GPU workloads.
- DirectX Platform: Support for Nvidia and AMD GPUs via the DirectX platform and test pipeline.
- Nvidia H100: Support for TensorRT models on Nvidia H100 hardware.
- Interrupt Handling: Support for
Ctrl+Cand interrupts to stop all SuperBench testing processes.
SuperBench 0.4.0 Release Features
mainSuperBench v0.4.0 introduced several core capabilities for performance validation:
Monitoring Framework
Includes support for monitoring:
- NVIDIA GPU
- CPU
- Memory
- Disk
Data Diagnosis and Analysis
- Baseline-based diagnosis: Compare current runs against established baselines.
- Basic analysis: Includes features like boxplot figures and outlier detection.
Validation Capabilities
Single-node
- Micro Benchmarks: CPU Memory Validation (via Intel Memory Latency Checker), GPU Copy Bandwidth, and support for ORT models on AMD GPUs.
- Inference Backends: Support for TensorRT and ORT.
Multi-node
- Networking: IB Networking validation, TCP validation (via
TCPing), and GPCNet validation.
How the SuperBench Executor and Benchmark frameworks work
mainSuperBench is built on two primary modular frameworks:
Executor Framework
Designed for large-scale cluster validation, this framework uses a runner (control node) and multiple executors (worker nodes).
- The runner receives commands from the CLI, distributes them to worker nodes, collects data, and summarizes results.
- Each worker runs an executor to perform the specified benchmark tasks.
Benchmark Framework
SuperBench distinguishes between two types of benchmarks:
- Micro-benchmarks: Focus on primitive computation (e.g., GEMM Flops, Kernel Launch Time) and communication (e.g., Memory, RDMA, NCCL).
- Model-benchmarks: Measure end-to-end deep learning workloads (e.g., CNN, LSTM, BERT, GPT-2).
All benchmarks are built upon an abstract
BenchmarkBaseclass, which provides common functions and ensures a unified interface and result format. Developers can extend the framework by implementing new benchmarks based on this class.How Benchmarks, Modes, Task Groups, and Tasks are organized
mainSuperBench uses a nested abstraction model to define how hardware performance tests are executed:
- Module (Benchmark): The highest level of abstraction (e.g., the
ncclmodule). It implements abstract methods for pre-checks, measurement, post-checks, and result saving. - Mode: A specific way a module runs. For example, a module might have a
localmode (single node) or anmpimode (distributed across all nodes). - Task Group: A collection of tasks within a mode that requires a barrier. The Runner ensures all nodes finish the current Task Group before any node starts the next one (e.g., in NCCL MPI mode,
all_reducemight be one task group). - Task: The smallest unit of work within a Task Group. There is no barrier between tasks inside the same group.
- Module (Benchmark): The highest level of abstraction (e.g., the
Configure MPI execution patterns in SuperBench
mainIn
mpimode, SuperBench now supports thepatternoption to run tasks in parallel. Supported patterns include:topo-awareall-pairK-batch
Supported functions for diagnosis rules
mainWhen defining a rule in the YAML rule file, you must specify one of the following
functiontypes:variance: Calculates the variance between raw data and the baseline:(raw data - baseline) / baseline. Thecriteriais then applied to this variance value.- Example:
criteria: lambda x: x < -0.05identifies a downgrade of more than 5%.
- Example:
value: Checks the raw data directly against thecriteriawithout calculating variance.- Example:
criteria: lambda x: x > 0identifies if a value is positive.
- Example:
multi_rules: Allows a rule to depend on the results of previously defined rules. Thecriteriareceives alabelobject containing the results of those rules.- Example:
criteria: 'lambda label: bool(label["rule4"] + label["rule5"] >= 2)'triggers if the sum of results fromrule4andrule5is at least 2.
- Example:
failure_check: Checks if metrics failed or were missed. Metrics should follow the pattern${benchmark_name}/.*:return_code.- A metric is considered missed if it doesn't match any raw data.
- A metric is considered failed if its
return_codeviolates thevaluecriteria (i.e.,return_code != 0). - Note: You should always include a default rule for
${benchmark_name}/return_codeto identify failed tests.
Configure the SuperBench rule file
mainThe rule file (YAML) defines how metrics are classified, aggregated, and statistically processed. It follows the same convention as the SuperBench Config File.
Rule File Structure
version: string superbench: rules: ${rule_name}: statistics: - ${statistic_name} categories: string aggregate: (optional)[bool|string] metrics: - ${benchmark_name}/regexRule Elements
metrics: A list of metrics in the format${benchmark_name}/regex. The benchmark name must be a literal string, but you can use regex after the first/to match specific metrics.categories: A string used to group and organize the metrics in the final report.statistics: A list of statistical functions to apply to the metrics. Supported functions include:countmaxmeanminp${value}(where${value}is 1-99, e.g.,p50,p90)std
aggregate(Optional): Determines if results from multiple devices/ranks should be treated as one collection. It accepts two types of values:bool:False(default): No aggregation.True: Aggregates results from multiple ranks. For microbenchmarks, metric names likemetric:1are aggregated intometric.
pattern string(regex): Uses a regex pattern to match metric names. The part of the metric matching the capture group()is replaced with*in the aggregated name, while other parts remain unchanged.
# Example Rule File version: v0.12 superbench: rules: kernel_launch: statistics: - mean - p90 - min - max aggregate: True categories: KernelLaunch metrics: - kernel-launch/event_time - kernel-launch/wall_time 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+)How SuperBench works: Architecture and Pipeline
mainSuperBench is a distributed testing framework designed for clusters of 100 to 1000 nodes (bare-metal, on-premises, or cloud). It uses a hierarchical execution model to run benchmarks across multiple nodes, supporting various device vendors (NVIDIA/AMD) and execution modes (local/MPI).
Execution Pipeline
- Preparation: The user provides a configuration file and a host file (optional, defaults can be used).
- CLI Invocation: The user runs the SuperBench CLI on the head node.
- Runner Initialization: The SuperBench Runner parses inputs, checks connectivity, ensures Docker environments are ready, and starts Docker containers on all target nodes.
- Context Distribution: The Runner distributes necessary code, configs, and SSH keys to all nodes to enable passwordless communication.
- Execution Loop: The Runner iterates through all benchmarks and modes. For each, it calls the SuperBench Executor inside the Docker container on the target nodes.
- Executor Execution: The Executor runs the specific benchmark tasks, handles pre/post-processing (health checks, validation), and captures results.
- Result Collection: The Executor sends return codes and results back to the Runner. The Runner then reduces (merges) results from all compute nodes into a single summary report.
- Completion: The CLI returns the final summarized results to the user.