-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Faster JS implementation of rand_mat_mul. #4067
Conversation
A slightly tweaked rand_mat_mul function that uses B's transpose to improve sequential memory access during the multiplication. This speeds up the JS run and, I think, is a fairer comparison with other languages which call on custom routines to do the multiplication.
Do you have any number on what kind of impact this makes in JS? |
I get about 3x speed up on my MacBook Air when run in Node.js v0.8.17. Of course, the result can be expected to vary between machines. |
Faster JS implementation of rand_mat_mul.
Btw using Float64Array in the matmul function gives some extra speed up, but it is not much - only about 3%. |
If |
Not hard, but requires the 'ffi' and 'ref' npm modules to be installed. Here is some code that might do it - https://gist.github.com/srikumarks/6240337 I didn't send it in as a pull request because I'm not sure how the necessary npm installs will be done by julia's build system. I got some hilarious results when I tried it. Overall, the randmatmul test ran about 10x faster than the original benchmark (about 3x faster than the changed one I submitted). However, with the BLAS-based version, 90% of the time was being spent filling the matrices with random numbers :) |
The cost of random number generation really ought to be factored out of our microbenchmarks. The benchmarks don't really need to build on arbitrary systems, just our benchmarking system, so if you do have a patch that lets JavaScript call a BLAS, please do submit it and we can try to make it work. Speaking of which, we really need to run the benchmarks on our research machine and update the results. |
Best to update with the release 0.2 version, now that we are close enough. In general, the website needs a huge update as well. |
…5417c (#56437) Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: release-1.11 Julia branch: backports-release-1.11 Old commit: af1088b4e New commit: 2c625417c Julia version: 1.11.1 Pkg version: 1.11.0(Does not match) Bump invoked by: @IanButterworth Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/Pkg.jl@af1088b...2c62541 ``` $ git log --oneline af1088b4e..2c625417c 2c625417c Merge pull request #4072 from JuliaLang/backports-release-1.11 c3be33218 REPLExt: check for compliant repl mode during repl init (#4067) ```
Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: master Julia branch: master Old commit: 9f8e11a4c New commit: 7b759d7f0 Julia version: 1.12.0-DEV Pkg version: 1.12.0 Bump invoked by: @IanButterworth Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/Pkg.jl@9f8e11a...7b759d7 ``` $ git log --oneline 9f8e11a4c..7b759d7f0 7b759d7f0 Automatically upgrade empty manifest files to v2 format (#4091) 69c6de019 Remove duplicated word "different" (#4088) 87a4a9172 Actually switch to "Resolving Deltas" (#4080) ef844e32f Update CHANGELOG.md: link to [sources] PR (#4084) e10883ce5 REPLExt: check for compliant repl mode during repl init (#4067) ``` Co-authored-by: Dilum Aluthge <[email protected]>
A slightly tweaked rand_mat_mul function that uses B's transpose
to improve sequential memory access during the multiplication. This
speeds up the JS run and, I think, is a fairer comparison with
other languages which call on custom routines to do the multiplication.