Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama_quant.py 用datasets进行评估的意义 #20

Closed
GUORUIWANG opened this issue Mar 31, 2023 · 4 comments
Closed

llama_quant.py 用datasets进行评估的意义 #20

GUORUIWANG opened this issue Mar 31, 2023 · 4 comments

Comments

@GUORUIWANG
Copy link

1)我看使用英文的数据集来评估的,可以省略这一步吗
2)如何用自己的数据集进行评估呢

@Chuge0335
Copy link
Collaborator

Chuge0335 commented Mar 31, 2023

1)我们也发现了这个问题 ,量化后的评估占据了大部分时间,并在第一时间更新了tools/readme.md
相比于之前的命令加上了--eval 参数可以只进行量化不进行评估

python llama_quant.py decapoda-research/llama-7b-hf c4 --wbits 2 --save pyllama-7B2b.pt --eval

2)中文数据评估暂未考虑

@GUORUIWANG
Copy link
Author

1)我们也发现了这个问题 ,量化后的评估占据了大部分时间,并在第一时间更新了tools/readme.md 相比于之前的命令加上了--eval 参数可以只进行量化不进行评估

python llama_quant.py decapoda-research/llama-7b-hf c4 --wbits 2 --save pyllama-7B2b.pt --eval

2)中文数据评估暂未考虑

你好,llama_quant.py 439 line 中 449行 dataloader 的作用是啥呀,为啥这里也要引入数据集呢
quantizers = llama_sequential(model, dataloader, args, dev)

@Chuge0335
Copy link
Collaborator

1)我们也发现了这个问题 ,量化后的评估占据了大部分时间,并在第一时间更新了tools/readme.md 相比于之前的命令加上了--eval 参数可以只进行量化不进行评估

python llama_quant.py decapoda-research/llama-7b-hf c4 --wbits 2 --save pyllama-7B2b.pt --eval

2)中文数据评估暂未考虑

你好,llama_quant.py 439 line 中 449行 dataloader 的作用是啥呀,为啥这里也要引入数据集呢 quantizers = llama_sequential(model, dataloader, args, dev)

1.量化过程中,需要将数据输入到模型中以确定放缩系数(scale)和上下界(max ,min)。
2.模型量化过程中参数和数据需要都需要被量化,而不是仅仅量化模型权重,所以必须输入一定的数据。
关于transformer量化的更多技术可以参考:https://lilianweng.github.io/posts/2023-01-10-inference-optimization/

@GUORUIWANG
Copy link
Author

好的谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants