Skip to content

Commit 39ac60e

Browse files
committed
Correct the flux export example
1 parent 98cbd76 commit 39ac60e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/dynamo/torch_export_flux_dev.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
use_fp32_acc=True,
114114
use_explicit_typing=True,
115115
use_python_runtime=True,
116+
immutable_weights=False,
116117
)
117118

118119
# %%
@@ -121,11 +122,11 @@
121122
# Release the GPU memory occupied by the exported program and the pipe.transformer
122123
# Set the transformer in the Flux pipeline to the Torch-TRT compiled model
123124

124-
del ep
125-
backbone.to("cpu")
126125
pipe.to(DEVICE)
127-
torch.cuda.empty_cache()
126+
backbone.to("cpu")
128127
pipe.transformer = trt_gm
128+
del ep
129+
torch.cuda.empty_cache()
129130
pipe.transformer.config = config
130131
trt_gm.device = torch.device("cuda")
131132
# %%

0 commit comments

Comments
 (0)