Skip to content

Commit

Permalink
log intra-MKL memory use
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Aug 12, 2019
1 parent 1a48066 commit ed0f3e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lenskit/algorithms/item_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ def _mkl_similarities(self, rmat):
m_nbrs = self.save_nbrs
if m_nbrs is None or m_nbrs < 0:
m_nbrs = 0
s_blocks = _mkl_sim_blocks(rmat.transpose().N, self.min_sim, m_nbrs)
rmat = rmat.transpose()
_logger.debug('[%s] transposed, memory use %s', self._timer, util.max_memory())
s_blocks = _mkl_sim_blocks(rmat.N, self.min_sim, m_nbrs)
_logger.debug('[%s] computed blocks, memory use %s', self._timer, util.max_memory())
# blocks may be in any order, fix that
s_blocks.sort(key=lambda b: b[0])
s_blocks = [matrix.CSR(N=b) for (bi, b) in s_blocks]
Expand Down

0 comments on commit ed0f3e2

Please sign in to comment.