Giter Site home page Giter Site logo

Comments (5)

josevalim avatar josevalim commented on June 10, 2024

The load model should be fast compared to the download, as it does not compile anything, and it will help validate you have downloaded the right artifact. And I believe safe tensors, which we want to make the default, load parameters lazily, so it should be even less work.

from bumblebee.

lawik avatar lawik commented on June 10, 2024

Maybe the right idea but this makes it kind of rough if you just want to load/upload the model on machine that isn't set up for inference. Or at least with the times I'm seeing.

Example: https://huggingface.co/google-bert/bert-base-cased

Download, clocked by counting out loud while the progress bars were going:

~14 seconds

Total load_model execution time:

76 seconds

Tested with:

:timer.tc(fn -> Bumblebee.load_model({:hf, "google-bert/bert-base-cased"}) end) |> elem(0) |> then(& &1 / 1000) |> IO.inspect(label: "ms")

No configuration done at all.

from bumblebee.

lawik avatar lawik commented on June 10, 2024

Ideally I'd love to stream the download from hugging face to an S3-compatible but that is further out of scope from what Bumblebee is about.

from bumblebee.

jonatanklosko avatar jonatanklosko commented on June 10, 2024

You can take files from HF repository and put in S3 or wherever, then when you download onto the local machine use {:file, path_to_repo_dir} (just make sure you don't copy parameter files in multiple formats, as that would be unnecessary).

In the future we may have our own serialisation format for things, but I don't think we should be exposing the download of hf/transformers files.


76 seconds

You'd need to use EXLA.Backend, because there are some transformations that are going to be slow otherwise.

from bumblebee.

lawik avatar lawik commented on June 10, 2024

That was a lot faster. I can make do.

from bumblebee.

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.