Repository navigation
chore: Port the fine decoders to fine 0.2 - #167
Merged
Merged
Conversation
fine 0.2 replaces Decoder<T>::decode with try_decode, which returns fine::DecodeResult<T>. EMLX did not compile with fine 0.2, and the requirement "~> 0.1" let a new project get 0.2. EXLA main requires "~> 0.2.0", so a project could not use EMLX and EXLA main together. - Require fine "~> 0.2.0". - Port the 11 custom decoders to try_decode. A term of the wrong type now gives a fine::DecodeError instead of a std::invalid_argument, as fine 0.2 requires. The std::variant and std::optional decoders of fine try the next type only on a DecodeError. fine::decode still raises with the same message. - Remove the decoder for std::optional<TensorArg>. The generic std::optional decoder of fine does the same nil check. - Add emlx::native::decode_field for the struct decoders of the compiler.
polvalente
approved these changes
Nov 27, 2026
georgeguimaraes
marked this pull request as ready for review
November 27, 2026 15:46
Require nx ~> 1.1 in emlx and emlx_axon, and lock nx 1.1.0, with complex 1.0.1 and telemetry 1.4.3 that come with it. The root mix.lock had nx 0.13.0. emlx_axon keeps fine 0.1.6, since it builds hex EMLX by default. Co-authored-by: Paulo Valente <polvalente@users.noreply.github.com>
polvalente
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not merge before EXLA releases on fine 0.2. Hex EXLA 1.0.0 requires
fine ~> 0.1and does not compile with fine 0.2 (no member named 'try_decode' in 'fine::Decoder<xla::Shape>'). After this PR, a project that uses EMLX and hex EXLA 1.0.0 cannot compile. Today it is the opposite: EXLA main requiresfine ~> 0.2.0, and EMLX does not compile with fine 0.2. Thus the EMLX release with this PR and the EXLA release on fine 0.2 must come out together.fine 0.2 replaces
Decoder<T>::decodewithtry_decode, which returnsfine::DecodeResult<T>. The requirement~> 0.1let a new project get fine 0.2, and then EMLX did not compile.~> 0.2.0, as EXLA main does.try_decode. A term of the wrong type now gives afine::DecodeErrorinstead of astd::invalid_argument. Thestd::variantandstd::optionaldecoders of fine try the next type only on aDecodeError.fine::decodestill raises with the same message.std::optional<TensorArg>. The genericstd::optionaldecoder of fine does the samenilcheck.emlx::native::decode_fieldfor the struct decoders of the compiler.emlx_axon/mix.lockkeeps fine 0.1.6, becauseemlx_axonbuilds hex EMLX 0.5.0 by default. WithEMLX_AXON_LOCAL_EMLX=true, as in CI,mix deps.gettakes fine 0.2.0.Checks on an M2 Pro:
:cpusuite: 2739 of 2739.EMLX_TEST_DEFAULT_GPU=true: the same 12 failures asmain(fix: Move every operand of an op to one device #166 fixes them).emlx_axonwith the local EMLX andEMLX_TEST_DEFAULT_GPU=true: 192 of 192.main.