View source: R/backend_ops_test.R
| ggml_test_backend_ops | R Documentation |
Runs each supported operation on backend and on the CPU with identical
inputs, and reports the normalized mean squared error between the two. This is
the differential test used to find operations whose accelerated implementation
disagrees with the reference one.
ggml_test_backend_ops(backend, filter = NULL)
backend |
Backend pointer, e.g. from |
filter |
Optional substring; only operations whose name contains it are
run. |
Each case is executed three times against the same allocated graph and the final run is the one compared, so faults that only appear when a graph is re-executed are visible. That matters: both backend defects found in this package so far were of that kind – the first run was exact and later ones were not.
A data frame with columns op, nmse and note.
nmse is NA when the case could not be run, and note
then says why.
if (ggml_vulkan_available()) {
be <- ggml_vulkan_init(0)
res <- ggml_test_backend_ops(be)
res[res$nmse > 1e-6, ] # operations that disagree
ggml_backend_free(be)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.