openwall / openwall/john

Have OpenCL auto-tune find optimal LWS that isn't a power of 2

Open
#4,696 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Experimenting with Bitcoin-opencl, I see that its optimal LWS for the old Titan Kepler is 384 (edit: or actually 768). However, auto-tune goes by powers of 2 and finds 512, resulting in worse speeds and higher GWS. While these specific GPUs don't matter much anymore, perhaps the issue could also be relevant to other/future devices. Perhaps we can do better by parsing device info? We do have 192 right here:

    Device #2 (6) name:     GeForce GTX TITAN
[...]
    Parallel compute cores: 14
    CUDA cores:             2688  (14 x 192)

Auto-tune:

LWS=512 GWS=21504 (42 blocks) DONE
Speed for cost 1 (iteration count) of 200460
Raw:    1137 c/s real, 1137 c/s virtual, Dev#6 util: 100%

Manual LWS=384:

LWS=384 GWS=10752 (28 blocks) DONE
Speed for cost 1 (iteration count) of 200460
Raw:    1259 c/s real, 1256 c/s virtual, Dev#6 util: 100%

Edit: for comparison, hashcat -b -m 11300 -w4:

Hashmode: 11300 - Bitcoin/Litecoin wallet.dat (Iterations: 200459)

Speed.#3.........:     1397 H/s (418.09ms) @ Accel:16 Loops:512 Thr:1024 Vec:1

This made me try further, and I got this:

LWS=768 GWS=10752 (14 blocks) DONE
Speed for cost 1 (iteration count) of 200460
Raw:    1369 c/s real, 1371 c/s virtual, Dev#6 util: 100%

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the OpenCL auto-tune path that currently tests powers of two, and inspect the device information exposing parallel compute cores and CUDA cores. Compare candidate LWS values with the reported non-power-of-two cases, 384 and 768. Done means auto-tune can select a faster non-power-of-two LWS without regressing other devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.