Skip to content

Benchmarks: Refine GPU stream performance with autotune and preconfig - #895

Open
WenqingLan1 wants to merge 8 commits into
mainfrom
wenqinglan/refine-gpu-stream
Open

WenqingLan1 wants to merge 8 commits into
mainfrom
wenqinglan/refine-gpu-stream

Conversation

@WenqingLan1

@WenqingLan1 WenqingLan1 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description
Rework GPU STREAM bandwidth benchmarking with automatic per-operation launch tuning and optional fixed configurations.

Major Revision

  • Refactor vectorized CUDA kernels with compile-time unrolling, adaptive 32/64-bit indexing, and scalar tail handling.
  • Autotune Copy, Scale, Add, and Triad across supported block-size/unroll combinations. Add inline kernel_configs JSON overrides, with fallback tuning for unlisted operations.
  • Replace buffer/block-specific metric names with one bandwidth/efficiency pair per operation and datatype. Preserve selected launch parameters in raw logs.

Minor Revision

  • Increase the default per-array buffer size from 4 GiB to 8 GiB.
  • Strengthen argument validation, result parsing, and CUDA error handling.
  • Update documentation, examples, configuration/parsing tests, and synthetic float/double log fixtures.

@WenqingLan1
WenqingLan1 requested a review from a team as a code owner November 4, 2026 22:25
Copilot AI balanced review requested due to automatic review settings November 4, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new default allocates 24 GiB across three arrays, breaking existing invocations on 16 GiB GPUs; both Python and native defaults need a capacity-safe fallback.

1 open issue
What changed in this PR

This PR adds explicit GPU-specific presets and a fixed autotuning sweep to the GPU STREAM benchmark, reporting one winning measurement per operation and datatype.

Changes:

  • Add packaged launch profiles for h100, gb300, and vr, with validated parameter handling.
  • Implement block/unroll sweeps, scalar-tail handling, and canonical bandwidth results.
  • Update tests, documentation, and the example for preset selection and autotuning.
File Description
tests/​benchmarks/​micro_benchmarks/​test_gpu_stream.py Tests presets, fallback commands, validation, and result parsing.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream.hpp Updates the kernel timing interface.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream.cu Runs configured sweeps and reports winning measurements.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream_utils.hpp Defines launch configurations and updated defaults.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream_utils.cpp Validates native arguments and adds launch selectors.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream_kernels.hpp Implements tiled kernels, unrolling, and scalar tails.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream/​gpu_stream_kernels.cu Shortens the template compilation-unit explanation.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream.py Selects presets, generates commands, and parses canonical results.
superbench/​benchmarks/​micro_benchmarks/​gpu_stream_profiles.json Provides chip-specific buffer and launch settings.
MANIFEST.in Includes the profile JSON in distribution files.
examples/​benchmarks/​gpu_stream.py Demonstrates both datatypes and describes preset selection.
docs/​user-tutorial/​benchmarks/​micro-benchmarks.md Documents presets, fallback behavior, and revised metrics.

Review effort: Balanced

_OPERATIONS = ['copy', 'scale', 'add', 'triad']
_BLOCKS = [128, 256, 512, 1024]
_UNROLLS = [1, 2, 3, 4, 6, 8]
_DEFAULT_SIZE = 8 * 1024**3
Copilot AI balanced review requested due to automatic review settings November 5, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new 8 GiB per-array default requires 24 GiB across three allocations, breaking default runs on 16 GiB GPUs and leaving no CUDA-context headroom on 24 GiB GPUs.

2 open issues

Review effort: Balanced

Comment on lines +36 to +37
self._parser.add_argument('--kernel_configs', type=str, default=None,
help='JSON mapping of workload tags to block_size/unroll. Omit to autotune.')
Copilot AI balanced review requested due to automatic review settings November 5, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The rewritten CUDA kernels and launch dispatch need GPU validation across datatypes, non-tile-aligned sizes, and sweep configurations because mocked tests cannot establish native correctness or bandwidth accuracy.

2 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 9, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The CUDA kernel, indexing, and autotuning rewrites require GPU-backed correctness and bandwidth validation, while the updated tests cover only mocked execution and synthetic results.

2 open issues

Review effort: Balanced

@gusui-msft

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants