-
Notifications
You must be signed in to change notification settings - Fork 311
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
RandomX v2 virtual machine changes #274
base: master
Are you sure you want to change the base?
Conversation
* CFROUND becomes conditional with a 1/16 chance of writing into fprc * F and E registers are mixed together with AES instead of XOR
Tested on Ryzen 7 1700 (Zen 1) with 2 threads running on the same core:
Summary for those who didn't read discussions on IRC:
|
RandomX V2 tests ./randomx-benchmark --mine --jit --largePages --threads 2 --affinity 3 --init 16 cd .. ./randomx-benchmark --mine --jit --largePages --threads 2 --affinity 3 --init 16 threadripper 3970x New: 5900x New 3900x New model name : Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz New model name : Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz New |
Ryzen 7 1700 in single thread mode: old 664.3 h/s, new 736.2 h/s. |
model name : Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (this time Unthrottled) Old New: --mine --jit --largePages --threads 1 --affinity 1 --init 16 Single thread: Old: New: model name : Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz New: Per @SChernykh suggestion, ran tests 5 times and picked highest: New |
I implemented software AES support in the JIT compiler. To test with software AES, the following line needs to be changed: Line 125 in 356b9ff
Measured with Ryzen 3700X: Old: 15.2843 ms per hash (Ran 5x and took the lowest result.) So it seems there is a 10-11% performance hit for soft AES systems when doing light verification. |
Ryzen 9 7950X: Old 1635 h/s And no measurable hashrate difference with and without AES tweak. |
@tevador Do you need help with aarch64? I can do it because I wrote that code originally, so I'm more familiar with it. |
Yes, it would be great if you could do the changes in the ARM64 JIT. But please wait, I realized the JitCompiler interface needs to be changed because the class cannot be a template. I'm working on a solution that would not cause cascading changes to other classes and it's a bit tricky. But I think updating the ARM assembly code should be safe for you to do now. |
Yes, I will only implement CFROUND and AES changes for A64 JIT compiler. |
@tevador My WIP is here: https://github.com/SChernykh/RandomX/commits/v2 |
macOS ARM v2: 445.702 hashes per second |
@selsta can you run each test multiple times and take the highest number for v1 and v2? ARM CPUs never run at the same speed in most devices because of power saving. |
I did run it multiple times, while there was some variation v2 was always faster by around 15-20h/s. |
Hmm, that's interesting. So Apple silicon also gets a boost (but only 5%). Is it Apple M1 or M2? |
M1 Pro (8 performance cores, 2 efficiency cores) |
@tevador aarch64 is ready to be added: https://github.com/SChernykh/RandomX/tree/v2 |
@tevador I squashed my commits, you can just cherry-pick SChernykh@67d1340 into your PR. |
I can't wait for the RandomX V2 ❤️ |
@tevador Do you plan to finish it soon? What is left to be done? |
@tevador thank you for your work on the previous and this new version of RandomX! We're working on decentralized cloud and plan to use RandomX for CPU capacity proof of every core of a capacity provider. Looks like RandomX is the only existing ASIC and GPU resistant solution for this task. We want to launch our network in the nearest future and kinda dependent on this PR. Are there any time estimates for it? How stable is it now and can you recommend to use it for at least x86? |
This PR is incomplete. Currently, only the X86 and portable versions work, hardware AES is needed with JIT and the changes are hardcoded. But it's enough to run some benchmarks.