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.
nn_functional_graph_size(model)A double, the graph size to allocate.
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.