From 923cf9559459dc212d943173c9ab53599cbaeaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=87=AF=E4=BC=9F?= <21376218@buaa.edu.cn> Date: Thu, 10 Sep 2026 12:01:32 +0800 Subject: [PATCH] target: add NVIDIA H20 support --- schedule/ir.py | 25 +++++++++++++++++++++++++ tests/test_h20_target.py | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 tests/test_h20_target.py diff --git a/schedule/ir.py b/schedule/ir.py index b63b31e..ed9a522 100644 --- a/schedule/ir.py +++ b/schedule/ir.py @@ -489,6 +489,31 @@ def measured_bandwidth_bound_us(self, weight_bytes: int) -> float: max_regs_per_thread=255, l2_bytes=50 * 1024 * 1024, hbm_bytes=192 * 1024**3, hbm_bandwidth_gbs=8000.0, fp16_tflops=2250.0, clock_ghz=1.86, supports_cooperative=True, wddm_tdr=False, note="Datacenter Blackwell, HBM3e. Spec only."), + "h20": GpuTarget( + name="h20", + sm_arch=90, + num_sms=78, + smem_bytes_per_sm=233472, + smem_bytes_per_block_optin=232448, + regs_per_sm=65536, + max_threads_per_sm=2048, + max_regs_per_thread=255, + l2_bytes=60 * 1024 * 1024, + hbm_bytes=96 * 1024**3, + hbm_bandwidth_gbs=4000.0, + fp16_tflops=148.0, + clock_ghz=0.0, + supports_cooperative=True, + wddm_tdr=False, + measured_bw_gbs=3712.3, + note=( + "NVIDIA H20, Hopper sm_90, 96GB HBM3. " + "78 SMs, 60 MiB L2, and SMEM limits observed on real H20 silicon. " + "Spec HBM bandwidth/FP16 throughput are retained as target parameters; " + "measured_bw_gbs=3712.3 from eval/peak_bandwidth.py " + "(median of three independent peak_gbs runs)." + ), + ), "h100": GpuTarget( name="h100", sm_arch=90, num_sms=132, smem_bytes_per_sm=233472, smem_bytes_per_block_optin=232448, regs_per_sm=65536, max_threads_per_sm=2048, diff --git a/tests/test_h20_target.py b/tests/test_h20_target.py new file mode 100755 index 0000000..070e60e --- /dev/null +++ b/tests/test_h20_target.py @@ -0,0 +1,25 @@ +from schedule.ir import TARGETS + + +def test_h20_target_profile(): + target = TARGETS["h20"] + + assert target.name == "h20" + assert target.sm_arch == 90 + assert target.num_sms == 78 + + assert target.smem_bytes_per_sm == 233472 + assert target.smem_bytes_per_block_optin == 232448 + + assert target.regs_per_sm == 65536 + assert target.max_threads_per_sm == 2048 + assert target.max_regs_per_thread == 255 + + assert target.l2_bytes == 60 * 1024 * 1024 + assert target.hbm_bytes == 96 * 1024**3 + + assert target.hbm_bandwidth_gbs == 4000.0 + assert target.measured_bw_gbs == 3712.3 + + assert target.supports_cooperative is True + assert target.wddm_tdr is False