Skip to content

Commit a41e1a4

Browse files
PaulZhang12facebook-github-bot
authored andcommitted
README (pytorch#2469)
Summary: Pull Request resolved: pytorch#2469 Revamp OSS README for stable release Reviewed By: sarckk, iamzainhuda Differential Revision: D63856853 fbshipit-source-id: 2d834cdb58f9faa6f3f604a0057e1a1d5f6bf143
1 parent 558afe2 commit a41e1a4

File tree

2 files changed

+61
-66
lines changed

2 files changed

+61
-66
lines changed

README.MD

+46-61
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,41 @@
1-
# TorchRec (Beta Release)
2-
[Docs](https://pytorch.org/torchrec/)
1+
# TorchRec
32

4-
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.
3+
**TorchRec** is a PyTorch domain library built to provide common sparsity and parallelism primitives needed for large-scale recommender systems (RecSys). TorchRec allows training and inference of models with large embedding tables sharded across many GPUs and **powers many production RecSys models at Meta**.
54

6-
## TorchRec contains:
7-
- Parallelism primitives that enable easy authoring of large, performant multi-device/multi-node models using hybrid data-parallelism/model-parallelism.
8-
- The TorchRec sharder can shard embedding tables with different sharding strategies including data-parallel, table-wise, row-wise, table-wise-row-wise, column-wise, table-wise-column-wise sharding.
9-
- The TorchRec planner can automatically generate optimized sharding plans for models.
10-
- Pipelined training overlaps dataloading device transfer (copy to GPU), inter-device communications (input_dist), and computation (forward, backward) for increased performance.
11-
- Optimized kernels for RecSys powered by FBGEMM.
12-
- Quantization support for reduced precision training and inference.
13-
- Common modules for RecSys.
14-
- Production-proven model architectures for RecSys.
15-
- RecSys datasets (criteo click logs and movielens)
16-
- Examples of end-to-end training such the dlrm event prediction model trained on criteo click logs dataset.
17-
18-
# Installation
19-
20-
Torchrec requires Python >= 3.8 and CUDA >= 11.8 (CUDA is highly recommended for performance but not required). The example below shows how to install with Python 3.8 and CUDA 12.1. This setup assumes you have conda installed.
21-
22-
## Binaries
23-
24-
Experimental binary on Linux for Python 3.8, 3.9, 3.10, 3.11 and 3.12 (experimental), and CPU, CUDA 11.8 and CUDA 12.1 can be installed via pip wheels from [download.pytorch.org](download.pytorch.org) and PyPI (only for CUDA 12.1).
25-
26-
Below we show installations for CUDA 12.1 as an example. For CPU or CUDA 11.8, swap "cu121" for "cpu" or "cu118".
27-
28-
### Installations
29-
```
30-
Nightly
5+
## External Presence
6+
TorchRec has been used to accelerate advancements in recommendation systems, some examples:
7+
* [Latest version of Meta's DLRM (Deep Learning Recommendation Model)](https://github.com/facebookresearch/dlrm) is built using TorchRec
8+
* [Disaggregated Multi-Tower: Topology-aware Modeling Technique for Efficient Large-Scale Recommendation](https://arxiv.org/abs/2403.00877) paper
9+
* [The Algorithm ML](https://github.com/twitter/the-algorithm-ml) from Twitter
10+
* [Training Recommendation Models with Databricks](https://docs.databricks.com/en/machine-learning/train-recommender-models.html)
3111

32-
pip install torch --index-url https://download.pytorch.org/whl/nightly/cu121
33-
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cu121
34-
pip install torchmetrics==1.0.3
35-
pip install torchrec --index-url https://download.pytorch.org/whl/nightly/cu121
3612

37-
Stable via pytorch.org
13+
## Introduction
3814

39-
pip install torch --index-url https://download.pytorch.org/whl/cu121
40-
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/cu121
41-
pip install torchmetrics==1.0.3
42-
pip install torchrec --index-url https://download.pytorch.org/whl/cu121
15+
To begin learning about TorchRec, check out:
16+
* Our complete [TorchRec Tutorial](https://pytorch.org/tutorials/intermediate/torchrec_intro_tutorial.html)
17+
* The [TorchRec documentation](https://pytorch.org/torchrec/) for an overview of TorchRec and API references
4318

44-
Stable via PyPI (only for CUDA 12.1)
4519

46-
pip install torch
47-
pip install fbgemm-gpu
48-
pip install torchrec
20+
### TorchRec Features
21+
- Parallelism primitives that enable easy authoring of large, performant multi-device/multi-node models using hybrid data-parallelism/model-parallelism.
22+
- Sharders to shard embedding tables with different strategies including data-parallel, table-wise, row-wise, table-wise-row-wise, column-wise, and table-wise-column-wise sharding.
23+
- Planner that can automatically generate optimized sharding plans for models.
24+
- Pipelined training overlapping dataloading device transfer (copy to GPU), inter-device communications (input_dist), and computation (forward, backward) for increased performance.
25+
- Optimized kernels for RecSys powered by [FBGEMM](https://github.com/pytorch/FBGEMM/tree/main).
26+
- Quantization support for reduced precision training and inference, along with optimizing a TorchRec model for C++ inference.
27+
- Common modules for RecSys.
28+
- RecSys datasets (criteo click logs and movielens)
29+
- Examples of end-to-end training such the dlrm event prediction model trained on criteo click logs dataset.
4930

50-
```
5131

32+
## Installation
5233

53-
### Colab example: introduction + install
54-
See our colab notebook for an introduction to torchrec which includes runnable installation.
55-
- [Tutorial Source](https://github.com/pytorch/torchrec/blob/main/Torchrec_Introduction.ipynb)
56-
- Open in [Google Colab](https://colab.research.google.com/github/pytorch/torchrec/blob/main/Torchrec_Introduction.ipynb)
34+
Check out the [Getting Started](https://pytorch.org/torchrec/setup-torchrec.html) section in the documentation for recommended ways to set up Torchrec.
5735

58-
## From Source
36+
### From Source
5937

60-
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 12.1. This setup assumes you have conda installed.
38+
**Generally, there isn't a need to build from source**. For most use cases, follow the section above to set up TorchRec. However, to build from source and to get the latest changes, do the following:
6139

6240
1. Install pytorch. See [pytorch documentation](https://pytorch.org/get-started/locally/).
6341
```
@@ -121,23 +99,30 @@ We are currently iterating on the setup experience. For now, we provide manual i
12199

122100
## Contributing
123101

124-
### Pyre and linting
102+
See [CONTRIBUTING.md](https://github.com/pytorch/torchrec/blob/main/CONTRIBUTING.md) for details about contributing to TorchRec!
125103

126-
Before landing, please make sure that pyre and linting look okay. To run our linters, you will need to
127-
```
128-
pip install pre-commit
129-
```
104+
## Citation
130105

131-
, and run it.
132-
133-
For Pyre, you will need to
106+
If you're using TorchRec, please refer to BibTeX entry to cite this work:
134107
```
135-
cat .pyre_configuration
136-
pip install pyre-check-nightly==<VERSION FROM CONFIG>
137-
pyre check
108+
@inproceedings{10.1145/3523227.3547387,
109+
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},
110+
title = {TorchRec: a PyTorch Domain Library for Recommendation Systems},
111+
year = {2022},
112+
isbn = {9781450392785},
113+
publisher = {Association for Computing Machinery},
114+
address = {New York, NY, USA},
115+
url = {https://doi.org/10.1145/3523227.3547387},
116+
doi = {10.1145/3523227.3547387},
117+
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.},
118+
booktitle = {Proceedings of the 16th ACM Conference on Recommender Systems},
119+
pages = {482–483},
120+
numpages = {2},
121+
keywords = {information retrieval, recommender systems},
122+
location = {Seattle, WA, USA},
123+
series = {RecSys '22}
124+
}
138125
```
139126

140-
We will also check for these issues in our GitHub actions.
141-
142127
## License
143128
TorchRec is BSD licensed, as found in the [LICENSE](LICENSE) file.

setup.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,34 @@ def main(argv: List[str]) -> None:
8787
version=version,
8888
author="TorchRec Team",
8989
author_email="[email protected]",
90-
description="Pytorch domain library for recommendation systems",
90+
maintainer="PaulZhang12",
91+
maintainer_email="[email protected]",
92+
description="TorchRec: Pytorch library for recommendation systems",
9193
long_description=readme,
9294
long_description_content_type="text/markdown",
9395
url="https://github.com/pytorch/torchrec",
9496
license="BSD-3",
95-
keywords=["pytorch", "recommendation systems", "sharding"],
96-
python_requires=">=3.8",
97+
keywords=[
98+
"pytorch",
99+
"recommendation systems",
100+
"sharding",
101+
"distributed training",
102+
],
103+
python_requires=">=3.9",
97104
install_requires=install_requires,
98105
packages=packages,
99106
zip_safe=False,
100107
# PyPI package information.
101108
classifiers=[
102-
"Development Status :: 4 - Beta",
109+
"Development Status :: 5 - Stable",
103110
"Intended Audience :: Developers",
104111
"Intended Audience :: Science/Research",
105112
"License :: OSI Approved :: BSD License",
106113
"Programming Language :: Python :: 3",
107-
"Programming Language :: Python :: 3.8",
114+
"Programming Language :: Python :: 3.9",
115+
"Programming Language :: Python :: 3.10",
116+
"Programming Language :: Python :: 3.11",
117+
"Programming Language :: Python :: 3.12",
108118
"Topic :: Scientific/Engineering :: Artificial Intelligence",
109119
],
110120
)

0 commit comments

Comments
 (0)