21
21
VERSION_COMPATIBLE ,
22
22
OPTIMIZATION_LEVEL ,
23
23
USE_EXPERIMENTAL_RT ,
24
+ TRUNCATE_LONG_AND_DOUBLE ,
24
25
)
25
26
26
27
@@ -44,7 +45,7 @@ def compile(
44
45
dla_local_dram_size = 1073741824 ,
45
46
dla_global_dram_size = 536870912 ,
46
47
calibrator = None ,
47
- truncate_long_and_double = False ,
48
+ truncate_long_and_double = TRUNCATE_LONG_AND_DOUBLE ,
48
49
require_full_compilation = False ,
49
50
min_block_size = MIN_BLOCK_SIZE ,
50
51
torch_executed_ops = [],
@@ -63,7 +64,7 @@ def compile(
63
64
"The Dynamo backend is an experimental feature, for which only the "
64
65
+ "following arguments are supported: "
65
66
+ "{enabled_precisions, debug, workspace_size, min_block_size, "
66
- + "torch_executed_ops, pass_through_build_failures}"
67
+ + "truncate_long_and_double, torch_executed_ops, pass_through_build_failures}"
67
68
)
68
69
69
70
if not isinstance (inputs , collections .abc .Sequence ):
@@ -100,6 +101,7 @@ def compile(
100
101
version_compatible = version_compatible ,
101
102
optimization_level = optimization_level ,
102
103
use_experimental_rt = use_experimental_rt ,
104
+ truncate_long_and_double = truncate_long_and_double ,
103
105
** kwargs ,
104
106
)
105
107
@@ -127,6 +129,7 @@ def create_backend(
127
129
version_compatible : bool = VERSION_COMPATIBLE ,
128
130
optimization_level : Optional [int ] = OPTIMIZATION_LEVEL ,
129
131
use_experimental_rt : bool = USE_EXPERIMENTAL_RT ,
132
+ truncate_long_and_double : bool = TRUNCATE_LONG_AND_DOUBLE ,
130
133
** kwargs ,
131
134
):
132
135
"""Create torch.compile backend given specified arguments
@@ -160,6 +163,7 @@ def create_backend(
160
163
version_compatible = version_compatible ,
161
164
optimization_level = optimization_level ,
162
165
use_experimental_rt = use_experimental_rt ,
166
+ truncate_long_and_double = truncate_long_and_double ,
163
167
)
164
168
165
169
return partial (
0 commit comments