From 63c299c5d61c342af3511bb96381c812e5e3edc3 Mon Sep 17 00:00:00 2001 From: gasoonjia Date: Fri, 10 Oct 2025 00:13:53 -0700 Subject: [PATCH] set emulate_precision_casts as true for cuda backend for better accuracy as title Differential Revision: [D84288174](https://our.internmc.facebook.com/intern/diff/D84288174/) [ghstack-poisoned] --- backends/cuda/cuda_backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/cuda/cuda_backend.py b/backends/cuda/cuda_backend.py index 8ed8cdefbb1..ef98de29f23 100644 --- a/backends/cuda/cuda_backend.py +++ b/backends/cuda/cuda_backend.py @@ -129,6 +129,8 @@ def preprocess( user_input_placeholders.append(node.meta["val"]) options: dict[str, typing.Any] = { + # Better model precision + "emulate_precision_casts": True, # Embed CUDA kernel binaries directly into the compiled shared object "aot_inductor.embed_kernel_binary": True, # Do not link against the full PyTorch/libtorch library