Skip to content
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

Emulate Blas Interface #3

Open
JaredCrean2 opened this issue Oct 11, 2018 · 1 comment
Open

Emulate Blas Interface #3

JaredCrean2 opened this issue Oct 11, 2018 · 1 comment

Comments

@JaredCrean2
Copy link
Contributor

We should emulate the Blas interface for the smallmatvec and smallmatmat functions. Currently we don't have the alpha and beta coefficients. This is a bit annoying for reverse mode, where we often want to update, not overwrite, the output vector.

Source code here.

@JaredCrean2
Copy link
Contributor Author

I figured out why I didn't add the alpha and beta parameters initially. The Julia generic matrix-vector and matrix-matrix multiplication function doesn't accept them either. See the signature here. The hierarchy is:

  • smallmatvec
    • call smallmatvec_kernel! if matrix is small enough
    • call A_mul_B otherwise
      • Call BLAS if possible, doing some some conversion trick for complex valued matrices
      • Call Julia generic algorithm otherwise (matrices that don't appear to be strided in a way that BLAS an accept, or element types that are not supported by BLAS)

We could create a replacement for A_mul_B that also accepts the alpha and beta parameters, but that would require re-implementing the logic inside A_mul_B that sorts out what kinds of matrices can be passed to BLAS or not.

In the interim, I added the alpha and beta parameters to the matrix-matrix multiplication kernels (because I need those for what I am currently working on), and exported them.

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

1 participant