Compiling and Optimizing of Operations on ND4J arrays


Is ND4j use a compiler approach to optimize the sequence of operations on the matrices and vectors (ND4J arrays)? For instance minimizing the memory re-allocation of a previously loaded array, discarding the memory load operations on unaffected rows and etc.


@volkanagun not really a compiler per se…workspaces re uses already existed memory at runtime:

Beyond that, it’s mostly c++ operations underneath the covers. That is all compiled c++ in to a jar file loaded by dl4j. You can find the c++ code base here:

Javacpp is what manages all of the native interop here.

Could you tell us what operations you’re doing? Maybe we can help identify what it is you want to optimize.

I can elaborate more on certain internals once you tell me what you’re looking for.