Skip to content

Instantly share code, notes, and snippets.

@zhuhaozhe
Created May 6, 2024 06:34
Show Gist options
  • Save zhuhaozhe/79e842e0a6e25d6d7fa1e4598807272c to your computer and use it in GitHub Desktop.
Save zhuhaozhe/79e842e0a6e25d6d7fa1e4598807272c to your computer and use it in GitHub Desktop.
export LD_PRELOAD=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}/lib/libiomp5.so:${CONDA_PREFIX:-"$(dirname $(which conda))/../"}/lib/libjemalloc.so
export MALLOC_CONF="oversize_threshold:1,background_thread:true,metadata_thp:auto,dirty_decay_ms:-1,muzzy_decay_ms:-1"
export KMP_AFFINITY=granularity=fine,compact,1,0
export KMP_BLOCKTIME=1
export TENSOR_SIZE=262144
export NPARAM=4
export OMP_NUM_THREADS=1
echo "Tensor Size: $TENSOR_SIZE, Num Tensor $NPARAM, Num Threads: $OMP_NUM_THREADS"
numactl -C 1 -m 0 python adagrad.py
export TENSOR_SIZE=4194304
export NPARAM=32
export OMP_NUM_THREADS=32
echo "Tensor Size: $TENSOR_SIZE, Num Tensor $NPARAM, Num Threads: $OMP_NUM_THREADS"
numactl -C 0-31 -m 0 python adagrad.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment