FlagOpen / FlagEmbedding

Retrieval and Retrieval-augmented LLMs
MIT License
5.97k stars 432 forks source link

MPSTemporaryNDArray initWithDevice:descriptor:] Error: product of dimension sizes > 2**31 #536

Open AlphaNext opened 3 months ago

AlphaNext commented 3 months ago

script.py:

 from mteb import MTEB
 from C_MTEB import *
 from sentence_transformers import SentenceTransformer

 # Define the sentence-transformers model name
 model_name = "../../bge-large-zh-v1.5"

 model = SentenceTransformer(model_name)
 evaluation = MTEB(task_langs=['zh'], tasks=['DuRetrieval'])
 results = evaluation.run(model, output_folder=f"zh_results/{model_name}")

ERROR:

Retrieval
    - DuRetrieval, s2p
    - DuRetrieval, s2p

Batches: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [02:14<00:00,  8.43s/it]
Batches:   0%|                                                                                                                                                                                        | 0/391 [00:00<?, ?it/s]
/AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:705: failed assertion `[MPSTemporaryNDArray initWithDevice:descriptor:] Error: product of dimension sizes > 2**31'
staoxiao commented 3 months ago

The error seems to be related to your device. A smaller batch size may be helpful (set a smaller batch size in https://github.com/FlagOpen/FlagEmbedding/blob/master/C_MTEB/flag_dres_model.py#L16)