VISTA icon indicating copy to clipboard operation
VISTA copied to clipboard

TRT wrappers for Vista3D

Open borisfom opened this issue 1 year ago • 9 comments

Description

Adds TRT acceleration. Depends on https://github.com/Project-MONAI/MONAI/pull/7990

Types of changes

  • [x] 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 avatar Jul 24 '24 04:07 borisfom

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

mingxueg-nv avatar Jul 29 '24 02:07 mingxueg-nv

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

mingxueg-nv avatar Jul 29 '24 09:07 mingxueg-nv

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'

borisfom avatar Aug 01 '24 00:08 borisfom

Hi @heyufan1995 ,

Could you please help review this PR?

Thanks in advance.

Nic-Ma avatar Aug 01 '24 07:08 Nic-Ma

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.

mingxueg-nv avatar Aug 01 '24 10:08 mingxueg-nv

@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.

borisfom avatar Aug 01 '24 19:08 borisfom

@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.

mingxueg-nv avatar Aug 02 '24 02:08 mingxueg-nv

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

yiheng-wang-nv avatar Aug 05 '24 02:08 yiheng-wang-nv

Now depends on https://github.com/Project-MONAI/MONAI/pull/7990

borisfom avatar Aug 05 '24 06:08 borisfom