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

Formula for optimal matrix block-size #75

Open
ParticularMiner opened this issue Nov 19, 2021 · 0 comments
Open

Formula for optimal matrix block-size #75

ParticularMiner opened this issue Nov 19, 2021 · 0 comments

Comments

@ParticularMiner
Copy link
Contributor

Hi @Bergvca

I think that the optimal matrix block-size, or the maximum number of strings Nmax for the master Series (beyond which cache-misses begin to dominate the computation and thus lead to computational slowdown) would be directly proportional to the CPU cache-size MCPU and inversely proportional to the density ρright of the right operand-matrix encoding the strings in master. That is,
Nmax  ∝  MCPU / ρright .

Since for my computer, Nmax = 8 × 104, MCPU = 6MB and ρright is a number I don't know yet but can easily find during runtime (that is, the number of nonzero matrix-elements divided by the total number of matrix-elements), we can then determine the constant of proportionality and use it to find Nmax for any other computer whose CPU cache-size is known or can be queried (using python package psutil, for example).

What do you think?

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