From 12bd36aee216a6342da2cde9c3e865d3b48b324b Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Mon, 14 Sep 2026 16:36:02 +0300 Subject: [PATCH] deploy: per-host CUDA kernel choice; benjy runs the loop kernel The matrix gains `cuda_kernel` (rendered into miner.env as MINER_CUDA_KERNEL) next to `kernel`, the id validate asserts. benjy's 4090 measured +1.7% on the loop kernel (727-736 vs 716-718 MH/s, parity 200/200), so it runs loop / cuda-loop; quadbrat (-1.8%) and beast (-3.4%) stay on unrolled / cuda. A rollback to a binary that predates the switch is safe: it ignores the variable. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Ue5ZZm1Hiv5zPnucykKKuF --- .gitea/workflows/deploy.yaml | 11 ++++++++++- deploy/miner.env.tmpl | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 87b5cd9..f40bfbe 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -88,17 +88,24 @@ jobs: # `kernel` is the kernel id validate expects on the per-device metric: # cuda (engine-cuda, #3) on every NVIDIA host once the build carries # the fat binary; u64 would mean the miner silently fell back to wgpu. + # `cuda_kernel` selects the kernel entry (MINER_CUDA_KERNEL, #29): + # unrolled is the default; loop measured +1.7% on the 4090 and + # -1.8% / -3.4% on the 3060 / 5090 (2026-09-14), so only benjy runs + # it. `kernel` must be the id that choice reports: cuda or cuda-loop. - host: benjy.hanzalova.internal node: bob.hanzalova.internal gpu_devices: "1" # 1x RTX 4090 (sm_89); reference card for #2 - kernel: cuda + cuda_kernel: loop + kernel: cuda-loop - host: quadbrat.hanzalova.internal node: bob.hanzalova.internal gpu_devices: "1" # 1x RTX 3060 (sm_86) + cuda_kernel: unrolled kernel: cuda - host: beast.hanzalova.internal node: bob.hanzalova.internal gpu_devices: "2" # 2x RTX 5090 (sm_120) + cuda_kernel: unrolled kernel: cuda steps: - uses: actions/checkout@v4 @@ -146,6 +153,7 @@ jobs: if: ${{ github.event.inputs.mode != 'validate' }} env: GPU_DEVICES: ${{ matrix.gpu_devices }} + CUDA_KERNEL: ${{ matrix.cuda_kernel }} run: | set -euo pipefail SSHOPTS="-i $HOME/.ssh/id_gitea_ci -o StrictHostKeyChecking=accept-new" @@ -210,6 +218,7 @@ jobs: t = pathlib.Path("deploy/miner.env.tmpl").read_text() t = t.replace("{{QUANTUS_NODE_ADDR}}", os.environ["NODE_ADDR"]) t = t.replace("{{QUANTUS_GPU_DEVICES}}", os.environ["GPU_DEVICES"]) + t = t.replace("{{MINER_CUDA_KERNEL}}", os.environ["CUDA_KERNEL"]) pathlib.Path("miner.env").write_text(t) PY push --chown=root:quantus-miner --chmod=F0640 \ diff --git a/deploy/miner.env.tmpl b/deploy/miner.env.tmpl index efdb334..7b05468 100644 --- a/deploy/miner.env.tmpl +++ b/deploy/miner.env.tmpl @@ -4,3 +4,5 @@ # from the node host as separate 0640 files. QUANTUS_NODE_ADDR={{QUANTUS_NODE_ADDR}} QUANTUS_GPU_DEVICES={{QUANTUS_GPU_DEVICES}} +# Kernel entry in the CUDA engine: unrolled (mining_main) or loop (mining_loop), quantus/miner#29. +MINER_CUDA_KERNEL={{MINER_CUDA_KERNEL}}