From 30ee3ce7f562508c3efc0ccc5a54fa75b3847829 Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Mon, 1 Jul 2024 09:27:52 +0800 Subject: [PATCH] Adding intel openmp tunings do Docker file This patch adds more tunins for CPU backend on intel openmp. These tunings improves CPU backend performance greatly, especially on throughput related tests. Signed-off-by: Yuan Zhou --- Dockerfile.cpu | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile.cpu b/Dockerfile.cpu index 6e55203decc5..369381975dda 100644 --- a/Dockerfile.cpu +++ b/Dockerfile.cpu @@ -6,7 +6,16 @@ RUN apt-get update -y \ && apt-get install -y git wget vim numactl gcc-12 g++-12 python3 python3-pip libtcmalloc-minimal4 \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12 -RUN echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:$LD_PRELOAD' >> ~/.bashrc +RUN pip install accelerate mkl + +ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:/usr/local/lib/libiomp5.so:$LD_PRELOAD" + +ENV KMP_BLOCKTIME=1 +ENV KMP_TPAUSE=0 +ENV KMP_SETTINGS=1 +ENV KMP_FORKJOIN_BARRIER_PATTERN=dist,dist +ENV KMP_PLAIN_BARRIER_PATTERN=dist,dist +ENV KMP_REDUCTION_BARRIER_PATTERN=dist,dist RUN pip install https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_dev/cpu/intel_extension_for_pytorch-2.3.100%2Bgit0eb3473-cp310-cp310-linux_x86_64.whl