Skip to content

Files

Latest commit

3c98353 · Aug 22, 2024

History

History

inference

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 1, 2024
Aug 22, 2024

Inference Benchmark

Environment setup

  1. Confirm that PyG is properly installed.
  2. Install dataset package:
    pip install ogb
  3. Install autoconf required for jemalloc setup:
    sudo apt-get install autoconf
  4. Install jemalloc for performance benchmark:
    cd ${workspace}
    git clone https://github.com/jemalloc/jemalloc.git
    cd jemalloc
    git checkout 5.2.1
    ./autogen.sh
    ./configure --prefix=${workspace}/jemalloc-bin
    make
    make install

Running benchmark

  1. Set environment variables:
    source activate env_name
    export DNNL_PRIMITIVE_CACHE_CAPACITY=1024
    export KMP_BLOCKTIME=1
    export KMP_AFFINITY=granularity=fine,compact,1,0
    
    jemalloc_lib=${workspace}/jemalloc-bin/lib/libjemalloc.so
    export LD_PRELOAD="$jemalloc_lib"
    export MALLOC_CONF="oversize_threshold:1,background_thread:true,metadata_thp:auto,dirty_decay_ms:9000000000,muzzy_decay_ms:9000000000"
  2. Core binding, e.g., single socket / single core / 4 cores per instance:
    OMP_NUM_THREADS=${CORES} numactl -C 0-${LAST_CORE} -m 0 CMD......
  3. Execute benchmarks, e.g.:
    python -u inference_benchmark.py --datasets=Reddit --models=gcn --eval-batch-sizes=512 --num-layers=2 --num-hidden-channels=64
    python -u inference_benchmark.py --datasets=Reddit --models=gcn --eval-batch-sizes=512 --num-layers=2 --num-hidden-channels=64 --use-sparse-tensor
    python -u inference_benchmark.py --datasets=ogbn-products --models=sage --eval-batch-sizes=512 --num-layers=2 --num-hidden-channels=64
    python -u inference_benchmark.py --datasets=ogbn-products --models=sage --eval-batch-sizes=512 --num-layers=2 --num-hidden-channels=64 --use-sparse-tensor