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

Suggestion on optimizing inference when model output size is large. #7824

Open
zmy1116 opened this issue Nov 22, 2024 · 0 comments
Open

Suggestion on optimizing inference when model output size is large. #7824

zmy1116 opened this issue Nov 22, 2024 · 0 comments

Comments

@zmy1116
Copy link

zmy1116 commented Nov 22, 2024

Hello,

We are working on serving SAM2 image encoder on nvidia-triton. We use torch-tensorrt to generate the engine and serve on triton servrer. We observe that the inference speed on triton is significantly slower (<10 FPS) than running the torch-tensorrt model with pytorch (30+FPS), including input cpu ->gpu, output gpu->numpy, even on the tiny model.

The image encoder output multiple things including 4 feature maps at different resolution of sizes (96x256x256, 192x128x128, 384x64x64, 768x32x32). We observe that if we just ouptut the last feature map (the 768x32x32), the inference speed increase to 40 FPS+.

We thus suspect the time is mostly spend at pushing result out numpy. If this is the case, what can you suggest us to do to have reasonable inference speed? (chatgpt/claude suggest to have a shared memory thing for inputs and outputs, but the generated code many bugs so I'm not too sure if this is the right way).

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant