From ebc3288fdba7bc90bc808bfda382778db64a0a9f Mon Sep 17 00:00:00 2001 From: Peichen Xie Date: Wed, 14 Oct 2026 11:18:31 +0800 Subject: [PATCH] update e_zero and readme --- README.md | 13 +++++++++---- src/mmasim/mmasim/nv_ptx/sim.py | 2 ++ src/mmasim/pyproject.toml | 2 +- src/mmasim_kernels/pyproject.toml | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f5c35f..063d72b 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ Example: ```python import torch -from mmasim.nv_ptx.sim import MMA # for "mma.sync" instructions -from mmasim.amd.sim import MFMA # for "v_mfma" instructions +from mmasim.nv_ptx import MMA # for "mma.sync" instructions +from mmasim.amd import MFMA # for "v_mfma" instructions # mma.sync.aligned.m16n8k16.row.col.f32.f16.f16.f32 (PTX) # or HMMA.16816.F32 (SASS) @@ -66,7 +66,7 @@ Example: ```python import torch -from mmasim.nv_ptx.sim import MMA +from mmasim.nv_ptx import MMA from mmasim_kernels.nv_ptx.rtx_blackwell import mma_kernels mma_sim = MMA("RTX Blackwell", "m16n8k16.f32.f16.f16.f32") @@ -86,7 +86,12 @@ Additionally, you can run test scripts in [tests/equivalence](tests/equivalence) ## Citation ``` -Coming soon +@inproceedings{xie_bit-accurate_2026, + title = {Bit-{Accurate} {Modeling} of {GPU} {Matrix} {Multiply}-{Accumulate} {Units}: {Demystifying} {Numerical} {Discrepancy} and {Accuracy}}, + booktitle = {Annual {IEEE}/{ACM} {International} {Symposium} on {Microarchitecture} ({MICRO})}, + author = {Xie, Peichen and Xu, Shuotao and Wang, Yang and Yang, Fan and Yang, Mao}, + year = {2026}, +} ``` ## Contributing diff --git a/src/mmasim/mmasim/nv_ptx/sim.py b/src/mmasim/mmasim/nv_ptx/sim.py index 180fe0c..1902e49 100644 --- a/src/mmasim/mmasim/nv_ptx/sim.py +++ b/src/mmasim/mmasim/nv_ptx/sim.py @@ -42,6 +42,8 @@ def __init__(self, arch: str, shape_and_type: str): e_zero = -20 if self.c_type == torch.float16 else -131 elif self.arch in ["Turing", "Ampere", "Ada Lovelace"]: e_zero = -21 if self.c_type == torch.float16 else -132 + elif self.arch == "Hopper": + e_zero = -21 if self.c_type == torch.float16 else -133 else: # Blackwell, RTX Blackwell e_zero = -22 if self.c_type == torch.float16 else -133 self.arithmetic_op = fdpa.MMA_T_FDPA(F, rho, L_max, e_zero) diff --git a/src/mmasim/pyproject.toml b/src/mmasim/pyproject.toml index b0d187d..45ee3e7 100644 --- a/src/mmasim/pyproject.toml +++ b/src/mmasim/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mmasim" -version = "2.0.2" +version = "2.0.3" authors = [{ name="Peichen Xie", email="peichenxie@microsoft.com" }] requires-python = ">=3.10" dependencies = ["torch>=2.9", "ninja"] diff --git a/src/mmasim_kernels/pyproject.toml b/src/mmasim_kernels/pyproject.toml index dfbc12c..f6820a6 100644 --- a/src/mmasim_kernels/pyproject.toml +++ b/src/mmasim_kernels/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "mmasim-kernels" -version = "2.0.2" +version = "2.0.3" authors = [{ name="Peichen Xie", email="peichenxie@microsoft.com" }] requires-python = ">=3.10" -dependencies = ["mmasim>=2.0.2"] +dependencies = ["mmasim>=2.0.3"] [tool.setuptools.packages.find] where = ["."]