nn_functional_graph_size: Estimate the scheduler graph size a functional model needs

View source: R/nn_functional.R

nn_functional_graph_sizeR Documentation

Estimate the scheduler graph size a functional model needs

Description

The backend scheduler sizes its hash set once, before the graph exists, and aborts inside ggml if the graph turns out larger. Most layers contribute a handful of nodes, but a recurrent layer unrolls per timestep, so the count has to follow the sequence length rather than the layer count.

Usage

nn_functional_graph_size(model)

Details

Generous on purpose: the cost of overshooting is a slightly larger hash set, the cost of undershooting is a crash with no R-level error to catch.

Value

A double, the graph size to allocate.


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.