TorchRec是一个PyTorch域库,用于提供大规模推荐系统(RecSys)所需的通用稀疏和并行原语。它允许作者使用跨多个gpu分割的大型嵌入表来训练模型。有关安装说明,请访问https://github.com/pytorch/torchrec#readme
有关PyTorch的安装
Torchrec需要Python >= 3.7和CUDA >= 11.0(强烈推荐CUDA以提高性能,但不是必需的)。下面的示例展示了如何使用CUDA 11.6进行安装。这个设置假定您已经安装了conda。
在Linux上运行Python 3.7、3.8和3.9的实验性二进制文件可以通过pip轮子安装。
TO use the library without cuda, use the *-cpu fbgemm installations. However, this will be much slower than the CUDA variant.
Nightly
conda install pytorch pytorch-cuda=11.7 -c pytorch-nightly -c nvidia
pip install torchrec_nightly
Stable
conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia
pip install torchrec
If you have no CUDA device:
Nightly
pip uninstall fbgemm-gpu-nightly -y
pip install fbgemm-gpu-nightly-cpu
Stable
pip uninstall fbgemm-gpu -y
pip install fbgemm-gpu-cpu
在本教程中,我们介绍了主要的torchRec API,称为DistributedModelParallel,或DMP。与pytorch的DistributedDataParallel一样,DMP包装了一个模型以支持分布式训练。
TorchRec API
Contents: