diff --git a/README.md b/README.md index 75c83691..0c0ae0a7 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ Next generation high performance Clojure toolkit. * [Efficient 1d convolutions, correlations, gaussian correlations](https://cnuernber.github.io/dtype-next/tech.v3.datatype.convolve.html) * [Numeric gradient, elemwise difference](https://cnuernber.github.io/dtype-next/tech.v3.datatype.gradient.html) * [Variable rolling windows](https://cnuernber.github.io/dtype-next/tech.v3.datatype.rolling.html#var-variable-rolling-window-indexes) - + ## Description -`dtype-next` provides a unified pathway for dealing with contiguous containers of primitive datatypes such as +`dtype-next` provides a unified pathway for dealing with contiguous containers of primitive datatypes such as ints and floats. In addition it defines the basis for `array` programming as found in APL or numpy and -a deep Java interface hierarchy with default methods to allow implementing new `array`s painless. This +a deep Java interface hierarchy with default methods to allow implementing new `array`s painless. This interface hierarchy integrates with Java Streams, Spliterators, and various members of the java.util.function package. In addition it extends these concepts to native-heap based containers. @@ -30,7 +30,7 @@ an index space. This library forms the numeric basis that underlies the ['tech.ml.dataset'](https://github.com/techascent/tech.ml.dataset) system. It also defines a language independent ABI which allows zerocopy to C-based systems -such as [numpy](https://github.com/clj-python/libpython-clj), [OpenCV](https://github.com/techascent/tech.opencv), +such as [numpy](https://github.com/clj-python/libpython-clj), [OpenCV](https://github.com/techascent/tech.opencv), [Julia](https://github.com/cnuernber/libjulia-clj), [TVM](https://github.com/techascent/tvm-clj) and [neanderthal](https://github.com/uncomplicate/neanderthal). @@ -44,10 +44,11 @@ Additional targets of this library: * Full native memory support. Malloc, free, memset, memcpy. Just the basics but guaranteed to be available. * Graal Native support. -* Support for JDK-8 through JDK-16+. +* Support for JDK-8 through JDK-17+ - JDK-16 is *no longer* supported. For jdk-17 usage, please see + project.clj for required flags. * [Blogpost](https://techascent.com/blog/next-gen-native.html), [example](examples/clj-ffi) and [involved example](https://github.com/cnuernber/avclj) of using the FFI architecture across JNA, JDK-16 and GraalNative. -Checkout the [Overview](https://cnuernber.github.io/dtype-next/overview.html), [API Documentation](https://cnuernber.github.io/dtype-next/), and +Checkout the [Overview](https://cnuernber.github.io/dtype-next/overview.html), [API Documentation](https://cnuernber.github.io/dtype-next/), and [Cheatsheet](https://cnuernber.github.io/dtype-next/cheatsheet.html). diff --git a/docs/buffered-image.html b/docs/buffered-image.html index 4440e31c..b87a1141 100644 --- a/docs/buffered-image.html +++ b/docs/buffered-image.html @@ -1,6 +1,6 @@ -Buffered Image Support

Buffered Image Support

+Buffered Image Support

Buffered Image Support

dtype-next contains support for loading/saving buffered images and creating tensors from buffered images.

Usage

Buffered images implement the protocols required to be part of the datatype system.

diff --git a/docs/cheatsheet.html b/docs/cheatsheet.html index a57e6869..56990663 100644 --- a/docs/cheatsheet.html +++ b/docs/cheatsheet.html @@ -1,6 +1,6 @@ -Cheatsheet

Cheatsheet

+Cheatsheet

Cheatsheet

The old cheatsheet has been moved to overview.

Most of these functions are accessible via the [tech.v3.datatype :as dtype] namespace. When another namespace is required, it is specified separately.

Containers

diff --git a/docs/datatype-to-dtype-next.html b/docs/datatype-to-dtype-next.html index 3a93dba2..4e0e8e4f 100644 --- a/docs/datatype-to-dtype-next.html +++ b/docs/datatype-to-dtype-next.html @@ -1,6 +1,6 @@ -Why dtype-next?

Why dtype-next?

+Why dtype-next?

Why dtype-next?

tech.datatype

tech.datatype as a numerics stack fulfills our technical needs at TechAscent in regards to scientific computing, data science, and machine learning. It enables a completely unified interface between native heap and JVM heap datastructures with a base level of datatype support and various simple accelerated operations.

In order to fulfill unified support for efficient random access across many datatypes it uses many type specific constructions that enable primitive reading/writing to buffers with disparate storage backends.

diff --git a/docs/dimensions-bytecode-gen.html b/docs/dimensions-bytecode-gen.html index fdaa20af..2ed42c21 100644 --- a/docs/dimensions-bytecode-gen.html +++ b/docs/dimensions-bytecode-gen.html @@ -1,6 +1,6 @@ -Dimensions and Bytecode Generation

Dimensions and Bytecode Generation

+Dimensions and Bytecode Generation

Dimensions and Bytecode Generation

Translating from N-Dimensional Space to 1 Dimensional Space

We want to be able to take 1 dimensional buffers of data and represent N-dimensional hyper-rectangular spaces. Lots of things are n-dimensional and hyperrectangular; things like images and datasets and volumes and 3d objects so let’s take a moment and talk about the abstractions required efficiently present this interface.

dimensions objects describe the N-dimensional addressing scheme and perform the translation from our n-dimensional ‘global’ space into our 1-dimensional ‘local’ dense address spaces. In other words they describe how to randomly addressed data buffers using an n-dimensional addressing scheme that supports numpy style in-place slicing, transpose, broadcasting, reshape, and APL style rotations. In this way they are designed to add ‘ND’ operations to any randomly addressed system.

diff --git a/docs/index.html b/docs/index.html index 19a30537..bdcd918d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,3 +1,3 @@ -dtype-next 8.033

dtype-next 8.033

A Clojure library designed to aid in the implementation of high performance algorithms and systems.

Topics

Namespaces

tech.v3.datatype.argops

Efficient functions for operating in index space. Take-off of the argsort, argmin, etc. type functions from Matlab. These functions generally only work on readers and all return some version of an index or list of indexes.

tech.v3.datatype.bitmap

Functions for working with RoaringBitmaps. These are integrated deeply into several tech.v3.datatype algorithms and have many potential applications in high performance computing applications as they are both extremely fast and storage-space efficient.

tech.v3.datatype.convolve

Namespace for implementing various basic convolutions. Currently only 1d convolutions are supported.

Public variables and functions:

tech.v3.datatype.datetime

Thorough bindings to java.time.datetime. Includes packed datatypes and lifting various datetime datatypes into the datatype system.

Public variables and functions:

tech.v3.datatype.errors

Generic, basic error handling. No dependencies aside from apache commons math for NAN exception.

tech.v3.datatype.ffi.clang

General utilites to work with clang in order to define things like structs or enumerations

Public variables and functions:

tech.v3.datatype.ffi.graalvm

Graalvm-specific namespace that implements the dtype-next ffi system and allows users to build stand-alone shared libraries that other languages can use to call Clojure code via a binary C interface.

Public variables and functions:

tech.v3.datatype.functional

Arithmetic and statistical operations based on the Buffer interface. These operators and functions all implement vectorized interfaces so passing in something convertible to a reader will return a reader. Arithmetic operations are done lazily. These functions generally incur a large dispatch cost so for example each call to ‘+’ checks all the arguments to decide if it should dispatch to an iterable implementation or to a reader implementation. For tight loops or operations like map and filter, using the specific operators will result in far faster code than using the ‘+’ function itself.

tech.v3.datatype.gradient

Calculate the numeric gradient of successive elements. Contains simplified versions of numpy.gradient and numpy.diff.

Public variables and functions:

tech.v3.datatype.jna

Protocol bindings to the tech.jna system. Most users will not need to require this namespace.

Public variables and functions:

    tech.v3.datatype.mmap-writer

    Provides the ability to efficiently write binary data to a file with an automatic conversion to a native-buffer using mmap.

    Public variables and functions:

    tech.v3.datatype.native-buffer

    Support for malloc/free and generalized support for reading/writing typed data to a long integer address of memory.

    tech.v3.datatype.nippy

    Nippy bindings for datatype base types and tensor types

    Public variables and functions:

    tech.v3.datatype.packing

    Implements the ‘packed/unpacked’ concept in datatype. This allows us to take objects like LocalDate’s and store them in int32 storage which dramatically decreases their size.

    tech.v3.datatype.sampling

    Implementation of reservoir sampling designed to be used in other systems. Provides a low-level sampler object and a double-reservoir that implements DoubleConsumer and derefs to a buffer of doubles.

    Public variables and functions:

    tech.v3.datatype.struct

    Structs are datatypes composed of primitive datatypes or other structs. Similar to records except they do not support string or object columns, only numeric values. They have memset-0 initialization, memcpy copy semantics. For correct equals, hashing, convert struct into a normal persistent map via into.

    tech.v3.datatype.wavelet

    Implementation of the scipy continuous wavelet transform. See fastmath for implementations of the discrete wavelet transform.

    Public variables and functions:

    tech.v3.libs.neanderthal

    Implementation of the various datatype protocols for neanderthal datatypes. Users must require this to enable ->reader and as-tensor functionality for neanderthal datatypes.

    Public variables and functions:

      tech.v3.tensor

      ND bindings for the tech.v3.datatype system. A Tensor is conceptually just a tuple of a buffer and an index operator that is capable of converting indexes in ND space into a single long index into the buffer. Tensors implement the tech.v3.datatype.NDBuffer interface and outside this file ND objects are expected to simply implement that interface.

      tech.v3.tensor.color-gradients

      Implement a mapping from double->color for each entry in a tensor. Produces an image of the same dimensions in pixels as the input tensor.

      \ No newline at end of file +dtype-next 8.034

      dtype-next 8.034

      A Clojure library designed to aid in the implementation of high performance algorithms and systems.

      Topics

      Namespaces

      tech.v3.datatype.argops

      Efficient functions for operating in index space. Take-off of the argsort, argmin, etc. type functions from Matlab. These functions generally only work on readers and all return some version of an index or list of indexes.

      tech.v3.datatype.bitmap

      Functions for working with RoaringBitmaps. These are integrated deeply into several tech.v3.datatype algorithms and have many potential applications in high performance computing applications as they are both extremely fast and storage-space efficient.

      tech.v3.datatype.convolve

      Namespace for implementing various basic convolutions. Currently only 1d convolutions are supported.

      Public variables and functions:

      tech.v3.datatype.datetime

      Thorough bindings to java.time.datetime. Includes packed datatypes and lifting various datetime datatypes into the datatype system.

      Public variables and functions:

      tech.v3.datatype.errors

      Generic, basic error handling. No dependencies aside from apache commons math for NAN exception.

      tech.v3.datatype.ffi.clang

      General utilites to work with clang in order to define things like structs or enumerations

      Public variables and functions:

      tech.v3.datatype.ffi.graalvm

      Graalvm-specific namespace that implements the dtype-next ffi system and allows users to build stand-alone shared libraries that other languages can use to call Clojure code via a binary C interface.

      Public variables and functions:

      tech.v3.datatype.functional

      Arithmetic and statistical operations based on the Buffer interface. These operators and functions all implement vectorized interfaces so passing in something convertible to a reader will return a reader. Arithmetic operations are done lazily. These functions generally incur a large dispatch cost so for example each call to ‘+’ checks all the arguments to decide if it should dispatch to an iterable implementation or to a reader implementation. For tight loops or operations like map and filter, using the specific operators will result in far faster code than using the ‘+’ function itself.

      tech.v3.datatype.gradient

      Calculate the numeric gradient of successive elements. Contains simplified versions of numpy.gradient and numpy.diff.

      Public variables and functions:

      tech.v3.datatype.jna

      Protocol bindings to the tech.jna system. Most users will not need to require this namespace.

      Public variables and functions:

        tech.v3.datatype.mmap-writer

        Provides the ability to efficiently write binary data to a file with an automatic conversion to a native-buffer using mmap.

        Public variables and functions:

        tech.v3.datatype.native-buffer

        Support for malloc/free and generalized support for reading/writing typed data to a long integer address of memory.

        tech.v3.datatype.nippy

        Nippy bindings for datatype base types and tensor types

        Public variables and functions:

        tech.v3.datatype.packing

        Implements the ‘packed/unpacked’ concept in datatype. This allows us to take objects like LocalDate’s and store them in int32 storage which dramatically decreases their size.

        tech.v3.datatype.sampling

        Implementation of reservoir sampling designed to be used in other systems. Provides a low-level sampler object and a double-reservoir that implements DoubleConsumer and derefs to a buffer of doubles.

        Public variables and functions:

        tech.v3.datatype.struct

        Structs are datatypes composed of primitive datatypes or other structs. Similar to records except they do not support string or object columns, only numeric values. They have memset-0 initialization, memcpy copy semantics. For correct equals, hashing, convert struct into a normal persistent map via into.

        tech.v3.datatype.wavelet

        Implementation of the scipy continuous wavelet transform. See fastmath for implementations of the discrete wavelet transform.

        Public variables and functions:

        tech.v3.libs.neanderthal

        Implementation of the various datatype protocols for neanderthal datatypes. Users must require this to enable ->reader and as-tensor functionality for neanderthal datatypes.

        Public variables and functions:

          tech.v3.tensor

          ND bindings for the tech.v3.datatype system. A Tensor is conceptually just a tuple of a buffer and an index operator that is capable of converting indexes in ND space into a single long index into the buffer. Tensors implement the tech.v3.datatype.NDBuffer interface and outside this file ND objects are expected to simply implement that interface.

          tech.v3.tensor.color-gradients

          Implement a mapping from double->color for each entry in a tensor. Produces an image of the same dimensions in pixels as the input tensor.

          \ No newline at end of file diff --git a/docs/overview.html b/docs/overview.html index 026e3f96..fd882ce2 100644 --- a/docs/overview.html +++ b/docs/overview.html @@ -1,6 +1,6 @@ -Overview

          Overview

          +Overview

          Overview

          Setup

          (require '[tech.v3.datatype :as dtype])
           
          diff --git a/docs/tech.v3.datatype.argops.html b/docs/tech.v3.datatype.argops.html index 0cc11920..4d416ecf 100644 --- a/docs/tech.v3.datatype.argops.html +++ b/docs/tech.v3.datatype.argops.html @@ -1,6 +1,6 @@ -tech.v3.datatype.argops documentation

          tech.v3.datatype.argops

          Efficient functions for operating in index space. Take-off of the argsort, argmin, etc. type functions from Matlab. These functions generally only work on readers and all return some version of an index or list of indexes.

          ->binary-operator

          (->binary-operator op)

          Convert a thing to a binary operator. Thing can be a keyword or an implementation of IFn or an implementation of a BinaryOperator.

          ->binary-predicate

          (->binary-predicate op)

          Convert a thing to a binary predicate. Thing can be a keyword or an implementation of IFn or an implementation of a BinaryPredicate.

          ->comparator

          (->comparator src-comparator)

          Convert a thing to a java.util.Comparator.

          ->double-comparator

          (->double-comparator src-comparator)

          Convert a thing to a it.unimi.dsi.fastutil.doubles.DoubleComparator.

          ->long-comparator

          (->long-comparator src-comparator)

          Convert a thing to a it.unimi.dsi.fastutil.longs.LongComparator.

          ->unary-operator

          (->unary-operator op)

          Convert a thing to a unary operator. Thing can be a keyword or an implementation of IFn or an implementation of a UnaryOperator.

          ->unary-predicate

          (->unary-predicate op)

          Convert a thing to a unary predicate. Thing can be a keyword or an implementation of IFn or an implementation of a UnaryPredicate.

          arg-min-n

          (arg-min-n N comparator {:keys [nan-strategy], :or {nan-strategy :last}} values)(arg-min-n N comparator values)(arg-min-n N values)

          Return the indexes of the top minimum items. Values must be countable and random access. Same options,arguments as argsort.

          argfilter

          (argfilter pred options rdr)(argfilter pred rdr)

          Filter out values returning either an iterable of indexes or a reader of indexes.

          arggroup

          (arggroup {:keys [storage-datatype unordered?]} rdr)(arggroup rdr)

          Group by elemens in the reader returning a map of value->list of indexes.

          +tech.v3.datatype.argops documentation

          tech.v3.datatype.argops

          Efficient functions for operating in index space. Take-off of the argsort, argmin, etc. type functions from Matlab. These functions generally only work on readers and all return some version of an index or list of indexes.

          ->binary-operator

          (->binary-operator op)

          Convert a thing to a binary operator. Thing can be a keyword or an implementation of IFn or an implementation of a BinaryOperator.

          ->binary-predicate

          (->binary-predicate op)

          Convert a thing to a binary predicate. Thing can be a keyword or an implementation of IFn or an implementation of a BinaryPredicate.

          ->comparator

          (->comparator src-comparator)

          Convert a thing to a java.util.Comparator.

          ->double-comparator

          (->double-comparator src-comparator)

          Convert a thing to a it.unimi.dsi.fastutil.doubles.DoubleComparator.

          ->long-comparator

          (->long-comparator src-comparator)

          Convert a thing to a it.unimi.dsi.fastutil.longs.LongComparator.

          ->unary-operator

          (->unary-operator op)

          Convert a thing to a unary operator. Thing can be a keyword or an implementation of IFn or an implementation of a UnaryOperator.

          ->unary-predicate

          (->unary-predicate op)

          Convert a thing to a unary predicate. Thing can be a keyword or an implementation of IFn or an implementation of a UnaryPredicate.

          arg-min-n

          (arg-min-n N comparator {:keys [nan-strategy], :or {nan-strategy :last}} values)(arg-min-n N comparator values)(arg-min-n N values)

          Return the indexes of the top minimum items. Values must be countable and random access. Same options,arguments as argsort.

          argfilter

          (argfilter pred options rdr)(argfilter pred rdr)

          Filter out values returning either an iterable of indexes or a reader of indexes.

          arggroup

          (arggroup {:keys [storage-datatype unordered?]} rdr)(arggroup rdr)

          Group by elemens in the reader returning a map of value->list of indexes.

          Options: