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

Hardware acceleration for matrix operations #1788

Closed
jarble opened this issue Mar 27, 2020 · 5 comments
Closed

Hardware acceleration for matrix operations #1788

jarble opened this issue Mar 27, 2020 · 5 comments
Labels

Comments

@jarble
Copy link

jarble commented Mar 27, 2020

To improve the efficiency of matrix operations, MathJS could run some of these operations on the GPU instead of the CPU. This could be useful when adding, subtracting, or multiplying very large matrices.

Would it be possible to do this using a hardware acceleration library like GPU.js?

@josdejong
Copy link
Owner

Thanks for your suggestion @jarble . Hardware acceleration would be cool, but I expect that this is too specific to easily integrate with mathjs. I have the feeling that to make that work, you have to start from the GPU and build an API from there (lie GPU.js), instead of the other way around. I may be mistaken though. So a challenge here: if someone has a concrete idea of how this would/could work out, let's keep this issue open.

@idris-aitmoulay
Copy link

I suggested to run arithmetic code into a Web Worker ?

https://developer.mozilla.org/fr/docs/Web/API/Web_Workers_API/Utilisation_des_web_workers.

@josdejong
Copy link
Owner

Yes, that's always a possibility :)

@mightypenguin
Copy link

Webworkers are a good start, they let you run multiple threads of logic at the same time.
But I still think that that we'd see massive improvement and usage by allowing even a subset of operations to use another library like GPU.js.
Probably would require a trade study example of some kind to see what the wins are.

The main issue I see is that if math.js doesn't GPU accel, than another project will, and it will probably get most of the potential user base of math.js.

Probably most of the people needing to do serious math will need/want accel.

  1. Webworkers (first / easiest step to improve performance)
  2. GPU ( holy grail )

@gwhitney
Copy link
Collaborator

gwhitney commented Oct 6, 2023

Duplicate of #2702. Closing this -- please hold further discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants