0
Fork 0
mirror of https://github.com/zml/zml.git synced 2026-11-16 19:11:09 +00:00
Commit graph

16 commits

Author SHA1 Message Date
Guillaume Wenzek
df77b33d8e
async: remove asynk, asyncc, awaitt, await_ (#325) 2025-09-18 10:05:54 +02:00
Steeve Morin
57fd9cda27
workspace: zig 0.15 (#316)
Much of the work was done by @gwenzek

Sadly we drop the torch loader in the process, to be added back later !

---------

Co-authored-by: Guillaume Wenzek <wzk@zml.ai>
2025-08-27 14:11:22 +02:00
Guillaume Wenzek
ee1163a113
Bump rules_zig, add zig_srcs targets, cleanup build (#267)
This is the non-controversial part of #262 

It contains:
* the new `zig_srcs` helper,
* bug fix related to sources in rules_zig,
* cleanups of zml/BUILD.bazel
* test fixes in async/coro.zig (those tests weren't run in CI but now
are)
* disabled nemo and yaml models loader (don't compile anymore since
0.14.0 bump)
2025-07-15 14:18:15 +02:00
Corentin Godeau
a6469229d2
async: use stronger memory ordering (#268)
This was probably causing a segfault on some specific ordering of
things.
2025-06-18 12:55:36 +02:00
Corentin Godeau
1bd161d46c
async: TCP connect fixes (#219)
Co-authored-by: Jean-Baptiste Dalido <jb@zml.ai>
2025-04-08 10:51:33 +02:00
Hugo Mano
d0f5f0c7be
async: detect xev only if the API is dynamic (fix macOS) (#216)
ref: 94ed6af7b2/src/dynamic.zig (L44)
2025-03-27 15:26:28 +01:00
Hugo Mano
6be509e5b6
async: detect xev most preferable backend to use (#212)
Since change allow use to leverage io_uring instead of xev if the
backend is supported.
2025-03-25 16:41:58 +01:00
Steeve Morin
cb1010948b
workspace: bump to libxev=20250222.0-07bcffa (#197)
This introduces `Dynamic`, which will switch between IO Uring and Epoll
in linux depending on availablity.
2025-03-03 16:46:34 +01:00
Steeve Morin
f0c2be0280
async: async mutex on log and fixes on ResetCondition (#166)
Stop using a real mutex for the `logFn` and use an `Mutex` and allow for
a fallback logger if outside a coroutine.
2025-01-24 20:58:14 +01:00
Rene Schallner
f41e023e22
zml/tokenizer: use HuggingFace Tokenizers and SentencePiece & Llama improvements (#162)
# HF tokenizers & Llama improvements

1. Added HuggingFace tokenizer and SentencePiece bindings, removed old
tokenizers
2. Improved Llama example

## 1. zml/tokenizer: add HuggingFace tokenizers binding, remove old
tokenizers

`zml.Tokenizer` now uses the new HuggingFace tokenizer bindings when
loading a `tokenizer.json`.

To move fast, we dropped the `tinyllama`, `gguf`, and `sentencepiece`
tokenizers.

## 2. examples/llama

Changes to the llama example:

- config.json support -> less cmdline flags
- switched to [zig-clap](https://github.com/Hejsil/zig-clap) for cmdline
args parsing
- using HuggingFace tokenizer
- re-worked and simplified the code
    - single token prediction
- removed esoteric models from BUILD.bazel
- default container now uses Llama-3.2-1B-Instruct

---------

Co-authored-by: Steeve Morin <steeve@zml.ai>
Co-authored-by: Corentin Godeau <corentin.godeau@zml.ai>
Co-authored-by: Corentin Kerisit <corentin.kerisit@gmail.com>
2025-01-24 18:25:57 +01:00
Steeve Morin
f228ec2edc
async: fix async hangs (#154)
Rework the libxev epoll backend to play nice with zigcoro based
scheduler.

In the process, load the PJRT plugins using `callBlocking` because it
can a bit slow sometimes.

Should have a slight performance increase, too.
2025-01-18 00:50:51 +01:00
Steeve Morin
5309a25420
async: vendor zigcoro and unify APIs (#152)
This PR merges zigcoro inside the repo and reworks its internals to play
well with `stdx.meta`.

It also adds `Channel.try_{send,recv}` methods as well as dynamically
sized channels (with a `comptime` capacity).

Although not used, it also introduces a `PoolStackAllocator` for
allocating coroutine stacks from a pool
2025-01-14 19:33:16 +01:00
Steeve Morin
44d1b24beb
async: add threaded implementation (#77)
This implements the `async` module using a thread pool. This is now the
default.

Implementations can be swapped using the
`@zml//async:impl=[threaded,zigcoro]` flag.

Because io_uring is not enabled in the default seccomp profile, some
container implementations will block on io_uring calls. Use the threaded
implementation to work around this, for now.
2024-11-05 16:47:41 +01:00
Steeve Morin
ccd925309b
async: rename async_ to asyncc and add Generic slugs (#71)
`asyncc` is arguably nicer to write than `async_`, so use that.

Also, add an explicit `Generic` version that can work with `anytype`
functions (but on which type inference will be disabled).
2024-11-01 17:36:08 +01:00
Guillaume Wenzek
ec9f69add7
zml: remove pjrtx (#38)
pjrtx.zig was mean to be a ZML specific wrapper over pjrt.zig.
But pjrt.zig in its current form is pretty usable without wrapper,
the extra layer of indirection is IMHO confusing because it mostly
transfer the calls directly to pjrt.zig but make some call suspending.

I moved the few helpers left in pjrtx.zig where they are used, ie 

`pjrtx.Buffer.bufferFromHostBuffer`-> in `buffer.Buffer.from`
`pjrtx.Client.compile` -> in `module.compileModuleToPjrtExecutable`
`pjrtx.Event.await` -> `zml.Platform.awaitEvent()`

This also fix a bug in `pjrtx.Event.await` which was blocking for the
event before suspending for the event.
2024-10-04 09:32:53 +02:00
Steeve Morin
13d84615bb zml: initial release 2024-09-17 11:11:18 +02:00