'GGML' Tensor Operations for Machine Learning
Overview
Provides 'R' bindings to the 'GGML' tensor library for machine learning, optimized for 'Vulkan' GPU acceleration with a transparent CPU fallback. The package features a 'Keras'-like sequential API and a 'PyTorch'-style 'autograd' engine for building, training, and deploying neural networks. Key capabilities include high-performance 5D tensor operations, 'f16' precision, and efficient quantization. It supports native 'ONNX' model import (50+ operators) and 'GGUF' weight loading from the 'llama.cpp' and 'Hugging Face' ecosystems. Designed for zero-overhead inference via dedicated weight buffering, it integrates seamlessly as a 'parsnip' engine for 'tidymodels' and provides first-class learners for the 'mlr3' framework. See https://github.com/ggml-org/ggml for more information about the underlying library.
ag_tape_memory()now deduplicates shared storage on R builds without memory profiling (it relied ontracemem(), which errors there), fixing two test failures on CRAN's r-devel fedora flavour.
From NEWS.md in the release
Install
Health
ERRORtestsr-devel-linux-x86_64-debian-clang
Running ‘testthat.R’ [70s/77s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(ggmlR)
>
> if (requireNamespace("mlr3", quietly = TRUE)) library(mlr3)
> if (requireNamespace("parsnip", quietly = TRUE)) library(parsnip)
>
> heavy <- c(
+ "normalization",
+ "sequence-ops",
+ "binary-operations",
+ "glu",
+ "nn-sequential",
+ "matrix-ops",
+ "callbacks",
+ "onnx-quant",
+ "cpu-backend",
+ "onnx-elementwise",
+ "onnx-norm",
+ "onnx-misc",
+ "onnx-logic",
+ "onnx-gemm",
+ "onnx-resize",
+ "onnx-nn",
+ "nn-functional",
+ "activations-extended",
+ "onnx-ops",
+ "transformer-ops",
+ "onnx-shape",
+ "math-operations",
+ "activations",
+ "backend-extended",
+ "helpers",
+ "onnx-reduce",
+ "chain-sequential-batchnorm",
+ "chain-patterns",
+ "onnx-chain-quant",
+ "onnx-chain-qlinearconv",
+ "onnx-chain-uncovered-op
...[truncated]...
'test-matmul-precision.R:84:3', 'test-matmul-precision.R:95:3',
'test-vk-matmul-prec.R:71:3', 'test-vk-matmul-prec.R:93:3',
'test-vk-matmul-prec.R:108:3', 'test-vk-matmul-prec.R:133:3',
'test-vk-matmul-prec.R:149:3', 'test-vk-matmul-prec.R:175:3'
• src/ directory not found (1): 'test-headers-sync.R:17:3'
• src/ggml.h not found (1): 'test-headers-sync.R:42:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-ag-tape-memory.R:89:3'): shared storage is counted once, not once per reference ──
Expected `r$bytes_total` < `8 * one`.
Actual comparison: 494872.0 >= 263872.0
Difference: 231000.0 >= 0
── Failure ('test-ag-tape-memory.R:116:3'): shared storage is charged to the operand, not to the activation ──
Expected `r$bytes_snapshots` < `3 * one`.
Actual comparison: 296912.0 >= 98952.0
Difference: 197960.0 >= 0
[ FAIL 2 | WARN 0 | SKIP 317 | PASS 2419 ]
Error:
! Test failures.
Execution halted- ERROR12 OK, 1 ERROR2026-10-21
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-23
- ERROR12 OK, 1 ERROR2026-07-16
Show 3 earlier changesHide 3 earlier changes
- OK13 OK2026-04-30
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-16
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 794 (69 internal)includes a package overview page
- Examples that run
- 13%38 run in a plain check (3 of them under a condition) · 246 only when donttest examples are enabled (R CMD check --as-cran) · 7 never run
- Exported functions with examples
- 40%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- 01. Quickstart: from data to prediction in ~10 lines HTML
- 02. Keras-like API in ggmlR HTML
- 03. Autograd Engine HTML
- 04. tidymodels / parsnip Integration HTML
- 05. mlr3 Integration HTML
- 06. GPU / Vulkan Backend HTML
- 07. Quantization HTML
- 08. Data-Parallel Training HTML
- 09. ONNX Model Import HTML
- 10. Using ggmlR as a Backend in Your Package HTML
Show 2 moreHide 2 vignettes
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
5 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/zabis13/ggmlr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-02-06Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: CLAUDE.mdCommits: at least 1 crediting it in the message
- Claude Fable 51 commit · Jul 2026
Dependencies
Installing ggmlR adds 2 packages (0 with compiled code, 109 KB of source tarballs). Heaviest: R6 63 KB, generics 46 KB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.8.8.1Latest2026-10-22 · current release · diff ↗ ·
listed once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-22 21:24 UTC, so it stayed less than the time between readings. - 0.8.82026-10-20 · diff ↗ ·
added 46 exports
ag_argmax, ag_buffer, ag_buffer_free, ag_buffer_read, ag_buffer_write, ag_capture, ag_capture_free, ag_capture_set, ag_capture_step, ag_checkpoint, ag_concat_rows, ag_estimate_training_memory, ag_flash_attention, ag_gather, ag_get_rows, ag_grad, ag_graph_mode, ag_load_state_dict, ag_local_mode, ag_log_softmax, ag_matmul_precision, ag_max, ag_sample_categorical, ag_sample_normal, ag_slice_rows, ag_state_dict, ag_tape_memory, ggml_fit_generator, ggml_fit_opt_gen, ggml_freeze_bn_stats and 16 more - 0.8.42026-08-21 · diff ↗ ·
added 86 exports
GGML_N_TASKS_MAX, ag_layer_norm, check_grad_anomaly, clip_grad_value, ggml_attention, ggml_backend_buft_get_alignment, ggml_backend_buft_get_max_size, ggml_backend_buft_is_host, ggml_backend_buft_name, ggml_backend_dev_buffer_type, ggml_backend_dev_host_buffer_type, ggml_backend_sched_trace, ggml_build_backward_expand, ggml_build_forward_expand_grads, ggml_cast, ggml_cast_numeric, ggml_conv_1d_layer, ggml_conv_2d_layer, ggml_cross_entropy_loss, ggml_cross_entropy_loss_back, ggml_cumsum, ggml_custom, ggml_custom_inplace, ggml_custom_ops, ggml_fit_opt_multi, ggml_flash_attn_ext_add_sinks, ggml_flash_attn_ext_get_prec, ggml_flash_attn_ext_set_prec, ggml_gallocr_new_buft, ggml_gated_linear_attn and 56 more - 0.8.22026-07-22 · diff ↗
- 0.8.12026-07-13 · diff ↗ ·
added 27 exports
RunGGML, ag_load_model, ag_save_model, as_gpu_matrix, ggml_crossprod, ggml_extract, ggml_inject, ggml_matmul, ggml_matmul_f64, ggml_model_backend, ggml_ops_registry, ggml_pp_dp_forward, ggml_pp_forward, ggml_result, ggml_run, ggml_set_seed, ggml_task, ggml_tcrossprod, ggml_tp_dp_forward, ggml_training_history, ggml_vulkan_device_groups, ggml_vulkan_hard_exit_available, ggml_vulkan_p2p_selftest, ggml_vulkan_shutdown, ggml_vulkan_split_buffer_type, ggml_vulkan_split_mul_mat, ggml_vulkan_split_row_ranges - 0.7.8
- 0.7.72026-05-25 · diff ↗ ·
added 16 exports
dequantize_row_nvfp4, dequantize_row_q1_0, ggml_add_rel_pos, ggml_arange, ggml_backend_meta_device, ggml_conv_1d_dw, ggml_conv_2d_dw, ggml_conv_2d_dw_direct, ggml_conv_transpose_2d_p0, ggml_get_rel_pos, ggml_pad_reflect_1d, ggml_roll, ggml_win_part, ggml_win_unpart, quantize_nvfp4, quantize_q1_0 - RR 4.6.0 released · 2026-04-24
- 0.7.62026-04-22 · diff ↗
- 0.7.52026-04-20 · diff ↗ ·
added 6 exports
GGML_TYPE_Q2_K, GGML_TYPE_Q3_K, GGML_TYPE_Q4_K, GGML_TYPE_Q5_K, GGML_TYPE_Q6_K, ggml_conv_2d_direct - 0.7.22026-04-15 · diff ↗ ·
added 6 exports
ggml_default_mlp, ggml_marshal_model, ggml_unmarshal_model, ggml_vulkan_device_caps, ggmlr_parsnip_fit_classif, ggmlr_parsnip_fit_regr - 0.7.02026-04-06 · diff ↗ ·
added 6 exports
gguf_free, gguf_load, gguf_metadata, gguf_tensor_data, gguf_tensor_info, gguf_tensor_names - 0.6.72026-03-29 · diff ↗
- 0.6.32026-03-18 · diff ↗ ·
added 9 exports
compile, evaluate, fit, ggml_set_omp_threads, onnx_device_info, onnx_inputs, onnx_load, onnx_run, onnx_summary - 0.6.12026-02-23 · diff ↗ ·
added 107 exports
GGML_TYPE_BF16, ag_add, ag_batch_norm, ag_clamp, ag_cross_entropy_loss, ag_dataloader, ag_default_device, ag_default_dtype, ag_device, ag_dropout, ag_dtype, ag_embedding, ag_eval, ag_exp, ag_gradcheck, ag_linear, ag_log, ag_matmul, ag_mean, ag_mse_loss, ag_mul, ag_multihead_attention, ag_param, ag_pow, ag_relu, ag_reshape, ag_scale, ag_sequential, ag_sigmoid, ag_softmax and 77 more - 0.5.12026-02-09
Show 1 earlier eventHide 1 earlier event
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-02-09
- Total releases
- 15 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 2.7 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ggmlR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.