pytorch - 如何将带有 CUDA 的 PyTorch 添加到 Dask Helm 图表
问题描述
将为 CUDA 编译的 PyTorch 安装到 Dask helm 图表中,它失败了:
按照上的说明为 CUDA 安装 PyTorch pytorch.org
(见下图)。
Dask helm 图表示例失败:
- name: EXTRA_CONDA_PACKAGES
value: "pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch"
解决方案
您可能想查看RAPIDS helm chart,它是 Dask helm chart 的扩展,但具有额外的 GPU 支持。
在运行时安装
RAPIDS Docker 镜像也支持相同的EXTRA_PIP_PACKAGES
,Dask Docker 镜像也支持。EXTRA_CONDA_PACKAGES
EXTRA_APT_PACKAGES
# config.yaml
dask:
scheduler:
image:
repository: rapidsai/rapidsai
tag: cuda11.0-runtime-ubuntu18.04-py3.8
worker:
image:
repository: rapidsai/rapidsai
tag: cuda11.0-runtime-ubuntu18.04-py3.8
env:
- name: EXTRA_CONDA_PACKAGES
value: "-c pytorch pytorch torchvision torchaudio"
# If you're using the bundled Jupyter Lab instance you probably want to install these here too
jupyter:
image:
repository: rapidsai/rapidsai
tag: cuda11.0-runtime-ubuntu18.04-py3.8
env:
- name: EXTRA_CONDA_PACKAGES
value: "-c pytorch pytorch torchvision torchaudio"
$ helm install rapidstest rapidsai/rapidsai -f config.yaml
提前安装
上述方法意味着每次工作人员启动时都会安装依赖项。因此,您可能更喜欢创建自己的自定义 Docker 映像,其中已包含这些依赖项。
# Dockerfile
FROM rapidsai/rapidsai:cuda11.0-runtime-ubuntu18.04-py3.8
RUN conda install -n rapids -c pytorch pytorch torchvision torchaudio
$ docker build -t jacobtomlinson/customrapids:latest .
$ docker push jacobtomlinson/customrapids:latest
# config.yaml
dask:
scheduler:
image:
repository: jacobtomlinson/customrapids
tag: latest
worker:
image:
repository: jacobtomlinson/customrapids
tag: latest
# If you're using the bundled Jupyter Lab instance you probably want to install these here too
jupyter:
image:
repository: jacobtomlinson/customrapids
tag: latest
$ helm install rapidstest rapidsai/rapidsai -f config.yaml
推荐阅读
- mongodb - MongoDB 和 Ubuntu 中的身份验证
- tensorflow - TensorFlow MultiRNNCell 保存和恢复
- python - RDS:无法获取在 boto3 describe_events 中显示为空白的事件
- php - Laravel 5.6 spatie/laravel-sitemap 生成默认xml行且无路由
- python - 如果我的包在 2.x 上,我可以发布 1.x 更新吗?(皮皮)
- node.js - NodeJS Stream 通过 async/await 错误返回
- javascript - Javascript 获取字符串出现次数
- java - 无法导入assertThat方法junit
- reactjs - Electron 应用程序启动时间过长
- python-3.x - Python TF 对象检测!找不到对象检测