Skip to content

Commit 6806f1f

Browse files
awoll-bdaiexploy-bot
authored andcommitted
Disable constant folding (#26)
# Pull Request ### What change is being made Disable constant folding ### Why this change is being made Allow to export tasks on cuda ### Tested Tests with task on cuda GitOrigin-RevId: 0181833766b4b18c4d52cafaa9c729807362b9a6
1 parent c2118a2 commit 6806f1f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

exporter/exporter/exporter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ def export(
222222
verbose=self.verbose,
223223
input_names=input_names,
224224
output_names=output_names,
225+
# constant folding requires that all tensors are on the same device. as constants
226+
# are on cpu, we disable it to allow exporting of models on cuda. constant folding
227+
# optimization will be done in the ONNX runtime when we load the model for deployment.
228+
do_constant_folding=False,
225229
)
226230

227231
wrapper_model = construct_decimation_wrapper(

0 commit comments

Comments
 (0)