Multik 0.2: Multiplatform, With Support for Android and Apple Silicon
Introducing Multik 0.2.0! Now a multiplatform library, it allows you to use multidimensional arrays in your favorite multiplatform projects. Let’s take a closer look at what’s new in v0.2.0.
We are very grateful to Luca Spinazzola for his huge contribution to the multiplatform capabilities included in this release of the library.
Before we move on to reviewing Multik’s new multiplatform structure, we need to say a few words about the new naming conventions. Ever since we multiplied the number of artifacts and added platform suffixes, such as jvm, macosx64, js, and others, there have been collisions with older names. To solve this problem, we’ve renamed some of the modules.
Let’s reacquaint ourselves with the modules and get a sense of which platforms each module now supports.
As the name suggests, this is the main module providing multidimensional arrays and the ability to perform transformations, iteration, and arithmetic operations with them. This module also provides an API for calculations that require complex algorithms and resources. Now there are three types of such APIs: mathematics, linear algebra, and statistics. Other modules are responsible for the implementation of this API. Remember – Multik lets you replace these implementations at runtime.
The first module that implements the above API is multik-kotlin. In this module, all algorithms and logic are written in pure Kotlin. Even though it may be slower than native libraries, it provides more stability and allows for easier code debugging.
The next module is multik-openblas. Here, the OpenBLAS library is responsible for all linear algebra as well as the C wrapper over the Fortran libraries LAPACK and BLAS. C++ code is responsible for mathematics and statistics.
This module, unlike the previous one, is quite demanding on the environment and the platform it’s launched on. In the table, you can see that the code under the JVM will only work on the specified systems and architectures. On these platforms, we ensure that it works out of the box and the users are rewarded with excellent performance.
multik-default, the last of the 4 models available at the moment, has kept its old name. It includes the two previous modules, multik-kotlin and multik-openblas. The idea is to combine the pros of both modules while doing away with the cons.
It supports all of the same platforms as the previous modules.
Support for Android and Apple Silicon processors
multik-openblas is supported by Android and macOS on new Apple processors. Now you can enjoy the speed of applications on Android with ARMv8 processors and native support for M1 and M2 processors from Apple.
Random, norm matrix, easy creation of complex numbers, and more
In this release, we have also improved the usability of the library. For example, we wrapped
random from Kotlin to create arrays with random numbers:
We have changed the matrix norm calculation function and added it to the native one:
And now you can create complex numbers easily and naturally. Credit for this contribution goes to Marcus Dunn.
For more details about this new release, please check out the changelog.
How to try it
To try Multik 0.2.0 in your project, do the following:
- Make sure that you have
mavenCentral()in your list of repositories:
- Add the Multik module you need as a dependency:
For a multiplatform project, put the Multik dependency in the common set:
Or put the dependency in a specific source set.
Multik is also available in Kotlin Jupyter notebooks.
Try it in Datalore.
We are on our way to a stable release and could really use your feedback.
Try out Mutlik 0.2.0 and share your experience with us! Report any issues you encounter to the project’s issue tracker.
Subscribe to Blog updates
Thanks, we've got you!
Introducing Kotlin Notebook
The first experimental version of the Kotlin Notebook plugin for IntelliJ IDEA is now available! This post will offer insight into the plugin’s functionality and use cases, but before launching into that, we’d like to let the plugin speak for itself: https://youtu.be/2PLYlDJPelQ W…
Kotlin Dataframe 0.9.1 released!
It's time for another Kotlin Dataframe update to start off the new year.There have been a lot of exciting changes since the last 0.8.0 preview release. So without any further ado, let's jump right in! TL;DR: OpenAPI type schemas can now be parsed and converted into data schemas.New JSON readin…
KotlinDL 0.5 Has Come to Android!
Version 0.5 of our deep learning library, KotlinDL, is now available! This release focuses on the new API for the flexible and easy-to-use deployment of ONNX models on Android. We have reworked the Preprocessing DSL, introduced support for ONNX runtime execution providers, and more. Here's a summ…
Kotlin DataFrame Preview
TL;DR: We at the Kotlin team have developed a Kotlin library for data frames. Today we’re releasing its first public preview version. It provides a readable and powerful DSL for data wrangling and i/o via CSV, JSON, Excel, and Apache Arrow, as well as interop with Kotlin data classes and hierarchica…