Skip to content

non homegenous GEMM_MULTITHREAD_THRESHOLD usage #742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeromerobert opened this issue Jan 15, 2016 · 6 comments
Closed

non homegenous GEMM_MULTITHREAD_THRESHOLD usage #742

jeromerobert opened this issue Jan 15, 2016 · 6 comments

Comments

@jeromerobert
Copy link
Contributor

In gemv.c GEMM_MULTITHREAD_THRESHOLD is squared so it's homogenous to a matrix size. In gemm.c it's not squared so it's homogeneous to a number of floating point operations

So there is no chance that changing GEMM_MULTITHREAD_THRESHOLD in Makefiles.rules would give good results for both gemm and gemv.

Shouldn't gemv.c be fixed so that is use GEMM_MULTITHREAD_THRESHOLD as a number of floating point operations ?

A possibly related bug is #216 .

@jeromerobert
Copy link
Contributor Author

As gemv.c, trsm.c also consider GEMM_MULTITHREAD_THRESHOLD as a matrix size.

@xianyi
Copy link
Collaborator

xianyi commented Jan 15, 2016

@jeromerobert , I think GEMM_MULTITHREAD_THRESHOLD of gemv.c is also a number of floating point operations since gemv is O(n^2).

Or, different threshold for different functions?

@jeromerobert
Copy link
Contributor Author

The gemv.c code is:

if ( MNK <= (24.0 * 24.0  * (double) (GEMM_MULTITHREAD_THRESHOLD*GEMM_MULTITHREAD_THRESHOLD) )  )

MNK is the number of floating point operation. But we compare to a_const * GEMM_MULTITHREAD_THRESHOLD * GEMM_MULTITHREAD_THRESHOLD while we should, IMHO, compare to a_const * GEMM_MULTITHREAD_THRESHOLD, as done in gemm.

Or, different threshold for different functions?

I'm not sure that's a good idea because that will make OpenBLAS very difficult to calibrate and maintain.

@jeromerobert
Copy link
Contributor Author

I think we need something like:

if(MNK <= 2304 * GEMM_MULTITHREAD_THRESHOLD)

which is equivalent when GEMM_MULTITHREAD_THRESHOLD = 4.

@jeromerobert
Copy link
Contributor Author

@wernsaar Could we have your feeling, as you are the author of gemv and trsm thresholding ?

@wernsaar
Copy link
Contributor

Yes, that's right.

On 01/17/2016 07:02 PM, Jerome Robert wrote:

@wernsaar https://github.com/wernsaar Could we have your feeling, as
you are the author of |gemv| and |trsm| thresholding ?


Reply to this email directly or view it on GitHub
#742 (comment).

@xianyi xianyi closed this as completed in 1fe3aab Jan 26, 2016
martin-frbg added a commit that referenced this issue Jun 15, 2018
…LD range (#1620)

* Allow choosing the OpenMP scheduler and add range hint for GEMM_MULTITHREAD_THRESHOLD
* Amended description of GEMM_MULTITHREAD_THRESHOLD
to reflect #742 making it track floating point operations rather than matrix size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants