This website requires JavaScript.
About
Status
₊˚⊹Discord
Explore
Register
Sign in
Reference in a new issue
Blame
Copy permalink
Reference in a new issue
Copy permalink
DKB
/
zml
Star
0
Fork
You've already forked zml
0
mirror of
https://github.com/zml/zml.git
synced
2026-11-16 19:11:09 +00:00
Code
Issues
23
Releases
1
Packages
Activity
gw/flat_bufferized
zml
/
examples
/
callback
/
main.zig
218 lines
7.9 KiB
Raw
Permalink
Normal View
History
zml: callback api (#319) 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>
2025-09-04 16:57:34 +02:00
async: remove asynk, asyncc, awaitt, await_ (#325)
2025-09-18 10:05:54 +02:00
zml: callback api (#319) 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>
2025-09-04 16:57:34 +02:00
async: remove asynk, asyncc, awaitt, await_ (#325)
2025-09-18 10:05:54 +02:00
zml: callback api (#319) 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>
2025-09-04 16:57:34 +02:00
async: remove asynk, asyncc, awaitt, await_ (#325)
2025-09-18 10:05:54 +02:00
zml: callback api (#319) 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>
2025-09-04 16:57:34 +02:00