mirror of
https://github.com/zml/zml.git
synced 2026-11-16 19:11:09 +00:00
Resuming work from @hugomano #244 This is still a bit experimental. The core API is here, but there are some caveats. ZML should help with copying buffers to host memory (which is often needed) but I'm not sure the current implementation using PJRT is good: - does it allow graph capture - what's the overhead ? We should probably use directly cuMemcpy here instead of going through PJRT. Current implem should work with all plugins though. This fix `tensor.print()` I've also made a slightly more interesting examples/callback that manually calls a cuda kernel. (there are other way to achieve this but this shows you can do whatever you want with `zml.callback` Note: the feature was originally named `custom_call` but it was conflicting with existing bindings for xla builtin custom calls, that are fully handled by the backend. So I renamed it to `callback` --------- Co-authored-by: Hugo Mano <hugo@zml.ai>
11 lines
198 B
11 lines
198 B