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

Batched inference API and support for float16 inference #279

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

salvaba94
Copy link

This branch adds support for half precision inference and a batched inference API (BatchedModel). Additionally, it includes a short demo showing how to use this API.

@rentainhe rentainhe requested a review from SlongLiu January 28, 2024 03:02
@ZachOBrien
Copy link

@salvaba94 I ran this batch inference demo but did not see any performance benefit to batching. Batch size 1 took 223ms on average, batch size 2 took 447ms on average, etc. It scaled linearly in the batch size.

Did you observe the same behavior? Or were you able to get better throughput via batching?

@salvaba94
Copy link
Author

Hi @ZachOBrien, I've just checked it and yes, I see marginal improvements by using batching.

Here are the results:

  • Batch 1 and float32: 363 ms
  • Batch 2 and float32: 668 ms
  • Batch 1 and float16: 217 ms
  • Batch 2 and float16: 351 ms

I guess the improvement depends on the GPU (this was tested with RTX 2060).

@KevinfromTJ
Copy link

did you encounter problems like #294 ?

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.

3 participants