FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

fastchat-t5-3b-v1.0 on macOS?

Open fdstevex opened this issue 2 years ago • 9 comments

Hi, I'm trying to use fastchat-t5-3b-v1.0 on macOS following the instructions in the README.

Simply run the line below to start chatting. It will automatically download the weights from a Hugging Face repo.
python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0

When I do this, I get the error "Torch not compiled with CUDA enabled".

I added --device mps --load-8bit to run it as

python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0 --device mps --load-8bit

And that gives a different error: "Unrecognized configuration class <class 'transformers.models.t5.configuration_t5.T5Config'> for this kind of AutoModel: AutoModelForCausalLM".

Is this usable without CUDA?

fdstevex avatar Apr 29 '23 23:04 fdstevex

Something wrong with the code here, not your device

Kimiko-AI avatar Apr 30 '23 00:04 Kimiko-AI

Macbook M1. I met the same problem. It seemed that the function AutoModelForCausalLM was not supported fastchat-t5-3b-v1.0. ValueError: Unrecognized configuration class <class 'transformers.models.t5.configuration_t5.T5Config'> for this kind of AutoModel: AutoModelForCausalLM. Model type should be one of BartConfig, BertConfig, BertGenerationConfig, BigBirdConfig, BigBirdPegasusConfig, BioGptConfig, BlenderbotConfig, BlenderbotSmallConfig, BloomConfig, CamembertConfig, CodeGenConfig, CpmAntConfig, CTRLConfig, Data2VecTextConfig, ElectraConfig, ErnieConfig, GitConfig, GPT2Config, GPT2Config, GPTBigCodeConfig, GPTNeoConfig, GPTNeoXConfig, GPTNeoXJapaneseConfig, GPTJConfig, LlamaConfig, MarianConfig, MBartConfig, MegaConfig, MegatronBertConfig, MvpConfig, OpenAIGPTConfig, OPTConfig, PegasusConfig, PLBartConfig, ProphetNetConfig, QDQBertConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, Speech2Text2Config, TransfoXLConfig, TrOCRConfig, XGLMConfig, XLMConfig, XLMProphetNetConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig.

sqzhang-jeremy avatar May 02 '23 06:05 sqzhang-jeremy

Have the following issue on M2 Pro:

python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0 --device mps --style rich
Human:
hi

Assistant:
loc("mps_clamp"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":268:0)): error: input types 'tensor<1x600x2048xf16>' and 'tensor<1x1x1xf32>' are not broadcast compatible
LLVM ERROR: Failed to infer result type(s).
fish: Job 1, 'python3 -m fastchat.serve.cli -…' terminated by signal SIGABRT (Abort)

EugeneVanchugov avatar May 02 '23 21:05 EugeneVanchugov

@DachengLi1 is looking into it

zhisbug avatar May 04 '23 08:05 zhisbug

it seems that Pytorch has issues with mps.

salym avatar May 04 '23 21:05 salym

Same issues on Windows 10.

codeisnotcode avatar May 05 '23 05:05 codeisnotcode

Glad I found this issue, I'm having the same problem.

willie avatar May 05 '23 19:05 willie

我使用下面命令可以运行 python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0 --device cpu

SCzfdf avatar May 08 '23 10:05 SCzfdf

It works on cpu, but it's very slow. Should this work on mps on devices with an M1/M2?

fdstevex avatar May 08 '23 12:05 fdstevex

"--device cpu" works for me as well, extremely slow though. I hope there is a perfect solution for MacBook in the future.

lovecactus avatar May 09 '23 06:05 lovecactus

@SCzfdf

用CPU执行的速度太慢

salym avatar May 09 '23 18:05 salym

I am having the same issue. Is there an issue on PyTorch repo that we can track and bump up in priority?

kamroot avatar May 17 '23 22:05 kamroot

Having the same issue with M1 Pro 16 GB.

If I use --device mps error: input types 'tensor<1x601x2048xf16>' and 'tensor<1x1x1xf32>' are not broadcast compatible LLVM ERROR: Failed to infer result type(s).

If I use --device mps --load-8bit ValueError: Unrecognized configuration class <class 'transformers.models.t5.configuration_t5.T5Config'> for this kind of AutoModel: AutoModelForCausalLM. Model type should be one of BartConfig, BertConfig, BertGenerationConfig, BigBirdConfig, BigBirdPegasusConfig, BioGptConfig, BlenderbotConfig, BlenderbotSmallConfig, BloomConfig, CamembertConfig, CodeGenConfig, CpmAntConfig, CTRLConfig, Data2VecTextConfig, ElectraConfig, ErnieConfig, GitConfig, GPT2Config, GPT2Config, GPTBigCodeConfig, GPTNeoConfig, GPTNeoXConfig, GPTNeoXJapaneseConfig, GPTJConfig, LlamaConfig, MarianConfig, MBartConfig, MegaConfig, MegatronBertConfig, MvpConfig, OpenAIGPTConfig, OPTConfig, PegasusConfig, PLBartConfig, ProphetNetConfig, QDQBertConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, Speech2Text2Config, TransfoXLConfig, TrOCRConfig, XGLMConfig, XLMConfig, XLMProphetNetConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig.

Works on cpu.

Suji04 avatar May 19 '23 20:05 Suji04

Same thing on my Macbook Pro 13 M1

gkozyrev avatar May 20 '23 02:05 gkozyrev

python3 -m fastchat.serve.cli --model-path /Users/username/Documents/workspace/fastchatt53bv1.0 --device cpu

same problem

device:M1 macbook pro

I use --device cpu ValueError: Unrecognized configuration class <class 'transformers.models.t5.configuration_t5.T5Config'> for this kind of AutoModel: AutoModelForCausalLM. Model type should be one of BartConfig, BertConfig, BertGenerationConfig, BigBirdConfig, BigBirdPegasusConfig, BioGptConfig, BlenderbotConfig, BlenderbotSmallConfig, BloomConfig, CamembertConfig, CodeGenConfig, CpmAntConfig, CTRLConfig, Data2VecTextConfig, ElectraConfig, ErnieConfig, GitConfig, GPT2Config, GPT2Config, GPTBigCodeConfig, GPTNeoConfig, GPTNeoXConfig, GPTNeoXJapaneseConfig, GPTJConfig, LlamaConfig, MarianConfig, MBartConfig, MegaConfig, MegatronBertConfig, MvpConfig, OpenAIGPTConfig, OPTConfig, PegasusConfig, PLBartConfig, ProphetNetConfig, QDQBertConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, Speech2Text2Config, TransfoXLConfig, TrOCRConfig, XGLMConfig, XLMConfig, XLMProphetNetConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig.

ExpressGit avatar Oct 09 '23 02:10 ExpressGit