Giter Club home page Giter Club logo

Comments (6)

ndeepesh avatar ndeepesh commented on June 5, 2024

@singhniraj08 Can you please help with above?

from serving.

singhniraj08 avatar singhniraj08 commented on June 5, 2024

@ndeepesh,

Apologies for late reply. Going through the old issue, TF Serving batching capability only supports dense tensors and sparse tensors are not supported yet. TensorFlow represents sparse tensors through the tf.sparse.SparseTensor object which is not supported in TF Serving batching.

One workaround I can think of is to convert the sparse tensor to dense tensor using tf.sparse.to_dense before sending it to your model. Let us know if this works for you. Thank you!

from serving.

ndeepesh avatar ndeepesh commented on June 5, 2024

Hi @singhniraj08 Thanks for your reply. Our TF model accepts those sparse tensors so that would require

  1. Changing the model to accept dense tensors instead of sparse.
  2. Sending sparse tensors over network compared to dense tensors improves I/O.

Followup Question:

  1. Lets say TF serving is running as a separate process with GPUs enabled. Does batching happens on CPU or GPU? If batching happens on GPU then I am thinking can Batching session convert sparse tensors to dense tensors (essentially execute the initial part of graph) and then produce batches? Is this feasible? Or if there is a way to do it - I am happy to contribute
  2. If batching happens on CPU then sparseToDense will happen on CPU and the whole dense tensor needs to be moved to GPU. Is that feasible?

from serving.

singhniraj08 avatar singhniraj08 commented on June 5, 2024

@ndeepesh, Tensorflow model graph utilizes the GPU and batching being a preprocessing step will happen in CPU.

I am not sure if sparse to dense transformation can be implemented on the batching side(as model server code is written in C++), implementing support of sparse tensors in TF Serving will make more sense. I understand your idea of converting spare to dense tensors during preprocessing step but in this case also, you would have to make changes in your model to accept dense tensor instead of sparse tensors.
And if you are concerned about the network latency, you are go through this article which can help you improve the TF Serving performance. Thanks.

from serving.

github-actions avatar github-actions commented on June 5, 2024

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

from serving.

github-actions avatar github-actions commented on June 5, 2024

This issue was closed due to lack of activity after being marked stale for past 7 days.

from serving.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.