I thought I should post another update on the ops-experiments project since we’ve accomplished a lot the last while.
The last couple of weeks @hadim and I have made some good progress on the build for YacuDecu deconvolution. Below is a summary of rough notes and build instructions I wrote down the last few weeks. In the coming weeks I hope to clean up these instructions and add them to the readme of ops-experiments and the ImageJ wiki. I emphasize these are “rough” notes. I’m posting this for the benefit of any early adapters and for myself (so I can remember what we did to get things to work).
First off some timing results:
100 iterations Ops Richardson-Lucy ~ 220 seconds
100 iterations DeconvolutionLab2 - RL ~ 100 seconds
100 iterations Ops-Experiments - RL c++ with MKL libraries ~ 10 seconds
100 iterations Ops-Experiments Cuda -Yacu Decu RL ~ 2 seconds
These are a bit deceptive as Ops-Richardson-Lucy definitely still has some inefficiencies. I suspect DeconvolutionLab2 could also be optimized further, as I’d expect the speed of an optimized java version to be much closer to the c++ MKL version. Take home point, is that GPU deconvolution is much faster than other implementations.
@hadim has contributed some big improvements to the javacpp build process, in ops-experiments. The process is based on the javacpp-presets project.
Native projects are placed in the native directory and platforms and sub-projects are defined in cppbuild.sh.
Each subproject has it’s native build commands defined in it’s own cppbuild.sh file. For example see YacuDecu cppbuild.sh and MKLFFTW cppbuild.sh. As things currently stand, only the linux builds have been implemented. MKLFFTW is using CMake while Yacu Decu is just using a Makefile. (This is simply because I haven’t figured out how to get the linking to Cuda correct from CMake yet, however it does demonstrate how you can use different native build tools for different projects, and define the native build steps for each OS).
Use exec-maven-plugin to execute the native builds.
Define a java wrapper class to the native code, for example here is the wrapper to YacuDecu.
Use the javacpp maven plugin to build and link the wrappers.
To build the project there are two native tools that need to be installed
- Cuda 9.0
Note: @hadim made a simplified branch that only has the YacuDecu wrapper, thus only needs Cuda and not MKL.
After installing Cuda and MKL people should be able to build the project by simply typing
mvn at the command line.
Currently, to install into Fiji, copy
javacpp-1.3.jar into Fiji.app/jars.
At this point you can test the installation by running DeconBenchmarkTheoreticalPSF.java.
More to come soon.