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.
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
9 months ago72mitPython
Deep recommender models using PyTorch.
Torchrec1,531114 hours ago352August 20, 2023131bsd-3-clausePython
Pytorch domain library for recommendation systems
17 days ago9June 16, 202272apache-2.0Python
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.
2 months ago8July 03, 20223apache-2.0Python
A configurable, tunable, and reproducible library for CTR prediction
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.
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

TorchRec (Beta Release)


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.


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.


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


TO use the library without cuda, use the *-cpu fbgemm installations. However, this will be much slower than the CUDA variant.


conda install pytorch pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
pip install torchrec_nightly


conda install pytorch pytorch-cuda=11.8 -c pytorch -c nvidia
pip install torchrec

If you have no CUDA device:


pip uninstall fbgemm-gpu-nightly -y
pip install fbgemm-gpu-nightly-cpu


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
    cd torchrec
    python install develop
  4. Test the installation.

    GPU mode
    torchx run -s local_cwd dist.ddp -j 1x2 --gpu 2 --script
    CPU Mode
    torchx run -s local_cwd dist.ddp -j 1x2 --script -- --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.


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.


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.
Deep Learning
Recommendation System