from multiprocessing import Pool

def f(row_id):
    return vstack(res_rows, 'csr')
if __name__ == '__main__':
    p = Pool(4)
p.map(f, range(m1.shape[0]))
Sparse matrix dot product keeping only N-max values per result row