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
remote-exec
zml
/
examples
/
callback
/
main.zig
214 lines
7.7 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
zml/aio: fix pickle loader for Zig 0.15.2 (#354) zig 0.15.2 changed the meaning of `reader.takeDelimiterExclusive` to not consume the separator. I rewrote the code to use `takeDelimiterInclusive` since we want to consume the delimiter.
2025-10-22 17:43:44 +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
zml/aio: fix pickle loader for Zig 0.15.2 (#354) zig 0.15.2 changed the meaning of `reader.takeDelimiterExclusive` to not consume the separator. I rewrote the code to use `takeDelimiterInclusive` since we want to consume the delimiter.
2025-10-22 17:43:44 +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