Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

biojava-tornadovm: opt-in GPU paths for ASA and all-pairs alignment scores (TornadoVM 8.0.0) - #1162

Open
mikepapadim wants to merge 1 commit into
biojava:masterfrom
mikepapadim:feat/tornadovm-gpu
Open

mikepapadim wants to merge 1 commit into
biojava:masterfrom
mikepapadim:feat/tornadovm-gpu

Conversation

@mikepapadim

@mikepapadim mikepapadim commented Oct 28, 2026 •

Copy link
Copy Markdown

Follow-up to #1158 and #1161: the GPU paths for ASA and all-pairs alignment scores, as an opt-in module, biojava-tornadovm, using TornadoVM 8.0.0.

In #1158 you suggested keeping the GPU code in a separate repository, and it lives at mikepapadim/biojava-tornadovm-extensions. This draft shows the alternative of shipping it inside BioJava without affecting anything else:

  • Default build unchanged. The module builds only with -Ptornadovm. It needs JDK 21, and every other module keeps the JDK 11 baseline.
  • Not a runtime dependency. tornado-api is provided; nothing in the existing modules depends on the new one.
  • Drop-in and exact. TornadoAsaCalculator and TornadoAlignments mirror AsaCalculator and Alignments.getAllPairsScores / getAllPairsScorers (GLOBAL, LOCAL) and return exactly the same results. Without a TornadoVM runtime, below a size threshold, or after a GPU failure, they run an exact multi-threaded CPU path.

Happy to keep it in the separate repository instead if you prefer; this PR is so you can see what it would look like in-tree.

How to run

Linux with an NVIDIA GPU, using SDKMAN. For AMD or Intel GPUs, use tornadovm 8.0.0-jdk21-opencl and TORNADO_BACKEND=opencl.

sdk install java 21.0.2-open
sdk install tornadovm 8.0.0-jdk21-cuda
export JAVA_HOME=$HOME/.sdkman/candidates/java/21.0.2-open

git fetch origin pull/1162/head:tornadovm && git checkout tornadovm
mvn -Ptornadovm -pl biojava-tornadovm -am install -DskipTests

cd biojava-tornadovm
scripts/test-gpu.sh      # the 23 parity tests under TornadoVM: GPU results == BioJava results
./bench.sh               # parity tests + ASA and all-pairs benchmarks (downloads 5 PDB entries)

git fetch origin pull/1162/head only checks out this PR, because the module exists here until it is merged. TornadoVM itself is the stock 8.0.0 release: tornado-api 8.0.0-jdk21 from Maven Central, and the SDKMAN SDK. After a merge, git clone of master and the same mvn -Ptornadovm ... line are enough.

The scripts find TornadoVM 8.0.0 in SDKMAN by version, and install it with sdk install if it is missing. Without SDKMAN they download the release SDK. mvn -Ptornadovm -pl biojava-tornadovm test runs the same tests on a plain JVM, which covers the CPU paths. biojava-tornadovm/README.md covers using the classes in an application.

Tested

  • 23/23 parity tests under TornadoVM 8.0.0 on an RTX 4090 with the CUDA backend, an RTX 4090 with OpenCL, and an Intel UHD 770 with OpenCL (no FP64; ASA then uses its exact single-precision path).
  • 23/23 on a plain JVM (CPU paths).
  • mvn validate without the profile does not include the module.
Workload (RTX 4090, i9-13900K 32 threads, end to end) BioJava lean Java (32 thr) GPU
ASA 4V6X, 238k atoms 558 ms (32 thr) 109 ms 35.7 ms
ASA 3J3Q, 2.4M atoms 6.92 s (32 thr) 1.16 s 373 ms
All-pairs global, 200 proteins, 20k pairs 9.97 s 417 ms 17.0 ms
All-pairs local, 200 proteins, 20k pairs 10.5 s 293 ms 17.0 ms

All results are identical to BioJava's. "Lean Java" is the same algorithm in plain Java; it is this module's CPU path, and #1161 brings the alignment part of it into biojava-alignment itself.

…TornadoVM 8.0.0)

A new module, built only with -Ptornadovm (JDK 21; the rest of BioJava keeps
its JDK 11 baseline). TornadoAsaCalculator and TornadoAlignments are drop-in
replacements for AsaCalculator and Alignments.getAllPairsScores /
getAllPairsScorers (GLOBAL, LOCAL) and return exactly the same results; without
a TornadoVM runtime, below a size threshold or after a GPU failure they run an
exact multi-threaded CPU path.

TornadoVM 8.0.0 comes from SDKMAN (scripts/env.sh). scripts/test-gpu.sh runs
the 23 parity tests under TornadoVM, bench.sh the benchmarks. See biojava#1158.
@mikepapadim
mikepapadim marked this pull request as ready for review October 28, 2026 16:49
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.

1 participant