Repository navigation
biojava-tornadovm: opt-in GPU paths for ASA and all-pairs alignment scores (TornadoVM 8.0.0) - #1162
mikepapadim wants to merge 1 commit into
Conversation
…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.
|
@josemduarte is it something you are keen on merging? it should work also on Apple M-silicon and AMD hw through hip if we bumpp the version to 8.2.0 Also, no need for an sdk any more just the jars from maven centeral |
|
I think this is a very nice addition. But I am hesitant about where to place it. It could be as a new module as proposed here or as a separate project under the biojava org umbrella. And also there's the JDK 21 upgrade that is pending for the rest of biojava. I'd like to have a release on 21 soon. Perhaps that can be the moment to get this one in. Let me think about it a little more. In the meantime we'll keep this open. And also let's think about other possible features that might benefit from GPU. If we had more features it would give us more reasons to keep the tornado module proposed here for the long run. |
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:
-Ptornadovm. It needs JDK 21, and every other module keeps the JDK 11 baseline.tornado-apiisprovided; nothing in the existing modules depends on the new one.TornadoAsaCalculatorandTornadoAlignmentsmirrorAsaCalculatorandAlignments.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-openclandTORNADO_BACKEND=opencl.git fetch origin pull/1162/headonly checks out this PR, because the module exists here until it is merged. TornadoVM itself is the stock 8.0.0 release:tornado-api8.0.0-jdk21 from Maven Central, and the SDKMAN SDK. After a merge,git cloneofmasterand the samemvn -Ptornadovm ...line are enough.The scripts find TornadoVM 8.0.0 in SDKMAN by version, and install it with
sdk installif it is missing. Without SDKMAN they download the release SDK.mvn -Ptornadovm -pl biojava-tornadovm testruns the same tests on a plain JVM, which covers the CPU paths.biojava-tornadovm/README.mdcovers using the classes in an application.Tested
mvn validatewithout the profile does not include the module.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-alignmentitself.