Skip to content

Releases: LK-Studio1128/LKlight-GPU

LKlight-GPU v1.2.2 — GPU batching for all four all-atom scoring families (CUDA + Metal)

Choose a tag to compare

@LK-Studio1128 LK-Studio1128 released this 09 Sep 18:31

/s


Asset status: all four binaries (win64-cuda / linux-cuda / mac-arm64-metal / mac-arm64-cpu) are attached. The linux-cuda build was accepted on the RTX 3080 Ti host (1,000 x 1,000 in 7.46 s; best -7254.95161080, bit-identical across all hosts).

LKlight-GPU v1.2.1 — Apple Silicon Metal GPU backend (7.6× vs CPU grid on M4)

Choose a tag to compare

@LK-Studio1128 LK-Studio1128 released this 06 Sep 02:38

LKlight-GPU v1.2.1

Apple Silicon Metal GPU backend (--features metal) — same-source, portable,
bit-consistent acceleration for macOS arm64.

Added

  • Metal GPU batch scorer for Apple Silicon (feature = "metal", macOS only).
    New src/metal/lk_metal.m (Objective-C host + embedded MSL kernels, C ABI
    lk_metal_available/create/score/destroy) and src/metal_score.rs (Rust
    binding mirroring gpu_score.rs), wired into the engine scoring path with a
    three-tier fallback metal → cuda → CPU grid.
    • The per-atom near-field (10 Å cell-list with clamped electrostatics,
      Lennard-Jones and clash terms) and far-field (0.5 Å potential, trilinear
      interpolation) kernels are a line-for-line MSL port of the CUDA
      full_score.cu/far_field.cu numerics used by the Windows/Linux GPU
      engines, so GPU behaviour is consistent across vendors.
    • Apple GPUs have no fast fp64, so rigid-body pose transforms stay on the CPU
      in f64 and the transformed coordinates are uploaded to a shared MTLBuffer
      (zero-copy on unified memory); only the per-atom f32 accumulation runs on
      the GPU — the same f32 quantisation budget as the CUDA backend.
    • Layout: one threadgroup per pose × 128 threads with a strided atom loop and
      tree reduction (the tuned POC configuration), 14 packed buffers total.
    • If no Metal device is available (or the build lacks the feature) the engine
      transparently falls back to the CPU grid path; the fallback result is
      bit-identical to the standalone LKlight-grid engine (verified).
    • No default-build change: plain cargo build --release output is unchanged
      from v1.2.0 (CPU-only); Metal is opt-in via --features metal.

Measured (Mac mini M4, 10-core, 32 GB, unified memory; 1AZP, dna,

1000 glowworms × 1000 steps, seed 324324 — same-slot runs)

  • End-to-end 6.22 s (≈ 6.2 ms/step) vs CPU grid 47.10 s and exact
    219.29 s on the same machine → ≈ 7.6× vs CPU grid, ≈ 35.3× vs exact.
  • Best energy −7254.95161080, bit-identical to the RTX 5090 CUDA engine
    final value (both run the same-source f32 batch kernel); deep-pose relative
    deviation vs CPU grid stays in the documented ~1e-4 f32 class.
  • Binary depends only on system frameworks (Metal, Foundation, objc,
    libSystem) — ad-hoc linker-signed, no absolute paths or brew libraries, so
    it can be copied to any Apple Silicon Mac and run as-is.

Developer-only

  • dump_metal_dataset (env-gated in the Score trait) and the poc_dump bin
    export the exact dataset (receptor / cell-list / far-field / N transformed
    poses + per-pose CPU reference scores) used to develop and validate the Metal
    kernels. Not used by the normal engine path.

LKlight-GPU v1.2.0 — 0.5 Å far-field grid + batch-cache fix (GPU ~66× faster long runs)

Choose a tag to compare

@LK-Studio1128 LK-Studio1128 released this 05 Sep 17:44

LKlight-GPU v1.2.0

0.5 Å far-field grid (reference-level accuracy) + GPU batch-scoring
performance optimisations + faster grid setup.

Added

  • Far-field grid at 0.5 Å reference resolution (new default). The host-side
    far-field grid (src/grid_dna.rs, byte-identical with LKlight-grid) is built
    at 0.5 Å spacing; the box half-width is spread = ceil(FIELD_RMAX / spacing) + 2
    (the old hard-coded ±32 cells assumed 1 Å). Because the CUDA far-field kernels
    are fully parameterised by the grid (spacing / origin / nx,ny,nz / phi) with no
    spacing assumption baked into device code, the GPU shares the accuracy gain
    with no kernel change. Verified on Linux RTX 3080 Ti and Windows RTX 5090:
    worst-case per-pose deviation vs. the reference engine drops ~9.6 → ~6.9
    (~1.4×).

Changed

  • Per-block shared-memory reduction of pose atomics (full_score.cu):
    each thread block reduces per-atom electrostatic/VDW terms into extern __shared__ memory and performs one atomicAdd per block via a single thread
    (stride-halving tree reduction), instead of every ligand atom doing a double
    atomicAdd. Per-pose atomic traffic drops from ~nl to ~ceil(nl/256).
    Out-of-range threads store 0 and still hit the barrier. GSO convergence is
    unchanged (1AZP dna best −7254.95161 GPU vs −7254.95220 optimised CPU-grid,
    Δ ≈ 5.9×10⁻⁴, within the f32 batch budget).
  • Persistent device-buffer cache (full_score.cu): cuda_batch_score keeps
    a process-static BatchCache holding resident device copies of the receptor
    field, constant tables and grid parameters, keyed by host pointers + dims. On
    a hit only the N×7 pose translations/rotations are uploaded and N×2 energies
    read back each call; a new receptor (pointer-key change) frees + rebuilds.
    Eliminates repeated field upload across thousands of GSO scoring calls.
  • Shell-band box scan for faster grid setup (bit-identical). Same shared
    grid_dna.rs pruning as LKlight-grid: written-cell set/order and the f32
    field are unchanged; grid build + first score 1.57 s → 1.02 s at 0.5 Å.
  • Ligand C-cache pointer stabilisation (performance + robustness fix).
    batch_energy_gpu_scores rebuilt the ligand parameter vectors on every call,
    so the C-side batch-cache key (base-pointer) never matched and every step did
    a full rebuild (repeated cudaMalloc/cudaFree + full 0.5 Å field upload).
    Ligand arrays are now cached once per system (DNA.lig_cuda, OnceLock,
    cfg(cuda)) with stable pointers, so the persistent device cache actually
    hits step-to-step. Also clears any sticky CUDA error at the batch entry so a
    single failed step can no longer poison later launches, and reports numeric
    error codes in diagnostics. Measured on Windows RTX 5090, 1000 glowworms ×
    1000 steps, 1AZP dna: GPU wall-clock 267.6 s → 4.05 s (~66×), batch
    errors → 0, best energy unchanged (−7254.9516108, bit-identical).

Accuracy contract

  • pydock / cpydock GPU == CPU bit-identical; dna differs only by the
    expected f32 near-field batch rounding (≤ ~6×10⁻⁴).

Downloads

Platform File Binary
Linux x86-64 LKlight-linux-cuda CUDA-enabled, glibc
Windows x64 LKlight-win64-cuda.exe CUDA-enabled, PE32+ console

Static cudart: the target machine only needs the NVIDIA driver. Bare binaries
follow the v1.1.0 asset layout; each repo tree carries README.md, LICENSE
(GPL-3.0), NOTICE and CHANGELOG.md.

Citation & DOI

Zenodo DOI from v1.1.0 is retained. See NOTICE for LightDock attribution.

LKlight-GPU v1.1.0 — CUDA-batched docking engine (Windows + Linux)

Choose a tag to compare

@LK-Studio1128 LK-Studio1128 released this 02 Sep 21:20

LKlight-GPU v1.1.0 — CUDA-batched docking engine (Rust port of the LightDock GSO protocol).

  • Project release v1.1.0 (matches Cargo.toml). Core = 4th-generation CUDA-batch lineage; original engine referred to as original / all-pairs reference, not 'exact'.
  • Whole-step pose batching in one kernel (near cell-list + far-field + device-side transform).
  • Verified on real machines: Windows RTX 2080 and Linux RTX 3080 Ti (CUDA BATCH ACTIVE). Acceptance logs in tests/acceptance/.
  • No GPU / restraints / membrane / ANM -> automatic CPU-grid fallback (identical results).
  • 12 scoring functions; 34/34 tests.
  • Static cudart: target machine only needs the NVIDIA driver.

See README.md for usage and the Windows CUDA build walkthrough.