tvm-clj 6.00-beta-1-SNAPSHOT
Released under the Eclipse Public License
Clojure bindings and exploration of the tvm library.
Installation
To install, add the following dependency to your project or build file:
[tvm-clj "6.00-beta-1-SNAPSHOT"]
Topics
Namespaces
tvm-clj.application.image
Image resize algorithm showing somewhat nontrivial application of TVM operators. In this case we have an algorithm which is a simple average area color algorithm used for scaling images down. This reads a rectangle in the source image and averages it for every destination pixel.
Public variables and functions:
tvm-clj.application.kmeans
High performance implementation of the KMeans algorithm using kmeans++ initialization and Lloyd’s algorithm for convergence.
Public variables and functions:
tvm-clj.ast
TVM’s algorithms are first described using an AST tailored towards ND-array programming.
Public variables and functions:
- *varname-prefix*
- ->dtype
- ->operation
- commutative-reduce
- commutative-reducer
- compute
- compute-op
- first-input
- first-output
- input-tensors
- iteration-variable
- iteration-variable-type-set
- name->thread-axis-iterator
- output-tensors
- placeholder
- safe-str
- scan
- tget
- tvm-fn
- tvm-fn->args
- tvm-fn->commutative-reducer
- tvm-let
- variable
- when-not-error
tvm-clj.compiler
Once a user has a schedule, they then need to compile the schedule into actual executable code. This produces a module which contains all of the executable code, cuda/opencl modules, etc required to run the schedule.
Public variables and functions:
tvm-clj.device
Operations on a device. Devices, such as a GPU, need to be addressed independently and once you have a device you can allocate a tensor on that device.
Public variables and functions:
tvm-clj.module
Once user’s have a compiled a module, the then can query the module for the functions within. Functions returned take only things convertible to TVM nodes such as scalars and tensors and the result buffer must be passed in.
Public variables and functions:
tvm-clj.schedule
After describing the algorithm, the user creates a ‘schedule’ for the algorithm which involve transformations to the algorithm that are guaranteed not to change the results such as the tiling a computation across a tensor.
Public variables and functions: