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

421 lines
13 KiB

2024-09-17 11:11:18 +02:00
2026-02-16 19:59:38 +00:00
zml/tokenizer: add IREE tokenizer (#416) Adding the [IREE tokenizer](https://github.com/iree-org/iree/blob/main/runtime/src/iree/tokenizer/README.md).Being made from the ground up with streaming (de-)tokenization in mind, I've extended the APIs to expose a `std.Io.Writer` for the tokenization. I've quickly benchmarked IREE's tokenizer vs HuggingFace's one with a request I retrieved from a coding agent (opencode) in the middle of a session. The request body was 360KB encoded in 95K tokens. I also did another test with a similarly sized request with the same results as shown hereafter. I've tested two cases: - oneshot: the template is rendered all at once and only then we encode the whole string. - stream: the template rendering and encoding are pipelined to avoid the intermediate allocation. There is a slight difference in the generated tokens between HuggingFace and IREE. Some tokens like `introdu` were encoded as `i`, `n`, `t`, etc. Decoding them returns the same text. It's very close in terms of total token count: - hf: 95779 - iree/stream: 95705 - iree/oneshot: 95587 | Model | IREE avg (oneshot / stream) ms | HuggingFace avg (ms) | Uplift vs HF (oneshot / stream) | |---|---:|---:|---| | liquidai/LFM2.5-1.2B-Instruct | 8.5 / 7.3 | 40.5 | 4.8x / 5.5x | | Qwen/Qwen3.5-9B | 6.0 / 8.2 | 59.4 | 9.9x / 7.2x | | mistralai/Ministral-3-3B-Reasoning-2512 | 7.4 / 6.9 | 59.2 | 8x / 8.6x | It's unclear why the Qwen's chat template is somehow slower in the stream case, maybe because there are more writes. Adding non-empty buffer in the interface helps a bit, but tends to slow down mistral case. So well --------- Co-authored-by: Corentin Kerisit <corentin.kerisit@gmail.com>
2026-04-07 16:42:55 +02:00
platform/intel: bump oneapi=2026.1 and rules_distroless=0.8.0 (#644) # Bump intel oneapi and rules_distroless The Debian package set is now also exposed separately through the rules_distroless APT extension: Now use `rules_distroless` to install the oneAPI packages in a distroless container image. So the platforms/oneapi/packages.lock.json file is now generated from the platforms/oneapi/packages.yaml file, and the packages.yaml file is now the source of truth for the oneAPI packages. The MODULE.bazel contain rules_distroless patch `third_party/rules_distroless/accept-nospace-version-constraints.patch` because the rules_distroless APT extension does not support version constraints with spaces, e.g. `>= 2023.2.0` is not supported, but `>=2023.2.0` is supported. A PR has been submitted to rules_distroless to fix this issue, but until it is merged and released, the patch is needed in zml https://github.com/bazel-contrib/rules_distroless/pull/229. `_ROOT_MODULE_DIRECT_DEPS` does not need anymore to list the individual oneAPI and Ubuntu package repositories. `_ROOT_PACKAGES` is now in `_UBUNTU_PACKAGES` because all the package share the same `_UBUNTU_STRIP_PREFIX` ## Tests ``` bazel run @apt_oneapi//:lock ``` ``` ONEAPI_DEVICE_SELECTOR=level_zero:0 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 26.248s · 34.9tok/s__ ``` ONEAPI_DEVICE_SELECTOR=level_zero:0,1 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 13.017s · 56.6tok/s__
2026-07-15 16:21:56 +02:00
platform/intel: bump oneapi=2026.1 and rules_distroless=0.8.0 (#644) # Bump intel oneapi and rules_distroless The Debian package set is now also exposed separately through the rules_distroless APT extension: Now use `rules_distroless` to install the oneAPI packages in a distroless container image. So the platforms/oneapi/packages.lock.json file is now generated from the platforms/oneapi/packages.yaml file, and the packages.yaml file is now the source of truth for the oneAPI packages. The MODULE.bazel contain rules_distroless patch `third_party/rules_distroless/accept-nospace-version-constraints.patch` because the rules_distroless APT extension does not support version constraints with spaces, e.g. `>= 2023.2.0` is not supported, but `>=2023.2.0` is supported. A PR has been submitted to rules_distroless to fix this issue, but until it is merged and released, the patch is needed in zml https://github.com/bazel-contrib/rules_distroless/pull/229. `_ROOT_MODULE_DIRECT_DEPS` does not need anymore to list the individual oneAPI and Ubuntu package repositories. `_ROOT_PACKAGES` is now in `_UBUNTU_PACKAGES` because all the package share the same `_UBUNTU_STRIP_PREFIX` ## Tests ``` bazel run @apt_oneapi//:lock ``` ``` ONEAPI_DEVICE_SELECTOR=level_zero:0 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 26.248s · 34.9tok/s__ ``` ONEAPI_DEVICE_SELECTOR=level_zero:0,1 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 13.017s · 56.6tok/s__
2026-07-15 16:21:56 +02:00
platform/intel: bump oneapi=2026.1 and rules_distroless=0.8.0 (#644) # Bump intel oneapi and rules_distroless The Debian package set is now also exposed separately through the rules_distroless APT extension: Now use `rules_distroless` to install the oneAPI packages in a distroless container image. So the platforms/oneapi/packages.lock.json file is now generated from the platforms/oneapi/packages.yaml file, and the packages.yaml file is now the source of truth for the oneAPI packages. The MODULE.bazel contain rules_distroless patch `third_party/rules_distroless/accept-nospace-version-constraints.patch` because the rules_distroless APT extension does not support version constraints with spaces, e.g. `>= 2023.2.0` is not supported, but `>=2023.2.0` is supported. A PR has been submitted to rules_distroless to fix this issue, but until it is merged and released, the patch is needed in zml https://github.com/bazel-contrib/rules_distroless/pull/229. `_ROOT_MODULE_DIRECT_DEPS` does not need anymore to list the individual oneAPI and Ubuntu package repositories. `_ROOT_PACKAGES` is now in `_UBUNTU_PACKAGES` because all the package share the same `_UBUNTU_STRIP_PREFIX` ## Tests ``` bazel run @apt_oneapi//:lock ``` ``` ONEAPI_DEVICE_SELECTOR=level_zero:0 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 26.248s · 34.9tok/s__ ``` ONEAPI_DEVICE_SELECTOR=level_zero:0,1 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 13.017s · 56.6tok/s__
2026-07-15 16:21:56 +02:00
2026-02-16 19:59:38 +00:00
2026-01-11 15:57:45 +01:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
2026-03-20 15:02:24 +01:00
2025-12-01 19:30:16 +01:00
2024-09-17 11:11:18 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
2024-09-17 11:11:18 +02:00
2024-09-17 11:11:18 +02:00
2024-09-17 11:11:18 +02:00
2024-09-17 11:11:18 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
2025-12-01 19:30:16 +01:00
workspace: bump llvm / xla / stablehlo / pjrt plugins and restore disabled tests xla@4663f04 (#98) - workspace: new module versions added to Bazel registry: - deps/xla: https://github.com/openxla/xla/commit/4663f04d2653d686833f9c306bd0d899c3127358 (20241025.0-4663f04) This version introduces an upgraded overlay with Python repository initialization for the TSL extension. The changes were necessitated by this XLA commit: https://github.com/openxla/xla/commit/19b4ecbe98e2c2910d6ff6532cdb64636a71e6d5#diff-df5471accc0ccfdac45fb8397fb8e1488565baf112c72487912deda919680f8aR841 , which triggers a repository call. Python's hermetic version is provided via the .bazelrc file. - deps/stablehlo: https://github.com/openxla/stablehlo/commit/f7f8e4e35296deeff2e12e39421ac8d9599ba340 (20241021.0-1c0b606) - deps/llvm: https://github.com/llvm/llvm-project/commit/f7f8e4e35296deeff2e12e39421ac8d9599ba340 (20241022.0-6c4267f) This version includes an upgraded module declaration with rules_python dependency added, as LLVM prepares its overlay for Bazel v8. Relevant LLVM changes here: https://github.com/llvm/llvm-project/commit/3903cb4695012fb85a76c83b5616f2ffe6fa10f4 - deps/runtimes: use PJRT artifacts v3.0.0 (https://github.com/zml/pjrt-artifacts/releases/tag/v3.0.0) - workspace: align used versions of rules_zig in the Bazel dependency graph - pjrt: expose getPluginAttributes and getPluginAttribute private APIs and stablehloCurrentVersion public API - pjrt: updated customCallRegistry function with the new FFI provided by the PJRT API GPU extension Minimal support for this feature was added, as this is not the main focus of the current PR. See related changes in XLA here: https://github.com/openxla/xla/commit/ef85a7bcc308313492ebc50295a8a08b4e51b8f5 - dialects/mlir/stablehlo: expose getCurrentVersion API and fix broken stablehloVersionFromCompatibilityRequirement API - zml/pjrtx: serialize IR to the PJRT plugin's supported HLO version. If the plugin attribute is unavailable, it falls back to the StableHLO's compatibility requirement version. - zml/tensor: tests using batching dims for gather and scatter are now re-enabled
2024-11-25 15:53:25 +01:00
2025-12-01 19:30:16 +01:00
2025-12-01 19:30:16 +01:00
2024-09-17 11:11:18 +02:00
2026-01-19 16:18:17 +01:00
2024-09-17 11:11:18 +02:00
2026-01-19 16:18:17 +01:00
2024-09-17 11:11:18 +02:00
2026-01-19 16:18:17 +01:00
2026-01-19 16:18:17 +01:00
2024-09-17 11:11:18 +02:00
2026-01-19 16:18:17 +01:00
platform/metal: support toolchain extraction on Linux x86_64 (#880) Even if `exec_compatible_with = ["@platforms//os:macos"],` is removed from `platforms/metal/BUILD.bazel`, fetching the pinned Metal toolchain on Linux currently fails: ``` ERROR: /home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl:20:13: An error occurred during the fetch of repository 'zml++http_aea_archive+metal_toolchain': Traceback (most recent call last): File "/home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl", line 43, column 19, in _http_aea_archive_impl _require_macos(rctx) File "/home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl", line 20, column 13, in _require_macos fail("http_aea_archive is macOS-only; current repository OS is %r" % rctx.os.name) Error in fail: http_aea_archive is macOS-only; current repository OS is "linux" ``` Add checksum-pinned `ipsw` and `7-Zip` binaries for Linux x86_64. `bazel/http_aea_archive.bzl` now selects the right binaries according to running host. It preserves the existing macOS extraction path. Linux ARM64 remains uncovered. Validation: ```bash bazel build \ # selects compiler binaries from the extracted external repository \ # filegroup defined in platforms/metal/metal_toolchain.BUILD.bazel \ @metal_toolchain//:metal_compile_tools \ # selects the compiler’s runtime files \ # filegroup also defined in platforms/metal/metal_toolchain.BUILD.bazel \ @metal_toolchain//:metal_compile_runtime \ # copies compiler binaries and runtime files into the layout consumed by ZML \ //platforms/metal:metal_toolchain \ # selects macOS ARM64 as the build target \ --platforms=//platforms:macos_arm64 \ --lockfile_mode=off ``` --------- Co-authored-by: Corentin Kerisit <corentin.kerisit@gmail.com>
2026-10-01 18:41:45 +02:00
platform/metal: support toolchain extraction on Linux x86_64 (#880) Even if `exec_compatible_with = ["@platforms//os:macos"],` is removed from `platforms/metal/BUILD.bazel`, fetching the pinned Metal toolchain on Linux currently fails: ``` ERROR: /home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl:20:13: An error occurred during the fetch of repository 'zml++http_aea_archive+metal_toolchain': Traceback (most recent call last): File "/home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl", line 43, column 19, in _http_aea_archive_impl _require_macos(rctx) File "/home/oboulant/.cache/bazel/_bazel_oboulant/4ea653214b23f6728bdb9f5b40de2f50/external/zml+/bazel/http_aea_archive.bzl", line 20, column 13, in _require_macos fail("http_aea_archive is macOS-only; current repository OS is %r" % rctx.os.name) Error in fail: http_aea_archive is macOS-only; current repository OS is "linux" ``` Add checksum-pinned `ipsw` and `7-Zip` binaries for Linux x86_64. `bazel/http_aea_archive.bzl` now selects the right binaries according to running host. It preserves the existing macOS extraction path. Linux ARM64 remains uncovered. Validation: ```bash bazel build \ # selects compiler binaries from the extracted external repository \ # filegroup defined in platforms/metal/metal_toolchain.BUILD.bazel \ @metal_toolchain//:metal_compile_tools \ # selects the compiler’s runtime files \ # filegroup also defined in platforms/metal/metal_toolchain.BUILD.bazel \ @metal_toolchain//:metal_compile_runtime \ # copies compiler binaries and runtime files into the layout consumed by ZML \ //platforms/metal:metal_toolchain \ # selects macOS ARM64 as the build target \ --platforms=//platforms:macos_arm64 \ --lockfile_mode=off ``` --------- Co-authored-by: Corentin Kerisit <corentin.kerisit@gmail.com>
2026-10-01 18:41:45 +02:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
2025-11-12 11:55:48 +01:00
workspace: support zig-only local execution (#546) This PR bumps rules_zig back to upstream/main where we now have all the necessary features to enable zig local actions while the reste on remote. It also adds the necessary configurable to actually enable this. Additionally, since rules_zig now ships ZLS support, we remove zls entirely from zml. ### How the Bazel resolution works Bazel resolves execution platforms and toolchains during analysis for each target that requires toolchains. If a rule defines exe, resolution happens separately for the default target execution group and for each `exec_group`; actions assigned to an exec group use that group’s selected execution platform and toolchains. Execution platforms come from an ordered set. In this repository’s remote configuration, the relevant order is: 1. `//:rbe_platform`, supplied by `--extra_execution_platforms=@zml//:rbe_platform` 2. `//bazel/zig_toolchain_config:local_execution_platform`, registered by this PR 3. the host platform, included automatically by Bazel Earlier platforms are selected when they can satisfy the requested toolchains. For each target or exec group, Bazel takes the required toolchain types, the target platform, the ordered execution platforms, and the ordered registered toolchains. It filters execution platforms by execution constraints, then tries to find a matching toolchain for every required toolchain type. A toolchain matches when: - its `exec_compatible_with` constraints are present on the candidate execution platform - its `target_compatible_with` constraints are present on the target platform - its `target_settings` match the current configuration Any execution platform missing a required toolchain is rejected. The first remaining execution platform wins, and the first matching toolchain for each type is selected. ### How this makes Zig local-only This PR defines a custom execution constraint: - `//bazel/zig_toolchain_config:local_zig_execution` It then defines a host-derived execution platform: - `//bazel/zig_toolchain_config:local_execution_platform` That platform inherits the host OS/CPU constraints from `@platforms//host`, adds `local_zig_execution`, and sets: ```starlark exec_properties = { "no-remote-exec": "1", } ``` The zig.toolchain(...) module extension call now passes: extra_exec_compatible_with = ["//bazel/zig_toolchain_config:local_zig_execution"] rules_zig appends that extra execution constraint to every generated Zig SDK toolchain. As a result, when rules_zig resolves @rules_zig//zig:toolchain_type for its zig execution group: - the remote execution platform is considered first, but it does not have local_zig_execution, so it cannot match the Zig SDK toolchain - the custom local execution platform has both the host OS/CPU constraints and local_zig_execution, so it matches - the selected platform carries no-remote-exec, so Zig actions execute locally even in remote builds Other toolchains are not constrained by local_zig_execution, so they can continue to resolve to the remote execution platform first. This keeps the build remote by default while carving out Zig actions as local-only. --------- Co-authored-by: Steeve Morin <steeve@zml.ai>
2026-05-20 16:13:59 +02:00
2025-11-12 11:55:48 +01:00
2024-09-17 11:11:18 +02:00
2026-01-19 16:18:17 +01:00
2026-01-19 16:18:17 +01:00
platform/intel: bump oneapi=2026.1 and rules_distroless=0.8.0 (#644) # Bump intel oneapi and rules_distroless The Debian package set is now also exposed separately through the rules_distroless APT extension: Now use `rules_distroless` to install the oneAPI packages in a distroless container image. So the platforms/oneapi/packages.lock.json file is now generated from the platforms/oneapi/packages.yaml file, and the packages.yaml file is now the source of truth for the oneAPI packages. The MODULE.bazel contain rules_distroless patch `third_party/rules_distroless/accept-nospace-version-constraints.patch` because the rules_distroless APT extension does not support version constraints with spaces, e.g. `>= 2023.2.0` is not supported, but `>=2023.2.0` is supported. A PR has been submitted to rules_distroless to fix this issue, but until it is merged and released, the patch is needed in zml https://github.com/bazel-contrib/rules_distroless/pull/229. `_ROOT_MODULE_DIRECT_DEPS` does not need anymore to list the individual oneAPI and Ubuntu package repositories. `_ROOT_PACKAGES` is now in `_UBUNTU_PACKAGES` because all the package share the same `_UBUNTU_STRIP_PREFIX` ## Tests ``` bazel run @apt_oneapi//:lock ``` ``` ONEAPI_DEVICE_SELECTOR=level_zero:0 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 26.248s · 34.9tok/s__ ``` ONEAPI_DEVICE_SELECTOR=level_zero:0,1 \ bazel run \ --config=release \ --@zml//platforms:cpu=false \ --@zml//platforms:oneapi=true \ //examples/llm -- \ --model=/var/models/meta-llama/Llama-3.1-8B-Instruct \ --topk=4 \ --prompt="Tell me a story about evariste galois" ``` __-> decode 13.017s · 56.6tok/s__
2026-07-15 16:21:56 +02:00
2026-01-19 16:18:17 +01:00