From e9f205283f1f60ef57b152f5e355df70ed71084f Mon Sep 17 00:00:00 2001 From: Songhao Jia Date: Thu, 9 Oct 2025 20:39:40 -0700 Subject: [PATCH] set emulate_precision_casts as true for cuda backend for better accuracy (#14961) Summary: as title Reviewed By: larryliu0820, yushangdi Differential Revision: D84288174 --- 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