Torchrec 은 대규모 추천 시스템 (RESYS)에 필요한 일반적인 희소성 및 평행주의 프리미티브를 제공하기 위해 구축 된 Pytorch 도메인 라이브러리입니다. Torchrec은 많은 GPU를 가로 질러 깎은 큰 임베딩 테이블을 갖춘 모델의 훈련 및 추론을 허용하고 Meta의 많은 생산 모델을 강조합니다 .
Torchrec은 권장 시스템의 발전을 가속화하는 데 사용되었습니다.
Torchrec에 대한 학습을 시작하려면 다음을 확인하십시오.
Torchrec를 설정하는 권장 방법은 문서의 시작 섹션을 확인하십시오.
일반적으로 소스에서 구축 할 필요가 없습니다 . 대부분의 사용 사례의 경우 위의 섹션을 따라 Torchrec을 설정하십시오. 그러나 소스에서 구축하고 최신 변경 사항을 얻으려면 다음을 수행하십시오.
Pytorch를 설치하십시오. Pytorch 문서를 참조하십시오.
CUDA 12.4
pip install torch --index-url https://download.pytorch.org/whl/nightly/cu124
CUDA 12.1
pip install torch --index-url https://download.pytorch.org/whl/nightly/cu121
CUDA 11.8
pip install torch --index-url https://download.pytorch.org/whl/nightly/cu118
CPU
pip install torch --index-url https://download.pytorch.org/whl/nightly/cpu
클론 토르크렉.
git clone --recursive https://github.com/pytorch/torchrec
cd torchrec
FBGEMM을 설치하십시오.
CUDA 12.4
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cu124
CUDA 12.1
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cu121
CUDA 11.8
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cu118
CPU
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cpu
다른 요구 사항을 설치하십시오.
pip install -r requirements.txt
Torchrec을 설치하십시오.
python setup.py install develop
설치를 테스트하십시오 (Torchx-Nightly 사용 3.11에 사용하십시오. 3.12의 경우 Torchx는 현재 작동하지 않습니다).
GPU mode
torchx run -s local_cwd dist.ddp -j 1x2 --gpu 2 --script test_installation.py
CPU Mode
torchx run -s local_cwd dist.ddp -j 1x2 --script test_installation.py -- --cpu_only
분산 및 원격 작업 시작에 대한 자세한 내용은 Torchx를 참조하십시오.
더 복잡한 예를 실행하려면 Torchrec DLRM 예제를 살펴보십시오.
Torchrec에 대한 기여에 대한 자세한 내용은 Contributing.md를 참조하십시오!
Torchrec을 사용하는 경우 Bibtex 항목을 참조 하여이 작업을 인용하십시오.
@inproceedings{10.1145/3523227.3547387,
author = {Ivchenko, Dmytro and Van Der Staay, Dennis and Taylor, Colin and Liu, Xing and Feng, Will and Kindi, Rahul and Sudarshan, Anirudh and Sefati, Shahin},
title = {TorchRec: a PyTorch Domain Library for Recommendation Systems},
year = {2022},
isbn = {9781450392785},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3523227.3547387},
doi = {10.1145/3523227.3547387},
abstract = {Recommendation Systems (RecSys) comprise a large footprint of production-deployed AI today. The neural network-based recommender systems differ from deep learning models in other domains in using high-cardinality categorical sparse features that require large embedding tables to be trained. In this talk we introduce TorchRec, a PyTorch domain library for Recommendation Systems. This new library provides common sparsity and parallelism primitives, enabling researchers to build state-of-the-art personalization models and deploy them in production. In this talk we cover the building blocks of the TorchRec library including modeling primitives such as embedding bags and jagged tensors, optimized recommender system kernels powered by FBGEMM, a flexible sharder that supports a veriety of strategies for partitioning embedding tables, a planner that automatically generates optimized and performant sharding plans, support for GPU inference and common modeling modules for building recommender system models. TorchRec library is currently used to train large-scale recommender models at Meta. We will present how TorchRec helped Meta’s recommender system platform to transition from CPU asynchronous training to accelerator-based full-sync training.},
booktitle = {Proceedings of the 16th ACM Conference on Recommender Systems},
pages = {482–483},
numpages = {2},
keywords = {information retrieval, recommender systems},
location = {Seattle, WA, USA},
series = {RecSys '22}
}
Torchrec은 라이센스 파일에있는대로 BSD 라이센스가 부여됩니다.