Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Advantages
    • Fastest time to market requiring the least amount of engineering effort.
    • Interaction with the native code is already done.
    • The Scala API is already designed and decided. Implementing a wrapper limits design decisions which needs to be made and keeps the APIs consistent. 
    • Allows for development continue to be focused on a single JVM implementation which can be utilized by other JVM languages.
    • The implementation, adding new features, maintenance would be greatly simplified.
    • Implementation is not one way. In the future we maintain the ability to walk this decision back and go with another implementation.
  2. Disadvantages
    • Interaction with the Scala code could be complicated due to differences in the languages. Known issues are forming Scala collections and leveraging default values. Changes to the Scala API or the introduction of a builder function seems like the most obvious solutions here.
    • Some overhead in converting collections should be expected.
    • The JAR files will be larger than they would be without Scala in the middle. Theoretically, this could be an issue for some memory constrained edge devices.

Planned Release Milestones

Milestone 1: Initial release with support for all existing Scala Inference APIs. Includes integration into the existing CI, working examples, tutorials, documentation, benchmarking, and integrations into Maven distribution pipeline.

Milestone 2: General improvements to Inference API, improved better support specific use cases, and add sparse support (required for RNNs).

Milestone 3+: ?? (Ideas include: auto grad, exposing module api, control flow support)

Known Difficulties

Converting Java collections into Scala collections - Scala and Java use different collections. Generally, these can be converted through the scala.collection.JavaConverters library. Ideally, this will be done automatically on behalf of the user. The Java methods should take Java collections, do the necessary conversion, then call the corresponding Scala method. 

...

Known improvements to could made to the Scala API include:

  • Support for RNNs (Scala 
  • Adding domain specific use cases
  • Improving interface of existing APIs (for example, it should be possible to do batch inference using just an NDArray)

...