Torchrec

Pytorch domain library for recommendation systems
Alternatives To Torchrec
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
D2l En18,967
21 days ago2November 13, 202295otherPython
Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 500 universities from 70 countries including Stanford, MIT, Harvard, and Cambridge.
Deeplearningexamples11,463
6 days ago279Jupyter Notebook
State-of-the-Art Deep Learning scripts organized by models - easy to train and deploy with reproducible accuracy and performance on enterprise-grade infrastructure.
Catalyst3,15119132 months ago108April 29, 20226apache-2.0Python
Accelerated deep learning R&D
Recbole2,8342a day ago9February 25, 2022160mitPython
A unified, comprehensive and efficient recommendation library
Spotlight2,809
9 months ago72mitPython
Deep recommender models using PyTorch.
Torchrec1,531114 hours ago352August 20, 2023131bsd-3-clausePython
Pytorch domain library for recommendation systems
Transformers4rec900
17 days ago9June 16, 202272apache-2.0Python
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.
Fuxictr571
2 months ago8July 03, 20223apache-2.0Python
A configurable, tunable, and reproducible library for CTR prediction https://fuxictr.github.io/tutorials
Daisyrec496
6 months ago15August 14, 2022mitPython
This is the repository of our article published in RecSys 2020 "Are We Evaluating Rigorously? Benchmarking Recommendation for Reproducible Evaluation and Fair Comparison" and of several follow-up studies.
Crslab397
4 months ago2March 28, 20216mitPython
CRSLab is an open-source toolkit for building Conversational Recommender System (CRS).
Alternatives To Torchrec
Select To Compare


Alternative Project Comparisons
Readme

TorchRec (Beta Release)

Docs

TorchRec is a PyTorch domain library built to provide common sparsity & parallelism primitives needed for large-scale recommender systems (RecSys). It allows authors to train models with large embedding tables sharded across many GPUs.

TorchRec contains:

  • Parallelism primitives that enable easy authoring of large, performant multi-device/multi-node models using hybrid data-parallelism/model-parallelism.
  • The TorchRec sharder can shard embedding tables with different sharding strategies including data-parallel, table-wise, row-wise, table-wise-row-wise, and column-wise sharding.
  • The TorchRec planner can automatically generate optimized sharding plans for models.
  • Pipelined training overlaps dataloading device transfer (copy to GPU), inter-device communications (input_dist), and computation (forward, backward) for increased performance.
  • Optimized kernels for RecSys powered by FBGEMM.
  • Quantization support for reduced precision training and inference.
  • Common modules for RecSys.
  • Production-proven model architectures for RecSys.
  • RecSys datasets (criteo click logs and movielens)
  • Examples of end-to-end training such the dlrm event prediction model trained on criteo click logs dataset.

Installation

Torchrec requires Python >= 3.7 and CUDA >= 11.0 (CUDA is highly recommended for performance but not required). The example below shows how to install with CUDA 11.8. This setup assumes you have conda installed.

Binaries

Experimental binary on Linux for Python 3.7, 3.8 and 3.9 can be installed via pip wheels

Installations

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.8 -c pytorch-nightly -c nvidia
pip install torchrec_nightly

Stable

conda install pytorch pytorch-cuda=11.8 -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

Colab example: introduction + install

See our colab notebook for an introduction to torchrec which includes runnable installation. - Tutorial Source - Open in Google Colab

From Source

We are currently iterating on the setup experience. For now, we provide manual instructions on how to build from source. The example below shows how to install with CUDA 11.3. This setup assumes you have conda installed.

  1. Install pytorch. See pytorch documentation

    conda install pytorch pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
    
  2. Install Requirements

    pip install -r requirements.txt
    
  3. Download and install TorchRec.

    git clone --recursive https://github.com/pytorch/torchrec
    
    cd torchrec
    python setup.py install develop
    
  4. Test the installation.

    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
    

    See TorchX for more information on launching distributed and remote jobs.

  5. If you want to run a more complex example, please take a look at the torchrec DLRM example.

Contributing

Pyre and linting

Before landing, please make sure that pyre and linting look okay. To run our linters, you will need to

pip install pre-commit

, and run it.

For Pyre, you will need to

cat .pyre_configuration
pip install pyre-check-nightly==<VERSION FROM CONFIG>
pyre check

We will also check for these issues in our GitHub actions.

License

TorchRec is BSD licensed, as found in the LICENSE file.

Popular Pytorch Projects
Popular Recommendation System Projects
Popular Machine Learning Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Deep Learning
Pytorch
Gpu
Recommendation System
Sharding