Giter Club home page Giter Club logo

recom's Introduction

RECom

RECom is an ML compiler that aims to accelerate the expensive embedding column processing during the inference of deep recommendation models. It fuses massive embedding columns into a single kernel and maps each column into a separate threadblock on the GPU.

Currently, RECom is implemented as a TensorFlow add-on based on TensorFlow Addons using C++. We also utilize the SymEngine Library to perform symbolic expression computations to handle dynamic shapes.

Build RECom

We highly recommend building RECom in the docker nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04, as the compatibility of RECom has not been checked yet.

You should also prepare the following environments before building RECom:

  • Python 3.8

  • TensorFlow 2.6.2

  • Bazel 4.2.1 (bazelisk is recommended)

After preparing the environments, you should set some environment variables and run the configure.py to generate the .bazelrc:

export TF_NEED_CUDA="1"

# Set these if the below defaults are different on your system
export TF_CUDA_VERSION="11"
export TF_CUDNN_VERSION="8"
export CUDA_TOOLKIT_PATH="/usr/local/cuda"
export CUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu"

python ./configure.py

Then, you can start building the shared library of RECom:

bazel build //tensorflow_addons:librecom.so

Finally, you will find the target librecom.so in bazel-bin/tensorflow_addons.

Usage

You can use tf.load_op_library/TF_LoadLibrary in your Python/C++ inference scripts to load the TensorFlow addon of RECom without modifying any source codes of the models. Then, the models will be optimized automatically (warm-up required).

More details can be found in the examples folder.

Publication

[ASPLOS'24] RECom: A Compiler Approach to Accelerating Recommendation Model Inference with Massive Embedding Columns

Zaifeng Pan, Zhen Zheng, Feng Zhang, Ruofan Wu, Hao Liang, Dalin Wang, Xiafei Qiu, Junjie Bai, Wei Lin, Xiaoyong Du

recom's People

Contributors

jamesthez avatar panzaifeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.