Package: zulm 0.1.0

zulm: Tensor Graphs, Training and Inference on 'ggml'

Builds computation graphs of tensors in R, runs them on the central processing unit (CPU), differentiates them and trains their parameters, through the 'ggml' tensor library (<https://github.com/ggml-org/ggml>) bundled in its CPU subset. Graphs are built once per input shape and run many times; the same operations train small and medium neural networks with the AdamW (Loshchilov and Hutter (2019) <doi:10.48550/arXiv.1711.05101>) and stochastic gradient descent (SGD) optimisers, and run pretrained transformer checkpoints read from safetensors files or from GGUF files, the model file format of 'ggml'. Results reproduce bit for bit at a fixed seed whatever the thread count. A versioned C interface lets other packages build models on top.

Authors:Pedro Baltazar [aut, cre, cph], The ggml authors [cph], Mozilla Foundation [cph], Jeffrey Quesnelle [cph], Bowen Peng [cph], The Apache Software Foundation [cph]

zulm_0.1.0.tar.gz
zulm_0.1.0.zip(r-4.7-x86_64)zulm_0.1.0.zip(r-4.7-arm64)zulm_0.1.0.zip(r-4.6-x86_64)zulm_0.1.0.zip(r-4.6-arm64)zulm_0.1.0.zip(r-4.5-x86_64)
zulm_0.1.0.tgz(r-4.6-x86_64)zulm_0.1.0.tgz(r-4.6-arm64)zulm_0.1.0.tgz(r-4.5-x86_64)zulm_0.1.0.tgz(r-4.5-arm64)
zulm_0.1.0.tar.gz(r-4.7-arm64)zulm_0.1.0.tar.gz(r-4.7-x86_64)zulm_0.1.0.tar.gz(r-4.6-arm64)zulm_0.1.0.tar.gz(r-4.6-x86_64)
zulm_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
zulm/json (API)

# Install 'zulm' in R:
install.packages('zulm', repos = c('https://pedrobtz.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/pedrobtz/zulm/issues

Pkgdown/docs site:https://pedrobtz.github.io

On CRAN:

Conda:

2.38 score 12 scripts 91 exports 2 dependencies

Last updated from:b9a52d74e8. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK150
linux-devel-x86_64OK307
source / vignettesOK298
linux-release-arm64OK195
linux-release-x86_64OK298
macos-release-arm64OK140
macos-release-x86_64OK425
macos-oldrel-arm64OK145
macos-oldrel-x86_64OK294
windows-devel-arm64OK450
windows-devel-x86_64OK380
windows-release-arm64OK405
windows-release-x86_64OK208
windows-oldrel-x86_64OK327
wasm-releaseOK125

Exports:zl_abszl_adalnzl_adamwzl_arrow_batcheszl_attentionzl_blockzl_castzl_causal_maskzl_clampzl_concatzl_contzl_coszl_cross_entropyzl_crossprodzl_cumsumzl_embeddingzl_expzl_flash_attentionzl_forwardzl_geluzl_get_rowszl_gradzl_graphzl_graph_cachezl_graph_infozl_init_normalzl_init_oneszl_init_uniformzl_init_zeroszl_intzl_layer_normzl_linearzl_loadzl_load_safetensorszl_logzl_maezl_mean_rowszl_mlpzl_msezl_nextzl_noise_normalzl_noise_uniformzl_normzl_padzl_paramzl_param_countzl_param_getzl_param_nameszl_param_setzl_param_tensorzl_paramszl_permutezl_reluzl_resetzl_reshapezl_rms_normzl_rng_normalzl_rng_uniformzl_ropezl_safetensors_readzl_savezl_save_safetensorszl_scalezl_seedzl_sgdzl_sigmoidzl_siluzl_sinzl_softmaxzl_softpluszl_sqrzl_sqrtzl_statezl_state_getzl_state_setzl_state_writezl_stepzl_sumzl_sum_rowszl_swigluzl_tzl_tanhzl_threadszl_time_embeddingzl_trainerzl_trainer_loadzl_trainer_savezl_trizl_viewzl_wherezulm_info

Dependencies:zujsonzurand

Readme and manuals

Help Manual

Help pageTopics
Optimiserszl_adamw zl_sgd
Batches from Arrow streamsprint.zl_arrow_batches zl_arrow_batches zl_next
Convert a tensor's typezl_cast
Flash attentionzl_flash_attention
Build and run graphszl_forward zl_graph zl_graph_info zl_int
Graphs built once per input shapeprint.zl_graph_cache zl_graph_cache
Initialisers for parameterszl_init_normal zl_init_ones zl_init_uniform zl_init_zeros
Random draws inside a graphzl_noise_normal zl_noise_uniform
Parameter storeszl_param zl_params zl_param_count zl_param_get zl_param_names zl_param_set zl_param_tensor
Random draws, in Rzl_rng_normal zl_rng_uniform
safetensors fileszl_load_safetensors zl_safetensors_read zl_save_safetensors
Save and load parameters as GGUFzl_load zl_save
The session's random-number keyzl_seed
State tensorszl_state zl_state_get zl_state_set zl_state_write
Threadszl_threads
Train a graphzl_grad zl_step zl_trainer
Save, load and reset a trainer's optimiser statezl_reset zl_trainer_load zl_trainer_save
Arithmetic, reductions and elementwise functions on tensorszl-arith zl_abs zl_cos zl_cumsum zl_exp zl_gelu zl_log zl_mean_rows zl_relu zl_scale zl_sigmoid zl_silu zl_sin zl_softplus zl_sqr zl_sqrt zl_sum zl_sum_rows zl_swiglu zl_tanh
Attention pieces and normalisationzl-attention zl_causal_mask zl_layer_norm zl_rms_norm zl_rope zl_softmax
Losseszl-loss zl_cross_entropy zl_mae zl_mse
Moduleszl-modules zl_adaln zl_attention zl_block zl_embedding zl_linear zl_mlp zl_norm zl_time_embedding
Selection, clipping and triangleszl-select zl_clamp zl_tri zl_where
Products and shapes of tensorszl-shape zl_concat zl_cont zl_crossprod zl_get_rows zl_pad zl_permute zl_reshape zl_t zl_view
Build and runtime informationzulm_info
Conditions signalled by zulmzulm-conditions