This directory contains the artifact of the ASPLOS'23 paper GRACE: A Scalable Graph-Based Approach to Accelerating Recommendation Model Inference.
If you find this repo useful, please cite the following paper:
@inproceedings{ye2023grace,
title={GRACE: A Scalable Graph-Based Approach to Accelerating Recommendation Model Inference},
author={Ye, Haojie and Vedula, Sanketh and Chen, Yuhan and Yang, Yichen and Bronstein, Alex and Mudge, Trevor and Dreslinski, Ronald and Talati, Nishil},
booktitle={Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3)},
pages={},
year={2023}
}
g++ (9.4.0 preferred), cmake, python3 (Python 3.9 preferred)
git clone https://github.com/Linestro/GRACE.git
cd GRACE
pip3 install -r requirement.txt
git clone https://github.com/SNU-ARC/MERCI.git
mkdir -p bin/
mkdir -p gapbs/bin/
mkdir -p gapbs/cluster/
mkdir -p dataset/anime
mkdir -p dataset/clothes
mkdir -p dataset/dblp
mkdir -p dataset/movie
mkdir -p dataset/office
mkdir -p dataset/sports
mkdir -p dataset/steam
mkdir -p dataset/twitch
export HOME=$(pwd)
cd MERCI
mkdir -p data/1_raw_data/dblp
mkdir -p data/1_raw_data/amazon
mkdir -p data/2_transactions/
mkdir -p data/3_train_test/
mkdir -p data/4_filtered/amazon_Office_Products
mkdir -p data/4_filtered/amazon_Clothing_Shoes_and_Jewelry
mkdir -p data/4_filtered/amazon_Sports_and_Outdoors
cd data/1_raw_data/dblp;
wget https://nrvis.com/download/data/ca/ca-coauthors-dblp.zip
unzip ca-coauthors-dblp.zip
cd -
cd data/1_raw_data/amazon;
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/categoryFiles/Sports_and_Outdoors.json.gz
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/metaFiles2/meta_Sports_and_Outdoors.json.gz
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/categoryFiles/Office_Products.json.gz
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/metaFiles2/meta_Office_Products.json.gz
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/categoryFiles/Clothing_Shoes_and_Jewelry.json.gz
wget --no-check-certificate https://jmcauley.ucsd.edu/data/amazon_v2/metaFiles2/meta_Clothing_Shoes_and_Jewelry.json.gz
cd $HOME/MERCI/1_preprocess/scripts/
./lastfm_dblp.sh dblp
python3 amazon_parse_divide_filter.py Office_Products
python3 amazon_parse_divide_filter.py Clothing_Shoes_and_Jewelry
python3 amazon_parse_divide_filter.py Sports_and_Outdoors
cd $HOME/
python3 port_dataset.py dblp
python3 port_dataset.py amazon_Office_Products
python3 port_dataset.py amazon_Clothing_Shoes_and_Jewelry
python3 port_dataset.py amazon_Sports_and_Outdoors
mkdir -p $HOME/dataset/dblp
mkdir -p $HOME/dataset/office
mkdir -p $HOME/dataset/clothes
mkdir -p $HOME/dataset/sports
mv dblp_postprocess.csv dataset/dblp/
mv amazon_Office_Products_postprocess.csv dataset/office/
mv amazon_Clothing_Shoes_and_Jewelry_postprocess.csv dataset/clothes/
mv amazon_Sports_and_Outdoors_postprocess.csv dataset/sports/
cd $HOME/dataset/anime
Download from https://www.kaggle.com/datasets/CooperUnion/anime-recommendations-database?resource=download
cd -
cd $HOME/dataset/twitch
Download from https://drive.google.com/drive/folders/1BD8m7a8m7onaifZay05yYjaLxyVV40si
cd -
cd $HOME/dataset/movie
wget https://files.grouplens.org/datasets/movielens/ml-20m.zip
cd -
cd $HOME/dataset/steam
Download from https://drive.google.com/file/d/1pZxvHa3yLzIAE15TYDQI7G5qrI8rJab_/view
cd -
cd dataset
cd anime && unzip archive.zip && sed -i '1d' rating.csv && cd -
python3 dataset_preprocess.py -i anime/rating.csv
python3 dataset_preprocess.py -i twitch/100k_a.csv
cd movie && unzip ml-20m.zip && mv ml-20m/* . && rm -r ml-20m && sed -i '1d' ratings.csv && mv ratings.csv rating.csv && cd -
python3 dataset_preprocess.py -i movie/rating.csv
cd steam && gunzip australian_users_items.json.gz && cd -
python3 steam_preprocess.py -i steam/australian_users_items.json
cd $HOME
./run_group_clean_dataset.sh
./count_lines_in_dataset.sh # For dataset verification, check the output of the script against ./files.count
./run_merge_all.sh
./run_build_graph_all.sh
./run_group_reformat.sh
./Fig10_grace.sh
./Fig10_merci.sh
./Fig10_space.sh
Step 8: Reproduce memory access count for Metis (optional, running Metis needs a 256GB main memory machine)
sudo ./metis_installation.sh # make install metis needs sudo
./Fig10_metis.sh
Step 9: Reproduce Fig. 10 in the paper using the memory access count collected in steps 7 and 8 [1 minute]
cd Fig10_plot
python3 fig10.py
python3 fig10_without_Metis.py [if skip Metis]