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

use VectorExecutor() on GPU will stuck #3957

Open
DoItWithMe opened this issue Dec 25, 2024 · 6 comments
Open

use VectorExecutor() on GPU will stuck #3957

DoItWithMe opened this issue Dec 25, 2024 · 6 comments

Comments

@DoItWithMe
Copy link

在 GPU 模式下,使用VectorExecutor() 串行提取音频特征时,会在提取第二首歌时卡住。

VectorExecutor 实例化对象为同一个,

GPU 为 NVIDIA T4,
cuda 版本信息如下

W1225 08:43:29.520332 3224690 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 12.2, Runtime API Version: 11.8

@DoItWithMe
Copy link
Author

image

@DoItWithMe
Copy link
Author

DoItWithMe commented Dec 25, 2024

提取速度并不稳定,且 GPU 显存高占用,但是 GPU 使用率为 0 (该现象在每次都创建一个新的 vector 实例的情况下也存在

image

@Ray961123
Copy link

开发者你好,感谢关注 PaddleSpeech 开源项目,抱歉给你带来了不好的开发体验,目前开源项目维护人力有限,你可以尝试通过修改 PaddleSpeech 源码的方式自己解决,或请求开源社区其他开发者的协助。飞桨开源社区交流频道:飞桨AI Studio星河社区-人工智能学习与实训社区

@zxcd
Copy link
Collaborator

zxcd commented Jan 15, 2025

看看串行代码怎么写的

@DoItWithMe
Copy link
Author

DoItWithMe commented Jan 16, 2025

看看串行代码怎么写的

Image

外层有个循环遍历本地文件,每次传入一个文件且创建一个新的 VectorExecutor 进行特征提取。当然我也是试过每次使用同一个 VectorExecutor 进行特征提取,阻塞的现象仍会发生

@zxcd
Copy link
Collaborator

zxcd commented Jan 21, 2025

首先VectorExecutor取同一个就可以了,如果你这么写建议在__init__函数中定义一个self.vector_executor

循环方面帮你试验了一下,是不会卡主的,示例代码如下:

import paddle
from paddlespeech.cli.vector import VectorExecutor
import io

vector_executor = VectorExecutor()

for line in io.open('./test-clean.wavlist', encoding="utf8"):
    wav = line.strip()
    text = vector_executor(
        sample_rate=16000,
        audio_file=wav,
        device=paddle.get_device())
    print (text)

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

3 participants