Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ Contributor credits for these OSS CuTe DSL kernels are listed in [Acknowledgemen

#### Llama 3.1 style Forward and Bprop with causal masking (GB300)
<p align="center">
<img src="https://github.com/NVIDIA/cudnn-frontend/blob/main/benchmark/sdpa_benchmark_training/results/llama3.1/gb300/llama3.1_top_left.png" alt="Llama 3.1 SDPA Benchmark on GB300 (only cuDNN)" width="600"/>
<img src="https://github.com/NVIDIA/cudnn-frontend/blob/main/benchmark/attention_training/results/llama3.1/gb300/llama3.1_top_left.png" alt="Llama 3.1 SDPA Benchmark on GB300 (only cuDNN)" width="600"/>
</p>

#### Deepseek v3 style Forward and Bprop with causal masking (GB300)

<p align="center">
<img src="https://github.com/NVIDIA/cudnn-frontend/blob/main/benchmark/sdpa_benchmark_training/results/dsv3/gb300/dsv3_top_left.png" alt="DSv3 SDPA Benchmark on GB300 (only cuDNN)" width="600"/>
<img src="https://github.com/NVIDIA/cudnn-frontend/blob/main/benchmark/attention_training/results/dsv3/gb300/dsv3_top_left.png" alt="DSv3 SDPA Benchmark on GB300 (only cuDNN)" width="600"/>
</p>

## Key Features
Expand Down
4 changes: 2 additions & 2 deletions benchmark/attention_inference/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Attention Inference Benchmark

Benchmarks attention for **inference**, split into two phases (mirroring
forward/backward in `../sdpa_benchmark_training`):
forward/backward in `../attention_training`):

- **context** — prefill, in two kinds, both reported in **TFLOPS**:
- *full*: `s_q == s_kv`, contiguous Q/K/V, compute-bound;
Expand Down Expand Up @@ -52,7 +52,7 @@ into the fp8 graph — those cases record as unsupported).
MLA models run **absorbed** in generation (`kind="mla_absorbed"`: K reads the
full record, V a leading slice of the *same* record, so KV bytes are counted
once) and **unabsorbed** in prefill — which is dense training-style attention
and lives in `../sdpa_benchmark_training`.
and lives in `../attention_training`.

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
is bidirectional: context_causal=False). Full prefill covers the self-
attention over the whole clip, and generation sweeps the standard MTP widths
against the cached clip for completeness. The training suite carries its own
forward-only sweep of the same model (`sdpa_benchmark_training`).
forward-only sweep of the same model (`attention_training`).
"""

from ..config_types import InferenceBenchmarkConfig, ModelPreset
Expand Down
55 changes: 55 additions & 0 deletions benchmark/attention_inference/configs/qwen3vl_vit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""
Qwen3-VL Vision Encoder (ViT) self-attention — inference.

The vision tower's self-attention is bidirectional over the patchified image
tokens and runs forward-only: pure context-phase (full prefill) work, so this
config sweeps ONLY the context phase — an encoder has no KV cache to decode
against, so there is no generation phase and no kv-cache dtype axis.

Architecture (vision tower): 16 MHA heads, head_dim 72 zero-padded to 80
(fp8 kernels require 16-byte-aligned head dims; production integrations run
the padded contract, and reported TFLOPS count d=80). Sequence lengths are
per-image patch-grid token counts from a production inference trace
(94x94 .. 250x250 grids), spanning that trace's per-forward FLOPs
distribution from the 10th to the 99th percentile. The tower is not
head-shardable in deployments (whole-model per device), so no TP sweep.

Usage:
python -m benchmark.attention_inference.runner --config qwen3vl_vit
"""

from ..config_types import InferenceBenchmarkConfig, ModelPreset

QWEN3VL_VIT = ModelPreset(
name="qwen3vl_vit",
num_q_heads=16,
num_kv_heads=16,
head_dim=80,
)

CONFIG = InferenceBenchmarkConfig(
name="qwen3vl_vit",
models=[QWEN3VL_VIT],
context_seqlens=[
8836, # 94x94 patch grid
15376, # 124x124 (most frequent single-image forward)
24336, # 156x156
35344, # 188x188 (FLOPs-median forward)
47376, # non-square grid (e.g. 168x282)
62500, # 250x250
],
context_chunked_shapes=[], # encoder: no chunked prefill against a cache
generation_shapes=[], # encoder: no decode phase
context_causal=False, # bidirectional ViT self-attention
# bf16 only: this suite expresses fp8 solely as the generation-phase
# kv-cache axis (the fp8 attention graph), and an encoder has no
# generation phase — the context path has no fp8 route today. The training
# suite's fp8 forward numbers for this model are dropped by the move;
# restoring them here needs fp8-context support in
# benchmark_single_attention first.
data_types=["bfloat16"],
backends=["cudnn", "cudnn_oss"],
)
Loading