Giter Club home page Giter Club logo

Comments (4)

larryliu0820 avatar larryliu0820 commented on June 9, 2024 2

The model I used is official llama2-7b pth model, which parameters size is close to 13GB. the fp32 pte file I got by using following steps:

python3 -m examples.models.llama2.export_llama -c ../llama2/consolidated.00.pth -p ../llama2/params.json

The size of llama.pte file I got is 26GB. This is already twice the weight of the original model file, is this reasonable? What are the main contents of the pte file besides the model weights?

Hi thanks for trying out llama model. Please note that by default we are converting fp16 weights to fp32 which is the reason of doubling the pte file size. The reason for this decision was we didn’t support fp16 that well before. Now that we have full support for fp16 on portable kernels, we will change the default behavior of export_llama to be exporting fp16.

BTW you can pass a -H flag to the script to export to fp16.

from executorch.

huangzhiyuan avatar huangzhiyuan commented on June 9, 2024

@larryliu0820 thanks for your reply!
my question is that llama2/consolidated.00.pth is a fp32 model, not half, there is no fp16 weight to fp32. but why pte file still double?
BTW, the pte file size if 16GB when I pass a -H flag to the script by using fp16.

from executorch.

larryliu0820 avatar larryliu0820 commented on June 9, 2024

@huangzhiyuan AFAIK llama2/consolidated.00.pth is a checkpoint with fp16 weights.

from executorch.

huangzhiyuan avatar huangzhiyuan commented on June 9, 2024

You are right. I make a mistake, and it makes sense.
Now close the issue.

from executorch.

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.