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

Feature: gemmd product with 4th loop parallelization #536

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JerryMaoQC
Copy link

Summary:

  • Implement the gemmd product, which is gemm with a diagonal matrix of "weights" inserted in the middle. Formally, compute A * diag(d) * B for A (mxk), B (kxn), d (k).
  • Enable parallelization on the 4th loop (the PC loop), currently via OpenMP only.

Use case:

  • For matrices with large k and relatively smaller n and m, computing either of the intermediate products Ad or dB is "wasteful", since they both have a dimension of size k. This spends both time to calculate and memory to hold the large result. gemmd can compute the result without the overhead of evaluating the intermediate result.
  • We additionally parallelize the PC loop because this is the only loop over the k dimension. As gemmd is most useful when k is large, parallelizing this loop can have a major impact on performance in this use case.

JerryMaoQC and others added 3 commits August 27, 2021 21:43
Thanks so much to @fgvanzee for the help with this!

Co-authored-by: Field G. Van Zee <field@cs.utexas.edu>
Co-authored-by: Jerry Mao <j-mao@users.noreply.github.com>
Co-authored-by: Jerry Mao <j-mao@users.noreply.github.com>
@fgvanzee
Copy link
Member

Sorry for the delay in looking at this, @JerryMaoQC. I do aim to get to it soon.

@fgvanzee
Copy link
Member

fgvanzee commented Sep 2, 2021

@JerryMaoQC I noticed you chose the sandbox name gemmd. However, your operation is still called gemm (with APIs via bls_gemm(), bls_gemm_ex(), bls_?gemm()). Was this name (and the API names) chosen intentionally? If not, I'd be happy to help you change the filenames and function names.

@devinamatthews
Copy link
Member

@fgvanzee and @JerryMaoQC what is the impetus to include this in BLIS mainline?

@fgvanzee
Copy link
Member

fgvanzee commented Oct 4, 2021

@devinamatthews I suggested that @JerryMaoQC could submit it since there is no harm (that I could see) in having the extra sandbox directory there for posterity and in case others want to study and/or build on his work.

@devinamatthews
Copy link
Member

Sure. No objection I was just curious.

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

Successfully merging this pull request may close these issues.

None yet

3 participants