Commit Graph

296 Commits

Author SHA1 Message Date
cc969bd532 Add experimental zml.callback API (renamed from custom_call) and fix tensor.print(); update PJRT bindings, host buffer utilities, and related core ZML modules. 2025-08-20 10:27:54 +00:00
1fa056a790 Add example and Bazel build for zml.callback demonstrating a manual CUDA kernel invocation. 2025-08-13 12:14:53 +00:00
01da2184fe xla: bump to commit b3fbfee, temporarily disable libnvptxcompiler due to missing support in PjRT CUDA plugin v13.0, add nvshmem to sandbox for PjRT CUDA plugin 2025-08-12 13:32:18 +00:00
f35119f768 ci: revamp commit workflow, deduplicate workflows, fix Linux linking issue introduced by upb, resolve duplicated _start symbol in test targets, temporarily use -c opt to bypass static archive bug 2025-08-08 13:51:27 +00:00
9e3cd6d616 bump runtimes/* code to Zig 0.15.1, restore PyTorch loader using std.fs.File, update CI zig fmt, remove stdx.io, note remaining issues with Neuron and CUDA debug builds 2025-08-07 15:09:27 +00:00
0ed7f5c907 Add Zig example programs for LLaMA, ModernBERT, and SimpleLayer, including a Bazel BUILD file for the LLaMA example. 2025-07-29 16:07:11 +00:00
488a844a0f Add Zig 0.15 compatibility: update BUILD files, async primitives, stdx utilities, MLIR dialects, and PJRT FFI. 2025-07-28 13:54:28 +00:00
e3b7705e3d Remove gguf and torch loader implementations and related BUILD and test assets. 2025-07-24 17:19:43 +00:00
01db09c24b Update MNIST example (BUILD.bazel and mnist.zig) to remove torch loader references. 2025-07-23 12:53:46 +00:00
1cf26756a1 workspace: run buildifier, drop rules_uv, refactor tools/hf dependencies 2025-07-16 10:01:41 +00:00
1427286716 runtimes/neuron: fix neuron runtime
This PR fixes the neuron runtime with the following:

Proxy the PJRT Api method to enforce the client struct sizes since the
neuron PJRT plugin doesn't use `>=` but `==` to assert them, breaking
PJRT compatibility guarantees.
Fixes https://github.com/aws-neuron/aws-neuron-sdk/issues/1095

Reimplement `libneuronxla` in Zig to control neuronx-cc sandboxing and
invocation.

Implement a python bootstrapper in Zig to create a full blown
`neuronx-cc` executable, avoiding the infamous chicken and egg problem
of python executables boostrapping when sandboxed (due to fixed path
shebangs).

---------

Co-authored-by: Corentin Kerisit <corentin.kerisit@gmail.com>
2025-07-15 15:26:03 +00:00
e1ee340306 runtimes/cuda: implement zmlxcuda in Zig 2025-07-08 09:25:25 +00:00
c488b634fc runtimes/rocm: implement zmlxrocm in Zig
Also, sandbox `amdgpu.ids` and restore safetensors json parsing.
2025-07-07 16:48:07 +00:00
a512b9c8a2 Update docs and example BUILD files to reflect the switch from zig_cc_binary to zig_binary. 2025-07-04 15:10:46 +00:00
cf00506dbb Switch workspace build rules from zig_cc_binary to zig_binary, removing the hack and using the C linker directly. 2025-07-03 15:10:36 +00:00
78679817df zml: remove nemo, sentencepiece loaders, remove zig-yaml
Progress towards
2025-06-24 15:39:55 +00:00
fe56f03f5d third_party/xla: de-modularize xla
This PR intends to remove XLA as a bzlmod and transfer it as a non
bzlmod dep.

This is because this module will never be upstreamed as is, so keep it
private.

Also, we fetch llvm-raw and stablehlo from it, which is fine.

While there, dummify the various local_config XLA symbols to please the
imports, as we don't use those parts in ZML itself.

Closes
2025-06-23 09:13:43 +00:00
a540564744 Remove example workspace and related documentation files. 2025-06-20 13:23:06 +00:00
e789e26008 Remove examples workspace and clean up related Bazel BUILD/MODULE files and Zig build scripts. 2025-06-19 09:30:29 +00:00
0716f2dc0e Update examples/MODULE.bazel.lock to reflect the switch from zig‑protobuf to upb. 2025-06-10 16:04:53 +00:00
1b58c34b8c Update ZML build configuration to replace zig-protobuf with upb library. 2025-06-09 16:34:20 +00:00
cba3be4859 pjrt,zml: remove profiler
Closes

Progress towards
2025-06-06 12:24:42 +00:00
7fb02e1888 Update docs: add deployment guide, Hugging Face token instructions, getting‑started tutorial, and include a Bazel lock example. 2025-06-05 13:18:14 +00:00
f9280b1069 Add Bazel MODULE and tool build configuration (BUILD, requirements) for packaging the HF CLI. 2025-05-30 16:42:57 +00:00
111afcdd95 examples/llama: switch to --hf-model-path flag
Instead of giving config, model weights and tokenizer paths, rely on
`huggingface-cli` download.
2025-05-28 13:21:00 +00:00
5a49a3e8ca Update examples MODULE.bazel.lock to reflect the added sandbox neuron dependencies. 2025-05-22 10:10:14 +00:00
1a2b862ec2 Add sandbox neuron dependencies: define a trampoline PJRT, create an empty repository for distroless deps, and update Bazel build files and Zig/C sources accordingly. 2025-05-19 17:35:33 +00:00
9e66d5a06a Update examples/MODULE.bazel.lock to reflect new dependencies. 2025-05-16 11:26:13 +00:00
55c5b540f8 Add XLA 20250718.0‑6319f0d with ROCm 6.4.1 support, update Bazel module files and runtime configs, and apply migration, FFI‑handler and header‑cleanup patches. 2025-05-12 12:10:27 +00:00
cba9ce9615 protobuf, libxev: remove usingnamespace
remove usingnamespace from libxev and zig-protobuf

relevant PRs:
* libxev:
7f803181b1
 * zig-protobuf: https://github.com/zml/zig-protobuf/pull/1/files

This means we can now build ZML with `-fincremental` (in debug mode only
and linux x86-64)

---------

Signed-off-by: Guillaume Wenzek <wzk@zml.ai>
2025-05-06 11:58:20 +00:00
db303a6010 remove usingnamespace from asyncio
Eliminate the final usingnamespace usage, which will be deprecated in version 0.15.0.
2025-05-05 09:03:06 +00:00
ed5ae31338 runtimes/rocm: fetch libdrm from amdgpu repository and add amdgpu.ids layer 2025-04-30 15:53:51 +00:00
47146fc088 workspace: remove glibc version constraint, update rules_rust, and re-enable frame pointers following sandboxing changes. 2025-04-29 12:09:13 +00:00
e7323be10b runtimes/rocm: switch to in-process LLD, removing the need for sandboxed lld. 2025-04-23 11:43:18 +00:00
02ba41ea57 Update examples/MODULE.bazel to bump rules_zig version and fix static‑lib inclusion for non‑exe targets. 2025-04-21 13:51:52 +00:00
f5f3dc6b1b Update rules_zig to 20250714.0-b14a4f1 and fix static‑lib inclusion in runfiles for non‑exe targets. 2025-04-18 12:09:38 +00:00
7d9fdf94e7 runtimes/rocm: sandbox ROCm dependencies and ensure they load on the main thread due to TLS usage in static C++ destructors. 2025-04-14 16:38:15 +00:00
eba0e72532 runtimes/tpu: sandbox TPU PJRT plugin; no external dependencies. 2025-04-10 14:47:16 +00:00
8073e45894 Update examples/MODULE.bazel.lock to reflect bumped hftokenizers dependency. 2025-04-09 10:21:44 +00:00
4294a4d08f Bump hftokenizers dependency versions in Bazel and Cargo lockfiles (MODULE.bazel.lock, Cargo.toml, Cargo.lock) 2025-04-04 12:54:33 +00:00
78d7b672e7 runtimes/cpu: sandbox CPU PJRT plugin, simplifying as there are no additional NEEDED dependencies. 2025-04-03 11:57:46 +00:00
2d321d232d runtimes/cuda: sandbox CUDA dependencies by removing them from the leaf binary, sandboxing the dependency graph, marking dlopen direct dependencies as NEEDED, setting RPATH to the sandbox, loading the PJRT plugin from the sandbox, and enabling weak CUDA symbols without direct linking. 2025-03-26 11:18:29 +00:00
a5420068b1 pjrt: emit warning instead of panic when FFI Extension is missing (e.g., on TPU). 2025-03-24 09:40:44 +00:00
dc121fce4f Update example MODULE.bazel and lockfile to reflect toolchains_llvm_bootstrapped bump to 0.2.4. 2025-03-20 12:17:30 +00:00
907577525f Update MODULE.bazel and lockfile to bump toolchains_llvm_bootstrapped to version 0.2.4. 2025-03-18 11:47:22 +00:00
f27a524f31 Update rules_zig: add zig_srcs target, fix source handling bug, clean up BUILD files, adjust async/coro.zig tests, and disable nemo and yaml model loaders. 2025-03-13 12:27:21 +00:00
6fc1148206 async/coro: make coroutines unwindable by zeroing the initial stack region, preventing random unwinding behavior and SIGSEGV during _Unwind_Backtrace. 2025-03-10 16:25:45 +00:00
f63c673f45 bazel: add RPATH manipulation to patchelf 2025-03-05 11:56:40 +00:00
9488672d4b workspace: bump xla to version 20250710.0-22ea002
Also:
- Bump XLA deps : `com_github_grpc_grpc` and `com_google_protobuf`
- Inject `rules_ml_toolchain`
- Fix `zig_proto_library` rule
2025-03-04 17:12:34 +00:00
fa0ed045ef runtimes/cuda: downgrade cuda and cudnn
This commit reverts part of https://github.com/zml/zml/pull/238/files
This is required because XLA has a strong dependencies on CUDA 12.8 and
upgrading to 12.9 is impossible due to
https://github.com/NVIDIA/cccl/issues/4967
2025-02-28 17:36:12 +00:00