FlagEmbedding icon indicating copy to clipboard operation
FlagEmbedding copied to clipboard

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

Open AlphaNext opened this issue 1 year ago • 1 comments

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'

AlphaNext avatar Mar 12 '24 02:03 AlphaNext

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)

staoxiao avatar Mar 12 '24 08:03 staoxiao