Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRT wrappers for Vista3D #28

Open
wants to merge 40 commits into
base: vista3d
Choose a base branch
from

Conversation

borisfom
Copy link

@borisfom borisfom commented Jul 24, 2024

Description

Adds TRT acceleration.
Depends on Project-MONAI/MONAI#7990

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • In-line docstrings updated.

@borisfom borisfom changed the title TRT wrappers for Vista3D Draft: TRT wrappers for Vista3D Jul 24, 2024
@mingxueg-nv
Copy link
Contributor

mingxueg-nv commented Jul 29, 2024

@heyufan1995 @Nic-Ma
Please help review this draft PR.
Vista3D TRT end-to-end is about 10% faster than PyTorch.

@mingxueg-nv
Copy link
Contributor

@yiheng-wang-nv please also help review it. Thanks.

Signed-off-by: Boris Fomitchev <[email protected]>
@borisfom borisfom changed the title Draft: TRT wrappers for Vista3D TRT wrappers for Vista3D Aug 1, 2024
@borisfom
Copy link
Author

borisfom commented Aug 1, 2024

The perf gain from TRT end-to-end is about 20% on infer_everything sample I ran (18s vs 22s):
python3 -m scripts.infer --config_file 'configs/infer.yaml' - infer_everything --image_file 'example-1.nii.gz'

@Nic-Ma
Copy link

Nic-Ma commented Aug 1, 2024

Hi @heyufan1995 ,

Could you please help review this PR?

Thanks in advance.

@mingxueg-nv
Copy link
Contributor

Hi, @bfomitchev, I notice that you have added TRT wrapper in latest version.
Could you please help adopt previous method for both supports of TensorRT and PyTorch.
For instance,
PyTorch uses
python3 -m scripts.infer --config_file 'configs/infer.yaml' - infer_everything --image_file 'example-1.nii.gz'
TensorRT uses
python3 -m scripts.export --config_file 'configs/infer.yaml' - infer_everything --image_file 'example-1.nii.gz'
It's fine for users to infer even without the TensorRT environment.
Thanks.

@borisfom
Copy link
Author

borisfom commented Aug 1, 2024

@mingxueg-nv : I have removed export.py in the latest version to avoid duplication. TRT use is being controlled by "trt" config flag in infer.yaml. I will add graceful fallback for the case when TRT is not installed.

@mingxueg-nv
Copy link
Contributor

mingxueg-nv commented Aug 2, 2024

@mingxueg-nv : I have removed export.py in the latest version to avoid duplication. TRT use is being controlled by "trt" config flag in infer.yaml. I will add graceful fallback for the case when TRT is not installed.

Thanks.

I will measure accuracy today to supplement more benchmark details.

@yiheng-wang-nv
Copy link

we can enable trt version in model zoo after this PR merge cc @heyufan1995

@borisfom
Copy link
Author

borisfom commented Aug 5, 2024

Now depends on Project-MONAI/MONAI#7990

borisfom and others added 20 commits August 5, 2024 12:44
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Signed-off-by: Boris Fomitchev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants