datawhalechina/torch-rechub
A Lighting Pytorch Framework for Recommendation Models, Easy-to-use and Easy-to-extend.
What it solves
Torch-RecHub is a lightweight PyTorch framework designed to simplify the creation of production-grade recommender systems. It removes the engineering overhead of implementing complex recommendation algorithms from scratch, allowing developers to build and deploy models in just a few lines of code.
How it works
The framework provides a modular pipeline for recommendation tasks, including standardized data loading, training, and evaluation. It leverages PyTorch for hardware acceleration across various backends (CPU, NVIDIA CUDA, AMD ROCm, and Huawei Ascend NPU). The system is organized into specialized trainers for different tasks: CTRTrainer for ranking/CTR prediction, MatchTrainer for matching, and MTLTrainer for multi-task learning.
Who it’s for
It is intended for machine learning engineers and researchers who need to implement and test recommendation models quickly, as well as developers looking to deploy these models into production via ONNX export.
Highlights
- Extensive Model Library: Includes over 30 mainstream models across ranking (e.g., DeepFM, DIN), matching (e.g., DSSM, SASRec), multi-task (e.g., MMoE, PLE), and generative recommendation (e.g., HSTU, TIGER).
- Production-Ready Deployment: Supports one-click export to ONNX format for seamless integration into production environments.
- Broad Hardware Support: Compatible with multiple GPU architectures including NVIDIA, AMD, and Huawei Ascend.
- Big Data Integration: Supports PySpark-based data processing and integration with vector databases like FAISS and Milvus for retrieval serving.
- Experiment Tracking: Built-in integration with WandB, SwanLab, and TensorBoardX for visualization and monitoring.