Commit Graph

119 Commits

Author SHA1 Message Date
f00538667e zml.nn: add dynamic sampling with support for top‑k, top‑p, and min‑p settings. Implements token index computation based on the selected sampling strategy, including options for top_k, max_top_k, top_p, and min_p. 2023-06-16 14:34:18 +00:00
b244a18621 zml: set iota default dtype to .i32, with fallback to .i64 for axes with many elements, simplifying usage. 2023-06-15 12:45:52 +00:00
344e07fb6e stablehlo: extend dot_general API to include DotAlgorithm support by merging precision and algorithm attributes into a union, aligning with spec requirements. Currently not exposed to users due to limited algorithm support. 2023-06-07 11:20:25 +00:00
6d720126ac Add PJRT custom call integration with generic zmlHostBufferCallback to copy tensors to host and invoke user callbacks. Introduce Tensor.print() method to output runtime tensor values (CUDA‑specific, uses a pre‑allocated host buffer). 2023-06-05 13:42:45 +00:00
bf23eef0d9 examples: clean up inconsistencies in asynk usage across the codebase. 2023-06-01 16:11:58 +00:00
499b0d20e5 pjrtx: change behavior to return an error when OpenXLA fails to serialize the new batching_dim attribute for gather/scatter, instead of panicking. 2023-05-29 17:18:19 +00:00
52ef20f981 zml: reintroduce pjrtx to handle reactor blocking issues in async scenarios, particularly with Events. 2023-05-26 15:54:15 +00:00
c68ec4bc5c async: implement default threaded backend using a thread pool. Backend selectable via @zml//async:impl flag (threaded or zigcoro). Provides workaround for environments where io_uring is unavailable. 2023-05-25 16:02:11 +00:00
89cf2233d3 zml/aio: enable reading metadata from index.json for sharded safetensor files, allowing metadata storage alongside model config. 2023-05-23 15:06:59 +00:00
2f54e2a5f3 zml.tensor: add triangular operator to zero out the upper‑right matrix region with configurable offset, and toDiagonal (diag_embed) to embed a vector as a diagonal matrix, correcting previous diag naming. Also add ELU activation under zml.nn.Activation. 2023-05-18 16:39:21 +00:00
05faa5021e zml.tensor: add cumulativeSum operator and refactor maxPoolND. Introduce cumulative sum using reduceWindow. Simplify reduceWindow signature by merging padding_shape and padding_value. Update maxPool1D/2D to accept tuple arguments. Revise pad to use tagged or AOS syntax; remove SOA syntax. 2023-05-17 09:01:27 +00:00
54e7eb30b4 Introduce a thin abstraction layer between ZML and PJRT to manage plugin loading decisions, enable compile‑time detection of linked runtimes, and handle cases such as libtpu blocking metadata access. 2023-05-15 09:36:41 +00:00
74e90855ca Configure the runfiles environment globally at context start to ensure Bazel-built binaries locate their runfiles correctly. 2023-05-12 11:40:23 +00:00
57130577e9 Add fallback for runtimes lacking PJRT_Event by using thread‑pool dispatch for buffer copies and treating operations as synchronous when events are absent. 2023-05-09 12:44:56 +00:00
672df8fa2f Update tutorial and example code to use the new asyncc name and Generic slugs. 2023-05-08 16:58:45 +00:00
5543c8192f Rename async_ to asyncc and add Generic async slugs in async.zig, aio.zig, and module.zig. 2023-05-04 14:44:12 +00:00
cfe38f27ca Switch ROCm dlopen handling to patchelf's rename_dynamic_symbols for more robust dynamic symbol import. 2023-05-03 17:33:46 +00:00
fefd84b1bb Replace silu implementation with stablehlo.logistic for higher precision, move logistic logic into sigmoid and alias logistic to sigmoid (breaking change). 2023-05-01 10:40:50 +00:00
021111d07d Extend tests to handle all float types, preventing crashes with bfloat16 tensors. 2023-04-27 10:34:27 +00:00
e0fd7f8d97 Fix typographical errors in the documentation. 2023-04-25 16:04:09 +00:00
477e13afd0 Add missing zig_cc_binary import to the simple layer example in the documentation. 2023-04-24 10:04:50 +00:00
ed6444b775 Add Tensor.concatenate support, begin deprecating broadcastLeft, and compute transformer head scaling constant in f32 for higher precision. 2023-04-21 15:55:07 +00:00
11006ca08d Refactor torch module: merge PickleData into Parser as torch.File, rename value file to py_object.zig, use buffered reader for pickle and zip headers, adjust intermediate result handling, simplify Python dict representation, separate kwargs from args, and add extensive tests for long integers, protocol 0, zipped pickle, and a complex PyTorch Conv2d case; also streamline BufferStore initialization. 2023-04-20 15:43:18 +00:00
837f8fb111 Add support for the Llama 3.1 70B Instruct model to facilitate testing on high‑performance accelerators. 2023-04-19 10:23:44 +00:00
fdb7da5c9b Introduce sharding attributes to Llama weights to enable Tensor Parallelism. 2023-04-13 12:35:27 +00:00
833ff5f28d Upgrade PJRT CUDA Plugin to version 0.2.3, adding NCCL support for correct sharding. 2023-04-12 15:47:06 +00:00
8e43a45a3c Add event waiting when invoking a module and improve multi‑device sharding handling. 2023-04-11 11:32:09 +00:00
0189b71070 Rename zml.aio.Value to zml.aio.Metadata, simplify its type variants, and update torch pickle/eval APIs accordingly. 2023-04-07 16:45:58 +00:00
aea23c720e Update Llama example to use renamed zml.aio.Metadata (formerly Value) and reflect torch loader changes. 2023-04-05 14:09:59 +00:00
e25f70d923 Rename and simplify modules in zml/aio/torch: replace redundant qualified names, remove generic utilities, inline code, reorder functions for top‑to‑bottom readability, and extract parsing logic into parseTensor and parseStorage functions. 2023-04-04 17:20:53 +00:00
66881899ca Fix testLayer by removing unnecessary compile_options argument and updating testing logic for new sharded output, ensuring proper usage by llama.zig. 2023-03-31 14:23:45 +00:00
05d23beb23 Add Normalizer.fromHfJson to read HuggingFace tokenizer JSON and map to internal options, including a configurable magic space token and a debug flag for token merges. Adjust default handling of extra whitespaces to align with HF defaults. 2023-03-29 16:10:29 +00:00
ef922e3aea Fix empty JSON array handling in safetensor metadata loader and refactor torch loader (make ops slices const and improve readability). 2023-03-28 16:17:00 +00:00
aae37738a5 Update loader example to demonstrate handling of empty JSON arrays and improved torch loader readability 2023-03-22 14:52:33 +00:00
a4f0fc96c0 Integrate user sharding hints and HLO sharding annotations across MLIR dialects and ZML core, and remove the now‑unused module options arguments. 2023-03-21 10:50:39 +00:00
e30e35deeb Update benchmark example to use new user sharding hints and drop deprecated module options. 2023-03-20 15:31:44 +00:00
8746a5ce78 Expose zml/test_runner.zig publicly to enable users to employ the async test runner. Made the dependency on zml explicit and suggest treating test_runner as a zig_library rather than a filegroup. 2023-03-16 13:22:35 +00:00
fe531aef06 Clarify HuggingFace token handling in workspace, noting the standard CLI location and adding support for an environment variable. 2023-03-14 15:28:03 +00:00
cd2f2209d0 Create token directory if it does not exist. 2023-03-13 15:31:13 +00:00
70d40208a2 runtimes/cuda: Fix version variable definitions in the build script to enable successful CUDA builds. 2023-03-09 11:31:02 +00:00
7ef67eea27 zml: Relocate tests next to the functions they verify and remove obsolete dynamicSlice1d test. 2023-03-08 14:10:11 +00:00
dfa71018a5 zml: Remove pjrtx wrapper, migrate remaining helpers to their native modules, and fix blocking issue in Event.await. 2023-03-06 17:05:56 +00:00
0c126c2e12 runtimes/cuda: Upgrade CUDA to 12.6.2 and cuDNN to 9.4.0. 2023-03-03 15:17:26 +00:00
f595d22134 runtimes/rocm: Upgrade ROCm to version 6.2.2. 2023-03-01 13:15:50 +00:00
ecf52ad724 zml.tokenizer: Implement proper byte fallback support by converting hex byte strings (e.g., “<0x40>”) to their characters and splitting unknown UTF‑8 codepoints into bytes, fixing tokenization. 2023-02-28 14:40:25 +00:00
2f129f76c9 Add in-process sharding support across core ZML components (platform, shape, tensor, MLIR generation, buffers, and PJRT integration) 2023-02-24 17:33:14 +00:00
cad1a688da Add sharding usage to the benchmark and simple_layer example programs. 2023-02-23 11:18:27 +00:00
fc718ab649 Add StableHLO bindings for versioning functions, enabling portable serialization of StableHLO. 2023-02-22 15:41:33 +00:00
8fa3878fc3 PJRT: Add handling for rank‑0 case in getDimensions to avoid null pointer usage when num_dims is zero. 2023-02-17 10:47:15 +00:00
639f5cd994 Replace log with select for generating the attention mask to avoid NaNs on zero values. 2023-02-16 10:36:23 +00:00