Skip to content

Commit

Permalink
better blas loging & debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Feb 15, 2023
1 parent bab7293 commit 32209c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ We generally find the best performance using MKL with TBB throughout the stack.
LensKit's Numba-accelerated code and MKL are using TBB, they will coordinate their
thread pools to coordinate threading levels.

If you are **not** using TBB, we recommend setting ``MKL_NUM_THREADS=1`` to turn off MKL's
threading. When LensKit starts (usually at model training time), it will check your
runtime environment and log warning messages if it detects problems.
If you are **not** using MKL with TBB, we recommend setting ``MKL_NUM_THREADS=1`` and/or
``OPENBLAS_NUM_THREADS=1`` (depending on your BLAS implementation) to turn off
BLAS threading. When LensKit starts (usually at model training time), it will
check your runtime environment and log warning messages if it detects problems.

Controlling Parallelism
-----------------------
Expand Down
2 changes: 2 additions & 0 deletions lenskit/util/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def check_env():
_already_checked = True
return

_log.info('Using BLAS %s', blas.impl)

if numba.threading != 'tbb':
_log.warning('Numba is using threading layer %s - consider TBB', numba.threading)
_log.info('Non-TBB threading is often slower and can cause crashes')
Expand Down

0 comments on commit 32209c2

Please sign in to comment.