-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TRT config for inference (#1907)
### Description Added TRT config for MAISI and the extension of the inference script to handle extra config file. Note: autoencoder.decoder currently cannot be exported to TRT (crashes during engine generation). It does not seem to take a big part of the whole run anyway. --------- Signed-off-by: Boris Fomitchev <[email protected]> Co-authored-by: Yiheng Wang <[email protected]>
- Loading branch information
1 parent
f1de38f
commit 4a40380
Showing
4 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"+imports": [ | ||
"$from monai.networks import trt_compile" | ||
], | ||
"c_trt_args": { | ||
"export_args": { | ||
"dynamo": "$False", | ||
"report": "$True" | ||
}, | ||
"output_lists": [ | ||
[ | ||
-1 | ||
], | ||
[ | ||
] | ||
] | ||
}, | ||
"device": "cuda", | ||
"controlnet": "$trt_compile(@controlnet_def.to(@device), @trained_controlnet_path, @c_trt_args)", | ||
"diffusion_unet": "$trt_compile(@diffusion_unet_def.to(@device), @trained_diffusion_path)", | ||
"autoencoder": "$trt_compile(@autoencoder_def.to(@device), @trained_autoencoder_path, submodule='decoder')", | ||
"mask_generation_autoencoder": "$trt_compile(@mask_generation_autoencoder_def.to(@device), @trained_mask_generation_autoencoder_path, submodule='decoder')", | ||
"mask_generation_diffusion": "$trt_compile(@mask_generation_diffusion_def.to(@device), @trained_mask_generation_diffusion_path)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters