README.md

May 19, 2026 ยท View on GitHub

TorchEasyRec

A PyTorch-based recommendation system framework for production-ready deep learning models

License Unit Test Nightly Documentation Python GitHub Stars

What is TorchEasyRec?

TorchEasyRec implements state-of-the-art deep learning models for recommendation tasks: candidate generation (matching), scoring (ranking), multi-task learning, and generative recommendation. It enables efficient development of high-performance models through simple configuration and easy customization.

TorchEasyRec Framework

Key Features

Data Sources

  • MaxCompute/ODPS - Native Alibaba Cloud data warehouse integration
  • Parquet - High-performance columnar file format when using Local | OSS | NAS storage, with built-in auto-rebalancing capabilities
  • CSV - Standard tabular file format
  • Streaming - Kafka message queue integration, also compatible with Alibaba Datahub
  • Checkpointable - Resume training from exact data position

Scalability

  • Distributed Training - Hybrid data/model parallelism via TorchRec
  • Large Embeddings - Row-wise, column-wise, table-wise sharding
  • Zero-Collision Hash - Large scale Dynamic embedding with eviction policies (LFU/LRU)
  • Mixed Precision - FP16/BF16 training support

Production

  • Run Everywhere - Local, PAI-DLC, PAI-DSW
  • Feature Generation - Consistent FG between training and serving
  • EAS Deployment - Auto-scaling model serving on Alibaba Cloud
  • TensorRT/AOTInductor - Model acceleration for inference

Features & Models

  • 20+ Models - Battle-tested algorithms powering real-world recommendation: DSSM, TDM, DeepFM, DIN, MMoE, PLE, PEPNet, DLRM-HSTU and more
  • 10+ Feature Types - IdFeature, RawFeature, ComboFeature, LookupFeature, ExprFeature, SequenceFeature, CustomFeature, and more
  • Custom Model - Easy to implement customized models
  • Custom Feature - Easy to implement customized features

Supported Models

Matching (Candidate Generation)

ModelDescription
DSSMTwo-tower deep semantic matching model
MINDMulti-interest network with dynamic routing
TDMTree-based deep model for large-scale retrieval
DATDual augmented two-tower model

Ranking (Scoring)

ModelDescription
DeepFMFactorization-machine based neural network
WideAndDeepWide & Deep learning for recommendations
MultiTowerFlexible multi-tower architecture
DINDeep Interest Network with attention mechanism
DLRMDeep Learning Recommendation Model
DCNDeep & Cross Network
DCN-V2Improved Deep & Cross Network
MaskNetInstance-guided mask for feature interaction
xDeepFMCompressed interaction network
WuKongDense scaling with high-order interactions
RocketLaunchingKnowledge distillation framework

Multi-Task Learning

ModelDescription
MMoEMulti-gate Mixture-of-Experts
PLEProgressive Layered Extraction
DBMTLDeep Bayesian Multi-task Learning
PEPNetPersonalized Embedding and Parameter Network

Generative Recommendation

ModelDescription
DLRM-HSTUHierarchical Sequential Transduction Units
ULTRA-HSTUHSTU with Semi-Local Attention, Attention Truncation, and Mixture of Transducers
HSTU-MatchHSTU-based two-tower retrieval model

Documentation

Get started with TorchEasyRec in minutes:

TutorialDescription
Local TrainingTrain models on your local machine or single server
PAI-DLC TrainingDistributed training on Alibaba Cloud PAI-DLC
PAI-DLC + MaxCompute TableTrain with MaxCompute (ODPS) tables on PAI-DLC

For the complete documentation, please refer to https://torcheasyrec.readthedocs.io/

Community & Support

  • GitHub Issues - Report bugs or Request features

  • DingTalk Groups

    • DingDing Group: 32260796 - Join
    • DingDing Group2: 37930014162 - Join
    dingroup1 dingroup2
  • If you have any questions about how to use TorchEasyRec, please join the DingTalk group and contact us.

  • If you have enterprise service needs or need to purchase Alibaba Cloud services to build a recommendation system, please join the DingTalk group to contact us.

Contributing

Any contributions you make are greatly appreciated!

  • Please report bugs by submitting an issue
  • Please submit contributions using pull requests
  • Please refer to the Development Guide for more details

Citation

If you use TorchEasyRec in your research, please cite:

@software{torcheasyrec2024,
  title = {TorchEasyRec: An Easy-to-Use Framework for Recommendation},
  author = {Alibaba PAI Team},
  year = {2024},
  url = {https://github.com/alibaba/TorchEasyRec}
}

License

TorchEasyRec is released under Apache License 2.0. Please note that third-party libraries may not have the same license as TorchEasyRec.