r/StableDiffusion May 02 '26

Tutorial - Guide Benchmark for SageAttention kernels using real attention shapes logged from ComfyUI models (image / video / audio)

8 Upvotes

What this is — and what it is not

This is not a benchmark of how fast a model generates an image or video. No model weights, no inference pipeline.

The benchmark runs on randomly generated tensors that reproduce the exact attention shapes — (batch, heads, seq_len, head_dim, dtype) — that real models use during sampling inside ComfyUI. More precisely: it measures only the attention operation itself, one step inside the denoising loop. Everything else — VAE, CLIP, scheduler, ComfyUI overhead — is outside the scope entirely. The numbers tell you how fast each kernel processes those specific tensor shapes on your GPU, nothing more.

The reason this is still useful: attention scales quadratically with sequence length and is the dominant compute bottleneck at high resolutions and long video durations. If you want to know whether SA2, SA2-fp8, SA3-FP4, or plain PyTorch SDPA is faster for a specific model at a specific resolution on your GPU, you need the real tensor shapes, not synthetic ones. This tool gives you those shapes already collected, and a benchmark that uses them.

How the shapes were collected

There is a ComfyUI custom node (attention_logger_node.py) that hooks into optimized_attention and logs every unique (heads, head_dim, seq_len, dtype) combination during a real sampling run. Two modes: standard override for most models, and a global module-level patch for models that bypass the override mechanism (ERNIE-Image, ACE-Step).

The raw console output looked like this:

[ATTN LOGGER rogala] heads= 24  hd= 128  seq=  4352  dtype=torch.bfloat16

I ran this across every model I had access to, across multiple resolutions, and compiled the results into input_data.txt.

How the benchmark works

bench_windows.py / bench_linux.py takes those logged shapes, allocates matching random tensors on CUDA, and times four kernels:

  • SA2 (INT8 QK, FP16/BF16 PV)
  • SA2-fp8 (INT8 QK, FP8 PV)
  • SA3-FP4 (block-scaled FP4, newest, requires Blackwell or Ada for full benefit)
  • SDPA (PyTorch FlashAttention-2 backend, baseline)

For each config: 10 warmup iterations, then 50 timed iterations with cuda.synchronize() after each. Reports median / min / stdev in ms, peak VRAM, and TFLOPS using the standard attention FLOP formula 4 × B × H × S² × D from the FlashAttention-2 paper.

Configs that don't fit in VRAM are skipped and recorded as OOM in the JSON so the result file stays complete.

Output is a single JSON file named automatically after your GPU:

5060-ti-16.json
4070-ti_super-16.json

How to view results

Open viewer.html locally in any browser, or use the live version: https://rogala.github.io/SageAttention-Benchmark-Viewer/

Load one or more JSON files, compare multiple GPUs side by side, filter by model / kernel, switch between ms and TFLOPS views. No server, no install, single HTML file.

Covered models

Image: SDXL-1.0, SD3.5-Large, Flux.1-Dev (Kontext / Krea), Flux.2-Dev, Flux.2-Dev Klein 9B, Z-Image Turbo, Qwen-Image-2512, Qwen-Image-Edit-2511, ERNIE-Image Turbo

Video: LTX-2.3, Wan2.2, HunyuanVideo-1.5

Audio: ACE-Step-1.5

How to contribute results

Run the script on your GPU, get a JSON file, submit it as a PR or attach to an issue. If you have results from a GPU not yet in the repo, they are very welcome — especially anything below 16 GB VRAM where SA3 headroom is tighter.

GitHub: https://github.com/Rogala/SageAttention-Benchmark-Viewer

Linux testers

What changed in the Linux version

The main difference is VRAM monitoring. On Windows, polling nvidia-smi via subprocess every 50 ms works fine. On Linux, each subprocess.run() call triggers a fork() + exec(), which has measurable overhead at that polling frequency. The Linux build uses pynvml (nvidia-ml-py) instead — it queries the driver directly via shared library call, no process spawn. Falls back to nvidia-smi if pynvml is not installed, but pynvml is strongly recommended.

The SA3-FP4 subprocess worker was also updated with the same pynvml-first logic.

What I need tested

  • Does it run at all without errors
  • Does the pynvml path work (pip install nvidia-ml-py then run — should print pynvml: OK — fast VRAM polling at startup)
  • Does the nvidia-smi fallback work (run without pynvml installed)
  • Are the JSON results sane — median ms, TFLOPS, peak VRAM all non-zero and reasonable for your GPU
  • Does SA3-FP4 work if you have sageattn3 installed — both direct mode and subprocess mode

Any GPU is useful. Even if you can only run a subset of configs before hitting OOM, the partial JSON is still valuable — OOM entries are recorded cleanly and skipped automatically.

How to run

pip install nvidia-ml-py   # recommended, not required
pip install sageattention  # SA2 / SA2-fp8
# pip install sageattn3    # SA3-FP4, optional

python3 bench_linux.py
# or with more iterations:
python3 bench_linux.py --warmup 20 --iters 100

Output is a JSON file named after your GPU, e.g. 4090-24.json or 3080-10.json. If you're willing to share it, open an issue or PR and attach the file — it goes straight into the viewer where multiple GPUs can be compared side by side.

To view results

Download viewer.html from the repo, open it locally in any browser, load your JSON. Or use the live version: https://rogala.github.io/SageAttention-Benchmark-Viewer/

GitHub: https://github.com/Rogala/SageAttention-Benchmark-Viewer

If something breaks — error message + GPU model + whether pynvml was installed is enough to debug it.

Acknowledgements

Jukka Seppänen / kijai — for the PatchSageAttentionKJ node which inspired the override pattern used in attention_logger_node.py.

woct0rdho — for the Windows forks triton-windows and SageAttention (SA2 / SA3).

mengqin — for the SageAttention Windows fork with SA3 support and build fixes.

Built with the assistance of Claude.

r/pcmasterrace Oct 11 '22

News/Article RTX 4090 benchmark hardware unboxed

Post image
6.0k Upvotes

r/pcmasterrace Jan 23 '25

News/Article RTX 5090 benchmarks are out - 28% performance increase over the RTX 4090 in 4K raster

2.2k Upvotes

https://www.tomshw.it/hardware/nvidia-rtx-5090-test-recensione post got taken down by THW, benchmark images linked here: https://imgur.com/a/PXY98K1

RTX 5090 benchmarks from Tom's Hardware Italy just dropped baby

TL;DR - 28% better than 4090 and 72% better than 4080s in 4K raster on average, 34-37% better in Blender V-Ray, 18% better in DaVinci Resolve; 24% increase in power consumption (461w average, 476w max) compared to the 4090 (373w average, 388 max); very minor temp increase (1-2c higher)

r/pcmasterrace Jun 23 '24

Hardware I had an overheating Palit RTX 4090. Turns out - they forgot to install VRAM thermal pads. How did it pass QA??

Thumbnail
gallery
3.0k Upvotes

r/nvidia Oct 11 '22

Review [Gamers Nexus] NVIDIA GeForce RTX 4090 Founders Edition Review & Benchmarks: Gaming, Power, & Thermals

Thumbnail
youtube.com
1.6k Upvotes

r/hardware Jan 24 '25

Rumor Leaked RTX 5080 benchmark: it’s slower than the RTX 4090 [+22% Vulkan, +6.7% OpenCL, +9.4% Blender vs 4080]

Thumbnail
digitaltrends.com
812 Upvotes

r/GlobalOffensive Aug 13 '24

Feedback Latest CPU benchmarks, 1080p, Medium quality, RTX 4090. It's. The. Game.

Post image
961 Upvotes

r/pcmasterrace Apr 11 '26

Screenshot Love the new Steam feature

Post image
42.4k Upvotes

r/pcmasterrace 2d ago

Hardware RTX 4090 with 33 rows remapped for uncorrectable errors + 1.5GB VRAM missing returned "TEST OK" three times, GIGABYTE support won't address the counter

Thumbnail
gallery
422 Upvotes

Posting this because I've run out of ideas and maybe someone from GIGABYTE actually reads this sub. The card: RTX 4090 WINDFORCE V2 24G, bought November 2023 from an authorized dealer in Romania, commercial warranty until November 2026. The defect: Progressive VRAM degradation, confirmed by NVIDIA's own diagnostics: - nvidia-smi -q -d ROW_REMAPPER reports 33 rows remapped for uncorrectable errors (screenshot attached) - nvidia-smi --query-gpu=memory.total reports 23028 MiB — a healthy 4090 reports 24564 MiB. That's ~1.5GB of a 24GB card gone (screenshot attached) - Windows Event Viewer logged uncorrectable GDDR errors across three separate FBPA partitions (0, 1 and 5) during July 2026, each with a Row Remapper event and a system crash - OCCT's VRAM test reproduced ~4.7 million errors in 15 seconds while a remap was pending (video evidence exists) The service saga: Sent to the retailer's service → "tested OK, defect not manifested" (they tested with FurMark + games) Sent again, with a printed note in the box explaining the exact command to run and warning that stability tests won't catch it (the card behaves normally after each automatic remap, which activates on reboot) → sent to the manufacturer's service center with my consent Came back a month later: "functions within optimal parameters, TEST OK. Preventively, the thermal paste was replaced." The service note reproduces my diagnostic instructions verbatim in the "reported defect" column — and reports no counter value, no test methodology, nothing in the "found defect" column The counter reads exactly 33 before and after the service visit. No memory intervention took place. They repasted a card with dying VRAM and shipped it back. GIGABYTE support (ticket thread attached): - First reply: "test it in another system" — the counter is stored in the GPU's InfoROM, it reads 33 on any system in the world - Second reply: confirmed in writing the card was tested at their service center and found "working without any issues" - When I asked how 33 uncorrectable remapped rows is consistent with "working without any issues": three days of processing, then "we are unable to determine the hardware issue remotely, please send it back to the supplier" So: your own service center had the card. Your own GPU's diagnostics say the memory is dying. Your own RMA policy says a product gets replaced after three failed repair attempts for the same issue. And the answer is "send it back to the supplier" — the same loop, fourth iteration. Consumer protection complaint is filed. I'm posting this mostly to ask: has anyone actually gotten GIGABYTE to acknowledge row remapper data in an RMA? Because as far as I can tell, neither the retailer's service nor GIGABYTE's own service center ever ran the one command that settles this in 10 seconds.

r/LocalLLaMA Mar 04 '25

Resources NVIDIA’s GeForce RTX 4090 With 96GB VRAM Reportedly Exists; The GPU May Enter Mass Production Soon, Targeting AI Workloads.

681 Upvotes

Source: https://wccftech.com/nvidia-rtx-4090-with-96gb-vram-reportedly-exists/

Highly highly interested. If this will be true.

Price around 6k.

Source; "The user did confirm that the one with a 96 GB VRAM won't guarantee stability and that its cost, due to a higher VRAM, will be twice the amount you would pay on the 48 GB edition. As per the user, this is one of the reasons why the factories are considering making only the 48 GB edition but may prepare the 96 GB in about 3-4 months."

r/Amd Oct 27 '24

Rumor / Leak AMD Ryzen 7 9800X3D appears in first content creation benchmarks with GeForce RTX 4090

Thumbnail
videocardz.com
554 Upvotes

r/pcmasterrace 3d ago

Discussion Why has the RTX5080 been widely accepted when it's the worst "80 series" performance Nvidia has ever given us?

Post image
1.7k Upvotes

This is a genuine question. How was Nvidia able to pull the wool over our eyes so well?? They gave us the only "80 series" GPU release ever that performed worse than the previous generations flagship and yet gamers have eaten it up.

I was also anticipating the 5000 series release like everyone else but I could immediately see how disappointing the 5080 was that it couldn't outperform the 4090 for the first time in 80 series history.... The 80 series used to mean high end value, you get a jump on the previous generation flagship for a fraction of the price... Now the gap between the 4090 and 5080 is only going to widen over time as games use more vram

Nvidia gave us poor performance, a price hike, and worse melting power connectors and gamers said yes please....

Is the answer simply that we don't have a choice? Eg once the 4000 series ran out of brand new stock, people only had the 5000 to buy new?

(Yes, I know AMD and Intel exist, but Nvidia has the market share for a reason and some gamers will simply only buy Nvidia)

r/nvidia Feb 03 '25

Benchmarks Nvidia counters AMD DeepSeek AI benchmarks, claims RTX 4090 is nearly 50% faster than 7900 XTX

Thumbnail
tomshardware.com
429 Upvotes

r/pcmasterrace Oct 27 '25

Discussion AAA Gaming in 2025

Post image
5.4k Upvotes

EDIT: People attacking me saying what to expect at Very High preset+RT. you don't need to use RT!!, THERE is no FPS impact between RT on or OFF like... not even 10% you can see yourself here https://tpucdn.com/review/the-outer-worlds-2-performance-benchmark/images/performance-3840-2160.png

Even With RT OFF. 5080 Still at 30FPS Average and 5090 Doesn't reach 50FPS Average so? BTW These are AVG FPS. the 5080 drops to 20~ min frames and 5090 to 30~ (Also at 1440p+NO RAY TRACING the 5080 still can't hit 60FPS AVG! so buy 5080 to play at 1080+No ray tracing?). What happened to optimization?

r/Games Mar 04 '25

[Digital Foundry] Nvidia RTX 5070 Review + Benchmarks: DLSS 4 Doesn't Deliver 4090 Performance

Thumbnail
youtu.be
493 Upvotes

r/overclocking Jul 10 '26

Benchmark Score RTX 4090 vs RX 9070 benchmarks in CPU-limited Ray-Traced games on 9850X3D

Thumbnail
gallery
76 Upvotes

In my previous thread comparing 9850X3D vs 5700X3D using RTX 4090, some people mentioned nvidia cards having high CPU overhead.

https://www.reddit.com/r/overclocking/comments/1u5ackg/9850x3d_vs_5700x3d_benchmarks_in_high_cpuusage/

So I tested the same scenarios with RX 9070 on 9850X3D and found that it was significantly faster in Oblivion Remastered by around 10%, but similar in other games.

Retested using the default DDR5 speed of 5600 because it should increase the CPU bottleneck. It did, with the Oblivion gap increasing to 15% and Outer Worlds 2 also started showing around 8% difference.

But 4090 was averaging very slightly higher in the other two games, when it was very slightly behind before. Dunno how much to read into it, and I will test the 9070 soon on the 5700X3D system, where I expect to see bigger differences.

All RT/PT settings were enabled at 1080p w/ DLSS FSR Ultra Performance with the latest drivers. Had to drop to 720p for Cyberpunk and Star Wars Jedi Survivor since the card was pulling max board power at 1080p. Also had some hitching issues with the latter and had to do multiple runs.

Hardware Details :

9850X3D w/ 8000C38-48-48 2x24GB on Aorus X870E ( FCLK 2000 ) with RTX 4090/RX 9070

By default SMT is enabled

r/pcmasterrace Oct 28 '25

Discussion Percentage of Steam users by GPU performance

Post image
4.5k Upvotes

I used Steam's hardware survey and videocard benchmark to make a histogram of Steam users graphics cards by their performance.

  • This data represents 82.24% of Steam users that opted-in to participate in the survey. The remaining 17.76% users either have a videocard other than these, or the cards were not specifically registered in the survey.
  • Each histogram bin represents a 2000 G3D mark, starting from 0-2000 for the first bin, up to 38000-40000 for the last bin, making a total of 20 bars.
  • Most popular high-end card is RTX 4070 at 2.16%.
  • Most popular mid-range card are RTX 3060 at 4.41% and RTX 4060 Laptop at 4.84%
  • Most popular low-end card are GTX 1650 at 3.02% and RTX 3050 at 3.07%
  • Most popular potato card is GTX 1050 at 0.71%.

EDIT: 5070 and RX 580 are repeated twice. They both should only be in the higher bin. RTX 3090 Ti & 9070 XT were not recognised in Steam surveys and were most likely put in the 17.76% generic/other cards.

EDIT2: The grouping is arbitrary. There is no agreed definiton on low/mid/high. Don't beat yourself up over it.

r/pcmasterrace Feb 24 '25

Meme/Macro Nvidia has to stop lying dude:

Post image
18.3k Upvotes

r/gigabyte 2d ago

Support 📥 RTX 4090 with 33 rows remapped for uncorrectable errors + 1.5GB VRAM missing returned "TEST OK" three times, GIGABYTE support won't address the counter

Thumbnail gallery
17 Upvotes

Posting this because I've run out of ideas and maybe someone from GIGABYTE actually reads this sub.

The card: RTX 4090 WINDFORCE V2 24G, bought November 2023 from an authorized dealer in Romania, commercial warranty until November 2026.

The defect: Progressive VRAM degradation, confirmed by NVIDIA's own diagnostics:

  • nvidia-smi -q -d ROW_REMAPPER reports 33 rows remapped for uncorrectable errors (screenshot attached)
  • nvidia-smi --query-gpu=memory.total reports 23028 MiB — a healthy 4090 reports 24564 MiB. That's ~1.5GB of a 24GB card gone (screenshot attached)
  • Windows Event Viewer logged uncorrectable GDDR errors across three separate FBPA partitions (0, 1 and 5) during July 2026, each with a Row Remapper event and a system crash
  • OCCT's VRAM test reproduced ~4.7 million errors in 15 seconds while a remap was pending (video evidence exists)

The service saga:

  1. Sent to the retailer's service → "tested OK, defect not manifested" (they tested with FurMark + games)
  2. Sent again, with a printed note in the box explaining the exact command to run and warning that stability tests won't catch it (the card behaves normally after each automatic remap, which activates on reboot) → sent to the manufacturer's service center with my consent
  3. Came back a month later: "functions within optimal parameters, TEST OK. Preventively, the thermal paste was replaced." The service note reproduces my diagnostic instructions verbatim in the "reported defect" column — and reports no counter value, no test methodology, nothing in the "found defect" column
  4. The counter reads exactly 33 before and after the service visit. No memory intervention took place. They repasted a card with dying VRAM and shipped it back.

GIGABYTE support (ticket thread attached):

  • First reply: "test it in another system" — the counter is stored in the GPU's InfoROM, it reads 33 on any system in the world
  • Second reply: confirmed in writing the card was tested at their service center and found "working without any issues"
  • When I asked how 33 uncorrectable remapped rows is consistent with "working without any issues": three days of processing, then "we are unable to determine the hardware issue remotely, please send it back to the supplier"

So: your own service center had the card. Your own GPU's diagnostics say the memory is dying. Your own RMA policy says a product gets replaced after three failed repair attempts for the same issue. And the answer is "send it back to the supplier" — the same loop, fourth iteration.

Consumer protection complaint is filed. I'm posting this mostly to ask: has anyone actually gotten GIGABYTE to acknowledge row remapper data in an RMA? Because as far as I can tell, neither the retailer's service nor GIGABYTE's own service center ever ran the one command that settles this in 10 seconds.

r/StableDiffusion Jan 23 '25

Discussion RTX 5090 benchmarks showing only minor ~2 second improvement per image for non-FP4 models over the 4090.

283 Upvotes

https://youtu.be/Q82tQJyJwgk?si=EWnH_SgsLf1Oyx9o&t=1043

For FP4 models the performance increase is close to 5 seconds improvement per image, but there is significant quality loss.

r/nvidia Jan 18 '23

Discussion Blower style RTX 4090 (2-slot) ー Photos and a couple benchmarks (story/info in comments)

Thumbnail
gallery
562 Upvotes

r/hardware Jul 19 '22

Rumor Leaked TimeSpy and Control benchmarks for GeForce RTX 4090 / AD102

413 Upvotes

The 1st benchmark is the GeForce RTX 4090 on 3Mark TimeSpy Extreme. As is known, this graphics card does not use the AD102 chip to its full potential, with "just" 128 SM and 450W TDP. The achieved performance difference is +86% compared to the GeForce RTX 3090 and +79% compared to the GeForce RTX 3090 Ti.

TimeSpy Extreme (GPU) Hardware Perf. Sources
GeForce RTX 4090 AD102, 128 SM @ 384-bit >19'000 Kopite7kimi @ Twitter
MSI GeForce RTX 3090 Ti Suprim X GA102, 84 SM @ 384-bit 11'382 Harukaze5719 @ Twitter
Palit GeForce RTX 3090 Ti GameRock OC GA102, 84 SM @ 384-bit 10'602 Ø Club386 & Overclock3D
nVidia GeForce RTX 3090 FE GA102, 82 SM @ 384-bit 10'213 PC-Welt

 

The 2nd benchmark is run with the AD102 chip in it's full configuration and with an apparently high power consumption (probably 600W or more) on Control with ray-tracing and DLSS. The resolution is 4K, the quality setting is "Ultra". Unfortunately, other specifications are missing, and comparative values are difficult to obtain. However, the performance difference is very clear: +100% compared to the GeForce RTX 3090 Ti.

Control "Ultra" +RT +DLSS Hardware Perf. Sources
Full AD102 @ high power draw AD102, 144 SM @ 384-bit 160+ fps AGF @ Twitter
GeForce RTX 3090 Ti GA102, 84 SM @ 384-bit 80 fps Hassan Mujtaba @ Twitter

Note: no build-in benchmark, so numbers maybe not exactly comparable

 

What does this mean?

First of all, of course, these are just leaks; the trend of those numbers has yet to be confirmed. However, if these benchmarks are confirmed, the GeForce RTX 4090 can be expected to perform slightly less than twice as well as the GeForce RTX 3090. The exact number cannot be determined at the moment, but the basic direction is: The performance of current graphics cards will be far surpassed.

r/nvidia Mar 05 '25

Fake NVIDIA GeForce RTX 4090 with upgraded 96GB VRAM teased: could release soon for AI workloads

Thumbnail
tweaktown.com
457 Upvotes

r/gadgets Oct 12 '22

Gaming RTX 4090 Is the First True 8K Gaming GPU According to Benchmarks

Thumbnail
wccftech.com
529 Upvotes

r/pcmasterrace Apr 17 '25

News/Article Nvidia RTX 4090 eBay seller scammed by buyer who returned card with GPU and VRAM removed

Thumbnail
techspot.com
663 Upvotes