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 
相关推荐
星空椰31 分钟前
从零到实战:一套完整的 Python 爬虫技术体系(requests + BeautifulSoup + 正则 + JSON)
爬虫·python·json·beautifulsoup
七颗糖很甜8 小时前
电离层对地基雷达测量精度的影响分析与校正方法
python
AC赳赳老秦8 小时前
知识产权辅助:用 OpenClaw 批量生成专利交底书 / 软著申请材料,自动校验格式与内容合规性
java·人工智能·python·算法·elasticsearch·deepseek·openclaw
小熊Coding9 小时前
Python2D射击冒险闯关游戏2.0版本
python·pygame
FYKJ_20109 小时前
springboot校园兼职平台--附源码02041
java·javascript·spring boot·python·eclipse·django·php
yanghuashuiyue11 小时前
Deep Agents 框架-CLI
python·langchain·langgraph·deepagents
Zik----11 小时前
DAEFR (ICLR 2024)— 盲脸超分模型解读
人工智能·python·高光谱图像·光谱恢复
头发够用的程序员12 小时前
C++和Python面试经典算法汇总(一)
开发语言·c++·python·算法·容器·面试
夜猫逐梦12 小时前
【逆向经验】一篇文章讲透为什么CE搜不到Python游戏的内存值
开发语言·python·游戏
Zik----12 小时前
CILP模型讲解
人工智能·python·多模态