Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用了GPU运行,但是CPU使用率依旧很高?根据性能报告,GPU确实生效。 #1723

Open
12915494174 opened this issue May 13, 2024 · 2 comments

Comments

@12915494174
Copy link

12915494174 commented May 13, 2024

使用了GPU运行,但是CPU使用率依旧很高?根据性能报告,GPU确实生效。请问这个现象的原因是为什么?
我的代码如下:

import time
import json
# paraformer-zh is a multi-functional asr model
# use vad, punc, spk or not as you need
model = AutoModel(
        model="/root/autodl-tmp/seaco/iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
        model_revision="v2.0.4",
        vad_model="iic/speech_fsmn_vad_zh-cn-16k-common-pytorch", vad_model_revision="v2.0.4",
        punc_model="iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch", punc_model_revision="v2.0.4",
        spk_model="iic/speech_campplus_sv_zh-cn_16k-common", spk_model_revision="v2.0.2",
        device="cuda:0"
        )
begin = time.time()
res = model.generate(input=f"/root/funasr/b9d73dd3-d164-4508-8c51-4c6fc7058440_18889781464_1480.wav", 
            batch_size_s=300, 
            hotword='')
end = time.time()
print(res)
print(end - begin)
res_array = res
res_sentence_info = []
sentence_info_array = res_array[0]["sentence_info"]
for i in range(len(sentence_info_array)):
    tmp = {"spk": sentence_info_array[i]["spk"], "text": sentence_info_array[i]["text"]}
    res_sentence_info.append(tmp)
print(res_sentence_info)

下图是我在使用该代码跑多个任务的利用率报告截图:
image

@panw3i
Copy link

panw3i commented May 19, 2024

用的windows?

@12915494174
Copy link
Author

用的windows?

使用的linux,ubuntu 22.04系统。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants