From 3658b6c76647404d12fd5da1a29df90744d6a8ea Mon Sep 17 00:00:00 2001 From: tiansongxue Date: Thu, 21 Nov 2024 15:07:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90bugfix=E3=80=91=E3=80=90whisperX?= =?UTF-8?q?=E3=80=91=E7=8E=AF=E5=A2=83=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md index 69b0e7db08..911de25463 100644 --- a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md +++ b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md @@ -67,8 +67,9 @@ pip3 install ml-dtypes pip3 install cloudpickle pip3 install pyannote.audio==3.1.1 - ``` - 同时需要保证环境安装了libsndfile1, ffmpeg库 + ``` + 由于pyannote.audio与torch_npu不兼容,如果环境上安装了torch_npu,需要额外卸载torch-npu:pip3 uninstall torch_npu. + 同时需要保证环境安装了libsndfile1, ffmpeg库. ## 模型编译 模型编译分为两部分内容,需要分别编译whisper模型和vad模型,并将编译好的模型保存到同一个路径,大概耗时两小时左右。 -- Gitee From 6c6316fb379a1a821efd23cff8b7c2bc05e80afd Mon Sep 17 00:00:00 2001 From: tiansongxue Date: Thu, 21 Nov 2024 15:31:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90bugfix=E3=80=91=E3=80=90whisperX?= =?UTF-8?q?=E3=80=91=E7=8E=AF=E5=A2=83=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md index 911de25463..b1141c6b57 100644 --- a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md +++ b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md @@ -68,7 +68,7 @@ pip3 install cloudpickle pip3 install pyannote.audio==3.1.1 ``` - 由于pyannote.audio与torch_npu不兼容,如果环境上安装了torch_npu,需要额外卸载torch-npu:pip3 uninstall torch_npu. + 如果环境上安装了torch_npu, pyannote.audio会默认引入, 需要卸载torch_npu. 同时需要保证环境安装了libsndfile1, ffmpeg库. ## 模型编译 -- Gitee From dbf72f55f9fdeeb61155a6015f066655e7086930 Mon Sep 17 00:00:00 2001 From: tiansongxue Date: Sat, 23 Nov 2024 14:29:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90bugfix=E3=80=91=E3=80=90whisperX?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=A2=9E=E7=BB=91=E6=A0=B8=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../built-in/audio/mindie_whisperx/readme.md | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md index b1141c6b57..01c09ff996 100644 --- a/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md +++ b/MindIE/MindIE-Torch/built-in/audio/mindie_whisperx/readme.md @@ -124,23 +124,41 @@ python3 compile_vad.py \ ## 模型推理 -1, 开启cpu高性能模式进一步提升性能,开启失败不影响功能。 +1. 开启cpu高性能模式进一步提升性能,开启失败不影响功能。 ``` echo performance |tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 ``` -2.模型推理 +2. 安装绑核工具 +``` +apt-get update +apt-get install numactl +``` +查询卡的NUMA node +``` +lspci -vs bus-id +``` +注:通过npu-smi info查询推理卡id的bus-id,然后使用上面的命令得到推理卡id对应的NUMA node。 +查询NUMA node对应亲和的CPU核 +``` +lscpu +``` +能够看到对应NUMA node和对应哪些cpu,例如 +``` +NUMA node0 CPU(s): 0-31 +NUMA node1 CPU(s): 32-63 +``` +2.绑定CPU并模型推理,假设查询到的核数为0-31,具体 ``` - python3 example.py \ + taskset -c 0-31 python3 example.py \ -whisper_model_path ./whisper_pretrained \ -vad_model_path ./vad_pretrained \ -compiled_models ./compiled_models -audio_path /audio_path -bs * ``` - 参数说明: - -whisper_model_path : whisper的预训练模型路径,必选。 - -vad_model_path : vad的预训练模型路径,必选。 -- Gitee