View source: R/backend_ops_test.R
| ggml_test_adamw_steps | R Documentation |
Runs ggml_opt_step_adamw() for several steps on backend and on
the CPU from the same starting weights and the same gradients, and reports the
weight checksum after each step.
ggml_test_adamw_steps(backend)
backend |
Backend pointer to compare against the CPU. |
This needs its own function rather than a case in
ggml_test_backend_ops: the op updates the weights and both
moment buffers in place, so step N depends on every step before it, and the
bias-correction terms it receives change every step. Comparing a single
execution proves nothing here – the first Adam step agrees bit-for-bit on
both backends and the disagreement only starts at the second.
A data frame with step, w_cpu, w_backend and
abs_diff, or a one-column data frame with note when the op
could not be run.
ggml_test_backend_ops
if (ggml_vulkan_available()) {
be <- ggml_vulkan_init(0)
print(ggml_test_adamw_steps(be))
ggml_backend_free(be)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.