Torchrec เป็นไลบรารีโดเมน Pytorch ที่สร้างขึ้นเพื่อให้ความเป็นปึกแผ่นและความขนานกันทั่วไปที่จำเป็นสำหรับระบบผู้แนะนำขนาดใหญ่ (RECSYS) 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
โคลน Torchrec
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-Nighthing สำหรับ 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
ดูการสนับสนุน. MD สำหรับรายละเอียดเกี่ยวกับการมีส่วนร่วมใน Torchrec!
หากคุณใช้ 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 ตามที่พบในไฟล์ใบอนุญาต