Accelerated array computing and code transformations for R. Numerical programs operating on multi-dimensional arrays can be just-in-time compiled to optimized executables via 'XLA' – the same compiler that powers 'JAX' and 'TensorFlow' – and run on CPU or NVIDIA GPU from the same source. Also provides reverse-mode automatic differentiation, returning the gradient of a function as another R function.
Options
anvl.backend(character(1), default"pjrt"): the backend every operation runs on –"pjrt"or"quickr". Arrays are allocated with it and jitted functions are compiled for it. Also seeactive_backend(),local_backend()andwith_backend().anvl.default_dtypes(namedcharacter()| namedlist()): the data types an R double and integer materialize at when it cannot be inferred from another operand. Seedefault_dtypes()for more details.anvl.default_device(character(1)| device object): the device a call that names none allocates on. Also seedefault_device(),local_default_device()andwith_default_device().
Environment variables
ANVL_DEFAULT_DTYPES:category=dtypepairs such as"float=f64,int=i64", used for every backend when theanvl.default_dtypesoption is not set.ANVL_DEFAULT_DEVICE: a device identifier such as"cuda"or"cpu:1", used when theanvl.default_deviceoption is not set.
Both are read once, when anvl is loaded.
The remaining ones, all prefixed ANVL_TEST, affect only anvl's own test
suite, not the package:
ANVL_TEST:tests/testthat.Rruns the tests only when this is"1", soR CMD checkin a shell without it runs none of them.ANVL_TEST_SKIP_QUICKR: when set to anything non-empty, the tests that need the quickr backend are skipped – they are comparatively slow.
Third-Party Licenses
The anvl package itself is MIT-licensed. The CUDA backend dynamically
loads NVIDIA software which is not bundled with anvl, but downloaded
from NVIDIA's official redistributable channels by the CUDA toolkit R
package (e.g. pjrt.cuda) at install time. Its use is governed by the
NVIDIA CUDA Toolkit EULA, with the
exception of cuDNN, which is covered by the
NVIDIA cuDNN SLA,
and NCCL, which is covered by its own license.
By installing or using the CUDA backend you accept those terms.
Author
Maintainer: Sebastian Fischer seb.fischer@tutamail.com (ORCID)
Authors:
Sebastian Fischer seb.fischer@tutamail.com (ORCID)
Daniel Falbel daniel@posit.co (ORCID)
Tomasz Kalinowski tomasz@posit.co
Nikolai German niko.german@gmail.com (ORCID)
Other contributors:
Louis Aslett louis.aslett@durham.ac.uk (ORCID) [contributor]
Hugh Graham hugh@belian.earth (ORCID) [contributor]