Key takeaways
- TorchRec is an open source library introduced by Meta for building advanced recommendation systems under PyTorch.
- The library facilitates the creation of personalisation models using common sparsity and parallelism techniques.
- TorchRec includes optimised kernels and modelling primitives, enhancing the efficiency of large-scale recommendation systems.
- After two years of testing, TorchRec has successfully trained models with 1.25 million and 3 trillion parameters.
CEO Mark Zuckerberg has introduced TorchRec, an open source library for building state-of-the-art recommendation Systems under PyTorch, at Inside the Lab event. The new library provides common sparsity and parallelism primitives, enabling researchers to build state-of-the-art personalisation models and deploy them in production. It includes a scalable low-level modelling foundation alongside rich batteries-included modules.
Meta initially targeted“two-tower” architectures with separate submodules to learn representations of candidate items and the query or context. Input signals can be a mix of floating point “dense” features or high-cardinality categorical “sparse” features that require large embedding tables to be trained. Efficient training of such architectures involves combining data parallelism that replicates the “dense” part of computation and model parallelism that partitions large embedding tables across many nodes.
The library includes optimised Recommendation Systems kernels that run on FBGEMM, a high-performance kernel library, modelling primitives such as jagged tensors and embedding bags, to create multinodal models using model parallelism. The PyTorch team has released TorchRec after close to two years in testing.
TorchRec was used to train a model with 1.25 million parameters that went into production in January and a 3 trillion parameter model that is expected to go into production.
Spotted an error? Tell our editors. Read our editorial standards and corrections.




