Skip to content

Instantly share code, notes, and snippets.

@mikasenghaas
Created April 25, 2025 23:42
Show Gist options
  • Select an option

  • Save mikasenghaas/d63ded03f1f0417b1677627119bacc0d to your computer and use it in GitHub Desktop.

Select an option

Save mikasenghaas/d63ded03f1f0417b1677627119bacc0d to your computer and use it in GitHub Desktop.
Accelerator Intensity (4090, A100, H100)
# /// script
# requires-python = ">=3.10"
# dependencies = ["numpy", "torch"]
# ///
import torch; torch.manual_seed(42)
# 4090
flops_4090 = 165e12 # dense bf16 tensor cores
bandwidth_4090 = 1.008e12
# A100
flops_a100 = 312e12
bandwidth_a100 = 1.555e12
# H100
flops_h100 = 989e12
bandwidth_h100 = 3.35e12
print(f"4090: {int(flops_4090 / bandwidth_4090)}")
print(f"A100: {int(flops_a100 / bandwidth_a100)}")
print(f"H100: {int(flops_h100 / bandwidth_h100)}")
@mikasenghaas
Copy link
Author

Run with

wget https://gist.githubusercontent.com/mikasenghaas/d63ded03f1f0417b1677627119bacc0d/raw/32e5cd681be0af38ac0fbb4b1eab384226cbfce9/accelerator-intensity.py && uv run accelerator-intensity.py

To get the following output

4090: 163
A100: 200
H100: 295

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