omnilingual_asr在Nvidia Spark DGX中部署

1 容器选择

目前至少需要/pytorch:25.09 才支持Nvidia Spark DGX,内置Python版本为3.12.3,torch版本2.9。

进入容器并进行后续的步骤。

shell 复制代码
docker run --rm -it --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/pytorch:25.09-py3  

2 编译fairseq2

从依赖可知omnilingual_asr 依赖fairseq2==0.6 。但是fairseq2没有对应的ARM版本,需要自行编译。

2.1 环境准备

参考官方源码编译教程,并进行改良。

shell 复制代码
git clone --recurse-submodules https://github.com/facebookresearch/fairseq2.git
cd fairseq2
git checkout v0.6.0
apt-get update
apt install libsndfile-dev
pip install -r native/python/requirements-build.txt

2.2 编译

shell 复制代码
export TORCH_CUDA_ARCH_LIST="10.0 11.0"
cd native
cmake -GNinja \
      -DCMAKE_CUDA_ARCHITECTURES="100" \
      -DFAIRSEQ2N_USE_CUDA=ON \
      -DFAIRSEQ2N_CUDA_ARCH_LIST="10.0" \
      -DCMAKE_BUILD_TYPE=Release \
      -B build
      
cmake --build build

cd python
pip install . --no-build-isolation
cd ../../
pip install . --no-build-isolation

3 安装omnilingual_asr

最新版本官方没有发布arm版本,需要自己直接去官网下发布版本。

然后正常安装即可。顺便还原psutil和huggingface-hub版本避免其他依赖被破坏。

shell 复制代码
pip install .
pip install psutil==7.0.0 huggingface-hub==1.9.2 

4 安装配套的torchaudio

默认会安装到与实际版本不配套的torchaudio,程序无法正常运行。

由于torch版本是2.9的修改版,普通pip安装不到配套的torchaudio,需要从源码编译安装。

官网下载2.9.0对应的release,然后安装

shell 复制代码
pip wheel -v . --no-build-isolation --no-deps -w dist

做出来wheel包方便后续再用。

由于实际上写着依赖torch==2.9.0,会破坏容器内的特殊torch,安装wheel包时也需要不安装依赖

shell 复制代码
pip install torchaudio-2.9.0-cp312-cp312-linux_aarch64.whl --no-deps 
相关推荐
金銀銅鐵1 天前
[Python] 从《千字文》中随机挑选汉字
后端·python
cup111 天前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi002 天前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵2 天前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf2 天前
Agent 流程编排
后端·python·agent
copyer_xyf2 天前
Agent RAG
后端·python·agent
copyer_xyf2 天前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf2 天前
Agent 记忆管理
后端·python·agent
星云穿梭2 天前
用Python写一个带图形界面的学生管理系统——完整教程
python