Git Product home page Git Product logo

Comments (2)

galeone avatar galeone commented on July 22, 2024 1

Hi @alimoeeny thank you for the kind words!

Honestly, I have never tested multiple inferences of the same model in multiple go routines. I guess, being the forward pass handled by the C library, the TensorFlow backend should already handle the concurrency - but it's just a guess.

Now that I'm thinking about it (keep this message as a stream of consciousness from my side lol), I guess it's instead the exact opposite. The thread safety is left to the user in the C library - and this would make sense.

Because the nature of the SavedModel is complex. There could be SavedModel stateful (where, for example, the TensorFlow program updates internal tf.Variable nodes), or SavedModel stateless (the serialization of some tf.* operation without a state).

For this reason, the best thing to do is to left to the user the hassle of handling the multi-threading stuff.

If your SavedModel is stateless, who cares about thread safety, otherwise you should handle it 🤔

Keep this message for what it is - just some thoughts about this topic. The best thing to do is to experiment. If you can do it, everyone that uses tfgo will benefit from your tests (right now I'm busy working on a different Go software 😅 )

from tfgo.

alimoeeny avatar alimoeeny commented on July 22, 2024

thank you very much @galeone
I'll post to this thread if I discovered any concrete information, either from the docs or by experimentation :)

from tfgo.

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.