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

Question: Does ONNX-RT silently fallbacks to CPU? #228

Open
Thytu opened this issue Dec 20, 2023 · 1 comment
Open

Question: Does ONNX-RT silently fallbacks to CPU? #228

Thytu opened this issue Dec 20, 2023 · 1 comment

Comments

@Thytu
Copy link

Thytu commented Dec 20, 2023

Context
Hey, I'm setting up a python backend and I am using dlpack to keep the tensors on GPU. As described in its doc, the tensor will be in either CPU or GPU memory, depending on how those tensors were last used, which in my cased is by a ONNX model using an ensemble.

A dummy diagram of the ensemble would be like this:

 ------------                  -------------- 
| ONNX MODEL | ---[Tensor]--> | Python Model |
 ------------                  -------------- 

When doing the request one by one to my ensemble, the Tensor is indeed always on the GPU as expected, but when sending a bunch of request simultaneously to the ensemble, it appears that some times the tensor is instead present on the CPU.

I see only three possible reasons for this behaviour:

  1. ONNX-RT/backend does a silent fallback to CPU
  2. Triton's queue sometimes move the tensor from GPU to CPU (would be the first time we see this)
  3. Another model/service use this tensor (but none of my models does use this same tensor)

Note that both models are set as KIND_GPU, and for debugging purposed the max batch size is set to 1.

Question
Is it possible that ONNX-RT or the ONNX Backend does a silent fallback to CPU when certain conditions are met?

@Thytu
Copy link
Author

Thytu commented Dec 21, 2023

@jsoto-gladia

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

No branches or pull requests

1 participant