Files
Rbm/nvblas.conf
T
jensandClaude Sonnet 5 7bd3bbad57 Add optional NVBLAS GPU acceleration; fix stale CLAUDE.md sections
The RTX 4070 Ti + CUDA 12 toolkit + libnvblas.so are already installed
on this machine (from pyRBM's cupy setup); Bandicoot (the alternative,
much bigger Armadillo-to-GPU rewrite) is not. NVBLAS is a drop-in BLAS
shim -- zero source changes -- that intercepts Armadillo's large
matrix-multiply calls (v_to_h, h_to_v, CD gradients) and offloads them
to the GPU via cuBLAS, falling back to the system's OpenBLAS otherwise.

Add nvblas.conf (CPU fallback pointed at openblas-pthread, GPU_LIST ALL)
and run_gpu.sh, an opt-in LD_PRELOAD wrapper: ./run_gpu.sh <binary>
[args...]. Verified for real: poet.elf f produced byte-identical output
through the wrapper, and a real training run against moby_ch1.txt showed
GPU utilization rise from ~0-1% idle to 7-28% and memory usage grow from
893MiB to 1.4GB, while training progressed correctly (error decreasing,
coherent generated text). Added nvblas.log to .gitignore.

Also fixed two stale CLAUDE.md sections found along the way: the TEST
target description still described the old broken manual smoke-test
main.cpp instead of the minimal test suite that replaced it, and the
"Project files on disk" section still described the flat repo-root
layout from before the prj/<name>/ restructure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs
2026-07-27 16:24:34 +02:00

6 lines
170 B
Plaintext

NVBLAS_LOGFILE nvblas.log
NVBLAS_CPU_BLAS_LIB /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
NVBLAS_GPU_LIST ALL
NVBLAS_TILE_DIM 2048
NVBLAS_AUTOPIN_MEM_ENABLED