Skip to content

Commit 21557d0

Browse files
set emulate_precision_casts as true for cuda backend for better accuracy (#15005)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #14983 by @Gasoonjia ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/gasoonjia/53/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/gasoonjia/53/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/gasoonjia/53/orig Differential Revision: [D84288174](https://our.internmc.facebook.com/intern/diff/D84288174/) @diff-train-skip-merge Co-authored-by: gasoonjia <[email protected]> Co-authored-by: Gasoonjia <[email protected]>
1 parent 9b03c13 commit 21557d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backends/cuda/cuda_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def preprocess(
129129
user_input_placeholders.append(node.meta["val"])
130130

131131
options: dict[str, typing.Any] = {
132+
# Better model precision
133+
"emulate_precision_casts": True,
132134
# Embed CUDA kernel binaries directly into the compiled shared object
133135
"aot_inductor.embed_kernel_binary": True,
134136
# Do not link against the full PyTorch/libtorch library

0 commit comments

Comments
 (0)