mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-05-14 02:02:16 +00:00
Move NVBench JSON result parsing into cuda.bench.results with explicit BenchmarkResult, BenchmarkResultDevice, BenchmarkResultSummary, SubBenchmarkResult, and SubBenchmarkState types. Remove the result reader from the top-level cuda.bench namespace and require construction through BenchmarkResult.from_json() or BenchmarkResult.empty(). Preserve bulk sample/frequency parsing and estimator helpers while making summaries rich objects that retain tag/name/hint/hide/description metadata. Add nvbench-json-summary to render NVBench JSON output as an NVBench-style markdown summary table, including axis formatting, device sections, hidden summary filtering, and summary hint formatting. Update packaging, type stubs, and tests for the new namespace, renamed classes, Python 3.10-compatible annotations, and summary-table generation.
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
# Copyright 2026 NVIDIA Corporation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 with the LLVM exception
|
|
# (the "License"); you may not use this file except in compliance with
|
|
# the License.
|
|
#
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://llvm.org/foundation/relicensing/LICENSE.txt
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
"""Utilities for reading NVBench JSON benchmark result files."""
|
|
|
|
from ._benchmark_result import (
|
|
BenchmarkResult,
|
|
BenchmarkResultDevice,
|
|
BenchmarkResultSummary,
|
|
SubBenchmarkResult,
|
|
SubBenchmarkState,
|
|
)
|
|
|
|
BenchmarkResult.__module__ = __name__
|
|
BenchmarkResultDevice.__module__ = __name__
|
|
BenchmarkResultSummary.__module__ = __name__
|
|
SubBenchmarkResult.__module__ = __name__
|
|
SubBenchmarkState.__module__ = __name__
|
|
|
|
__all__ = [
|
|
"BenchmarkResult",
|
|
"BenchmarkResultDevice",
|
|
"BenchmarkResultSummary",
|
|
"SubBenchmarkResult",
|
|
"SubBenchmarkState",
|
|
]
|