FlexGenで遊んだメモ

FlexGenローカルで動かしてみたのでメモ

windows10
メモリ64GB
RTX3080 12gb


githubに描いてるとおりの実行で、1.3Bまでは問題なくいけました。

git clone https://github.com/FMInference/FlexGen.git
cd FlexGen
pip3 install -e .
python3 -m flexgen.flex_opt --model facebook/opt-1.3b

次の30Bなんですが、ここでメモリに書き込めないってエラーが出て失敗。

python3 -m flexgen.flex_opt --model facebook/opt-30b --percent 0 100 100 0 100 0

13Bの方で試しても失敗。

python3 -m flexgen.flex_opt --model facebook/opt-13b --percent 0 100 100 0 100 0

こちらのノート見て、--compress-weight --percent 0 0 100 0 100 0 をつけて成功。

#30Bの時
python apps/chatbot.py --model facebook/opt-30b --percent 0 0 100 0 100 0 --compress-weight
Initialize...
A chat between a curious human and a knowledgeable artificial intelligence assistant.
Human: Hello! What can you do?
Assistant: As an AI assistant, I can answer questions and chat with you.
Human: What is the name of the tallest mountain in the world?
Assistant: Everest.
Human: こんにちは
Assistant: Hi!
Human: あなたの名前を教えてください
Assistant: My name is Ai.
Human: お勧めのおやつを教えてください
Assistant: For what kind of food?
Human: 仏教の伝来が神道へどのような影響を与えたか教えてください。日本語で。
Assistant: Well, the effect of Buddhism in Japan is not so big.
#13Bの時
python apps/chatbot.py --model facebook/opt-13b --percent 0 0 100 0 100 0 --compress-weight
Initialize...
A chat between a curious human and a knowledgeable artificial intelligence assistant.
Human: Hello! What can you do?
Assistant: As an AI assistant, I can answer questions and chat with you.
Human: What is the name of the tallest mountain in the world?
Assistant: Everest.
Human: こんにちは
Assistant: どうぞ
Human: あなたの名前を教えてください
Assistant: 名前 なんでしょう?
Human: お勧めのおやつを教えてください
Assistant: お肉 なんでしょう?
Human: 仏教の伝来が神道へどのような影響を与えたか教えてください。
Assistant: お肉 はどのような影響を与えているのか教えてください。
Human:
exit...

13Bと30Bはゆっくりですが動く感じでした。
30Bの方、日本語理解してるみたいだけど、聞き方次第で日本語で答えてくれたりするのかなぁ?


この記事が気に入ったらサポートをしてみませんか?