You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用evaluate库评估BertScore时仅占用单块GPU的问题咨询

使用evaluate库评估BertScore时仅占用单块GPU的问题咨询

各位好,我遇到了个GPU资源利用的小问题想请教下:

我现在用evaluate库来计算BertScore,手里的设备是双卡GeForce 4090,每块卡都有24GB显存,但运行代码的时候发现只用到了其中一块GPU,完全没用到另一块的资源,感觉有点浪费硬件性能。

下面是我目前在用的代码:

import evaluate
import numpy as np

bertscore = evaluate.load("bertscore")
bertscore_result = bertscore.compute(predictions=[sentence], references=references_sentence)
bertscore_avg = np.mean(bertscore_result["f1"])  

print("BertScore:", bertscore_avg)

(补充说明:代码里的sentence和references_sentence是我提前定义好的变量,这里就没贴出来啦)

想问问大家,有没有办法调整代码或者设置,让BertScore的计算过程能同时利用我的两块GPU呢?谢谢各位的指点!

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 13:23:03