-
-
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
Add Rust implementation of the micro benchmark #22433
Conversation
c48a90b
to
2025fb2
Compare
This is great. But I don't think it should require a nightly release of rust. That is not going to be reproducible. Can we wait until we have a release version that can be used for this purpose? |
@ViralBShah Hmm... The unstable There may be a way around this, however. Although it wouldn't behave exactly the same, I could wrap certain values in the code around a |
Now that I think of it, this wouldn't be a problem either, since we can instruct rustup to use a specific nightly toolchain (even by release date). |
- use ndarray crate for randmatstat and randmatmul by default - enable direct BLAS use with a cargo feature - provide rust-toolchain override file - fix trace calculation in randmatstat - other code refactors
2025fb2
to
a8ef082
Compare
Here's an update: Recent developments over the With that in mind, I have updated the Furthermore, since Rustup supports toolchain override files, I've added a file pointing to a recent nightly toolchain. So, the full process would be:
|
We generally want to move the performance benchmarks out of Julia Base. Thus closing this for now. |
If this was ready to merge, please let me know and I am happy to merge it. The hope is that we will move the whole cc @ararslan |
I have been keeping a fresh version of the implementation in its own repository, with updated dependencies and corrected output to the latest benchmark names. This branch might not have all changes yet, but refreshing it is a fairly easy task. |
IIRC, it was also using nightly versions of some packages. I'd say that if all the dependent packages are released versions, we can merge it. Maybe a new PR is required, since the Reopen button is greyed out here. |
Not really nightly versions of packages, just a nightly version of the compiler. 🙂 It is currently fixed to the version stated in the I can make another PR, but please let me know if you'd still like the code to be compatible with a stable Rust toolchain. |
I wrote a Rust implementation of the micro benchmark not long ago (repo), and was recommended to include it here with the others.
Although the program is based on the C implementation in "perf.c", it's composed of idiomatic Rust and does not have unsafe code blocks. As for relevant implementation details:
randmatstat
andrandmatmul
benchmarks have two modes. By default, they will usendarray
, a library analogous tonumpy
, which provides experimental support for BLAS in some operations. The program can be compiled to use theblas
crate instead, which may be slightly faster but is not as idiomatic and requires unsafe code blocks.mersenne_twister
crate.The necessary preparation steps for the benchmark machine:
rust-toolchain
file:rustup toolchain add nightly-2017-10-28
At this point,
make benchmark/rust.csv
should work fine.The performance measurements from my machine can be seen on this graph. Still, it would be great to have it measured alongside the other languages in your system. Please let me know of necessary changes or questions about the code.