File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 5555 is_diffusers_available ,
5656 is_onnxslim_available ,
5757 is_torch_onnx_support_available ,
58+ is_torch_version ,
5859 is_transformers_version ,
5960 logging ,
6061)
@@ -556,6 +557,12 @@ def remap(value):
556557 else :
557558 dynamix_axes = dict (chain (inputs .items (), config .outputs .items ()))
558559
560+ if is_torch_version (">=" , "2.9" ):
561+ # Starting from 2.9 dynamo's default value is True
562+ dynamo_kwargs = {"dynamo" : False }
563+ else :
564+ dynamo_kwargs = {}
565+
559566 # Export can work with named args but the dict containing named args has to be the last element of the args
560567 # tuple.
561568 onnx_export (
@@ -567,7 +574,7 @@ def remap(value):
567574 dynamic_axes = dynamix_axes ,
568575 do_constant_folding = do_constant_folding ,
569576 opset_version = opset ,
570- dynamo = False , # torch dynamo not yet supported
577+ ** dynamo_kwargs ,
571578 )
572579
573580 # check if external data was exported
You can’t perform that action at this time.
0 commit comments