Skip to content

CUDA: opt-in shared prestate and fused square experiment - #102

Draft
userInner wants to merge 1 commit into
Quantus-Network:mainfrom
userInner:perf/cuda-shared-square
Draft

userInner wants to merge 1 commit into
Quantus-Network:mainfrom
userInner:perf/cuda-shared-square

Conversation

@userInner

Copy link
Copy Markdown
Contributor

This adds an opt-in CUDA experiment that shares the per-job prestate across a thread block and expresses the existing square/reduction sequence in one PTX block. It pairs that layout with 1024-thread mining blocks and a 640-block cap; diagnostic hashing stays at 256 threads. Default builds retain the current kernel and launch geometry.

The equivalent prototype on RTX 3080 Ti observed 363.89 → 384.07 MH/s (+5.55%) in an offline A/B/B/A engine run. Baseline drift was substantial, so this is not a statistically established gain or a claim for other NVIDIA cards. The fixed cap needs broader device validation. Full method and per-process results are in docs/cuda-shared-square.md.

The PR includes an offline benchmark and QUANTUS_REQUIRE_CUDA=1 to reject skipped device tests. CPU candidate verification, nonce coverage and rejection handling are preserved. This draft is intended for review and reproduction before considering wider enablement.

Validation on RTX 3080 Ti: default release engine tests 10/10 passed; feature-enabled release engine tests 10/10 passed, both with QUANTUS_REQUIRE_CUDA=1 and one test thread. Feature-enabled all-targets cargo check passed. git diff --check passed.

@n13

n13 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants