Skip to content

Commit

Permalink
Disable KMP_AFFINITY as it causes all threads to run on a single core. (
Browse files Browse the repository at this point in the history
  • Loading branch information
veritas9872 authored Aug 1, 2023
1 parent 17a1362 commit 7f50ff0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ FROM train-adduser-${ADD_USER} AS train
# Intel OpenMP thread blocking time in ms.
ENV KMP_BLOCKTIME=0
# Configure CPU thread affinity.
ENV KMP_AFFINITY="granularity=fine,compact,1,0"
# ENV KMP_AFFINITY="granularity=fine,compact,1,0"
ENV LD_PRELOAD=/opt/conda/lib/libiomp5.so:${LD_PRELOAD}

# Enable Intel MKL optimizations on AMD CPUs.
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/hub.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN echo 'int mkl_serv_intel_cpu_true() {return 1;}' > /opt/conda/fakeintel.c &&
ENV LD_PRELOAD=/opt/conda/libfakeintel.so:${LD_PRELOAD}

ENV KMP_BLOCKTIME=0
ENV KMP_AFFINITY="granularity=fine,compact,1,0"
# ENV KMP_AFFINITY="granularity=fine,compact,1,0"
ENV LD_PRELOAD=/opt/conda/lib/libiomp5.so:${LD_PRELOAD}

# Jemalloc configurations.
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/ngc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ COPY --link --from=install-conda /opt/conda /opt/conda
FROM train-adduser-${ADD_USER} AS train

ENV KMP_BLOCKTIME=0
ENV KMP_AFFINITY="granularity=fine,compact,1,0"
# ENV KMP_AFFINITY="granularity=fine,compact,1,0"
# Use `/opt/conda/lib/libiomp5.so` for older NGC images using `conda`.
# Using the older system MKL to prevent version clashes with NGC packages.
ENV LD_PRELOAD=/usr/local/lib/libiomp5.so:${LD_PRELOAD}
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/simple.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ FROM train-adduser-${ADD_USER} AS train
# Use Intel OpenMP with optimizations. See the documentation for details.
# https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/performance_tuning/tuning_guide.html
ENV KMP_BLOCKTIME=0
ENV KMP_AFFINITY="granularity=fine,compact,1,0"
# ENV KMP_AFFINITY="granularity=fine,compact,1,0"
ENV LD_PRELOAD=/opt/conda/lib/libiomp5.so:${LD_PRELOAD}

# Enable Intel MKL optimizations on AMD CPUs.
Expand Down

0 comments on commit 7f50ff0

Please sign in to comment.