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

9 commits

Author SHA1 Message Date
Steeve Morin
fad7cc0876
zml: reintroduce pjrtx (#78)
In an async scenario, it is very easy to footgun yourself and block the
reactor, especially with Events.

Reintroduce pjrtx that deals with the specifics.
2024-11-05 19:25:50 +01:00
Guillaume Wenzek
cb0bcf2f7b
zml.tensor: add cumulativeSum, small refactor of maxPoolND (#64)
This PR adds the "cumulative sum" operator.

This is based on what jax does, which is leveraging reduce window
operator,
where for each n in [0..N] you compute the some of elements [0..n] 
I'm not sure how this get optimized in complex programs, to be
investigated.

**BREAKING CHANGES**:
* `reduceWindow` is still pretty hard to used but I merged the
`padding_shape` and `padding_value` into one operator and made the
signature more explicit.
* this also lead me to change a bit how `maxPool1D` and `maxPool2D` take
arguments, using proper tuples instead of slices that need to be of
specific len.
* `pad` now take options using 
     * "tagged syntax":`x.pad(0, .{ .a = .{ .low = 1, .high = -1 }});` 
* or the "AOS syntax": `x.pad(0, &.{.{}, { .low = 1, .high = -1 }});`
* the "SOA syntax" is **REMOVED**: `x.pad(0, .{ .low = &.{1}, .high =
&.{-1} });`
2024-11-04 09:45:32 +01:00
Hugo Mano
f26a022aa2
zml/sharding: user sharding constraints api and hlo integration (#46)
- Introduce sharding hints from the user code to specify how operations
should be split across user's devices mesh leveraging the HLO sharding
annotations
- Remove options arguments in `zml.module` including
`opts.add_donations_attributes`: it's for the function caching because inner function can't do donation, so we don't want to put the donation attributes there but for now we it's removed and we will do it differently next time around
2024-10-10 13:56:49 +02:00
Guillaume Wenzek
2251b1d815
zml: sharding (#26)
First rough support for in-process sharding.
The goal of sharding is to allow leveraging several GPUs to collaborate
to run one big model.

Current implementation:
* added `platform.sharding()` describing how the set of devices managed
by the current process should be used.
* added a `_sharding_info` to shape.
* A tensor / shape axis can be marked as needing sharding using
`.withSharding(.{ .a })` or `.withSharding(.{ 1 })`.
* When using `populateModelWeights` tensors with sharded axes, will be
populated by sharded buffers.
* when generating the MLIR bytecode for a ZML function the **input**
arguments, will see their `_sharding_info` converted into
`mhlo.sharding` attributes
2024-10-01 21:12:25 +02:00
Corentin Godeau
4f1d6fec3e
Add StableHLO bindings for functions related to versioning (#34)
These functions can be used to serialize stablehlo in a portable way.
2024-09-30 17:18:53 +02:00
Guillaume Wenzek
6079d54927
Implement scatterSlices (#25) 2024-09-27 16:09:06 +02:00
Guillaume Wenzek
689751d7c4
zml: remove dead code (#27)
some dead code or commented out code we should have removed before
release.

copyslice is also broken as per the commented out tests.
it will need to be reimplemented if we need it again.
2024-09-26 11:03:41 +02:00
Guillaume Wenzek
714906265a
zml/nn: fix resize (#18)
Add more `refAllDecl` wich detected non compiling code.
I had to fix resizeBilinear / resizeBicubic.
(85 tests now)
2024-09-20 17:49:12 +02:00
Steeve Morin
13d84615bb zml: initial release 2024-09-17 11:11:18 +02:00