You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zhaowenbin
changed the title
昇腾310P芯片首次跑embedding很慢,第二次及之后再跑就很快
The Ascend 310 P chip is very slow in embedding for the first time, and fast in the second and later.
Nov 20, 2024
Hello, @zhaowenbin. This is normal since initializing multiple devices (refer to here) need some time. If the size of your text_data is small, you can add parameter devices="..." to use only one GPU to save the time for initializing multiple devices. The modified code:
fromFlagEmbeddingimportFlagModel, FlagReranker
......
model=FlagModel(base_model_path, use_fp16=True, devices="...") # `...` need to be replaced
......
//That's the step. It'sslowforthefirsttime, 50or60secondsforthefirsttime, andthen0.0secondsforthenext.
query_embedding=model.encode(text_data)
This problem does not occur on the 910B, but occurs on the 310P.
Some codes are as follows:
Is it because there's no adaptation?
The text was updated successfully, but these errors were encountered: