Giter Site home page Giter Site logo

Comments (5)

captainst avatar captainst commented on July 19, 2024 1

Hi @sushreebarsa

I made some investigations through the subgraph and arena_planner, and found that tflite does not provide no an such interface for the moment. I managed to use interpreter->SetCustomAllocationForTensor to mount an external allocated memory to each tensor. This is a technical viable approach, but in this case we loose the efficiency of memory usage provided by arena_planner. The amount memory we needed to provide externally is 2x to 4x, which does not make practical sense.

A more intelligent solution could be to make arena_planner use a memory pool provided externally. This could help to greatly alleviate the memory fragmentation problem, when we need to load and off-load different models frequently. This involves some modifications to arena.

For the moment I would think that the issue being closed. Probably we could contribute with PR when it is done from our side.

Thank you.

from tensorflow.

sushreebarsa avatar sushreebarsa commented on July 19, 2024

@captainst TensorFlow Lite (TFLite) doesn't have a built-in mechanism to directly share memory between different models loaded in separate interpreters. Model quantization is the recommended approach for this issue, kindly refer to this guide.
Thank you!

from tensorflow.

captainst avatar captainst commented on July 19, 2024

@captainst TensorFlow Lite (TFLite) doesn't have a built-in mechanism to directly share memory between different models loaded in separate interpreters. Model quantization is the recommended approach for this issue, kindly refer to this guide. Thank you!

Thank you! I only need to load one model at a time. So I don't need separate interpreters. Since all the models are of the same structure, I want to use one interpreter to serve all the models, one at a time. If I could find a way to manipulate the weights and quant params inside each tensor.

I'll do some further experiments to see. Thank you again.

from tensorflow.

sushreebarsa avatar sushreebarsa commented on July 19, 2024

@captainst Is there any update on this issue?
Thank you!

from tensorflow.

google-ml-butler avatar google-ml-butler commented on July 19, 2024

Are you satisfied with the resolution of your issue?
Yes
No

from tensorflow.

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.