8000 Releases · gomlx/gomlx · GitHub
[go: up one dir, main page]

Skip to content

Releases

v0.28.11 Backends 🏃‍♀️ and Dynamic Shapes 🤸

Choose a tag to compare

@janpfeifer janpfeifer released this 08 Sep 17:02
  • New onnx backend, based on ONNX Runtime. Use -tags=onnx to include it in the backends/default package. It has support for "onnx:cpu", "onnx:cuda" (CUDA) and "onnx:rocm" versions support. For WebAssembly (WASM) it supports "onnx:wasm" (CPU), "webgpu" (GPU) and "webnn" (experimental).
    • Includes saving a model to a .onnx file, that can be served with other inference systems that support ONNX (e.g. KnightAnalytics Hugot).
  • The "go" backend has been greatly optimized, closely matching "xla:cpu" speeds for FNN models (try out the UCI-Adult/Census model).
    • The main execution engine has been updated to minimize synchronization costs;
    • Improved buffer management;
    • Updated and greatly broadened SIMD suport -- where possible using go1.27 portable simd (so should work for any platforms).
    • Matrix multiplications are still very architecture dependent, hence only AVX2 and AVX512 were optimized so far. the microkernel was written in assembly due to some pending go simd issues (#80829 and #78753). Consider donating for Apple hardware, I'd love to add support for Neon SIMD/assembly optimized kernels!
  • Greatly improved DynamicShape support, with new ops to support it. This enabled creating ONNX models
    with variable-sized inputs, from GoMLX trained (or fine-tuned) models.

v0.28.0 - 🎆 Large API update; Lots of new features

Choose a tag to compare

@janpfeifer janpfeifer released this 21 Jul 10:09

To faciliate conversion to this updated API, we added the CLI tool cmd/convert_v0.28.
It won't fully fix the code (mostly because of the context.Context to model.Store/model.Scope redesign),
but it will change the import package paths and names.

Remember to save your code before running the conversion -- allow yourself to revert to files where the fix
make things worse.

go run <path_to_gomlx>/cmd/convert_v0.28/main.go [-dir <directory>]

API Changes: backends and related packages moved to github.com/gomlx/compute

Highlights:

  • Experimental SIMD support for amd64 for the Go backend.
  • Gradiend Checkpointing: needed when training large models, to trade-off memory usage for recomputation.
  • Transformers library that support many more classes of LLMs.
  • LLM generator (that works this time), with KVCache support.
  • The "xla" backend now supports many more options, including preallocate=false to prevent preallocating 75% of the
    GPU memory (for xla:cuda) upfront. Use GOMLX_BACKEND=xla:help and it will printout help on all options.
  • Added FlashAttention for xla:cuda backends -- mimicking what Jax does, using cuDNN implementation.
    Including backward propagation version, for faster training.

API Changes:

  • Packages backends, dtypes, shapes and distributed moved to github.com/gomlx/compute
  • New github.com/gomlx/compute repo will host what was in package backends.
    • backends/simplego backend now moved to github.com/gomlx/compute/gobackend (no longer "simple").
    • backends/xla backend now moved to github.com/gomlx/go-xla/compute/xla.
    • backends/default still imports both by default the "go" and the "xla" backends.
  • XLA backends used for test in support/testutil only where the platform is supported (and if the tag noxla is NOT selected).
  • New tensors/dtensor to hold distributed tensors (previously in pkg/core/distributed).
  • Packages in pkg/support moved to github.com/gomlx/compute/support:
    • The following packages were moved: xslices, xsync, sets and humanize.

Reoganization of packages -- removed the pkg top-level directory

In Go making the exported packages under pkg was a reasonable convention before
the special meaning internal came about, but it stayed in use (and was adopted by
GoMLX even thought it was no longer needed).

We are taking the opportunity of the large API upgrade to remove the pkg top-level
directory, and move the packages to the root:

  • github.com/gomlx/gomlx/core/... -> `github.com/gomlx/gomlx/core/...
  • github.com/gomlx/gomlx/ml/... -> `github.com/gomlx/gomlx/ml/...
  • github.com/gomlx/gomlx/support/... -> `github.com/gomlx/gomlx/support/...

And a few small renaming:

  • ml/datasets -> ml/dataset
  • ml/layers/regularizers -> ml/layers/regularizer
  • ml/model/initializers -> ml/model/initializer
  • ml/model/checkpoints -> ml/model/checkpoint
  • ml/train/optimizers -> ml/train/optimizer
  • ml/train/losses -> ml/train/loss

Scope Redesign

  • Package context -> model
  • Scope -> Store and Scope
  • NewScope -> NewStore (the only "global" one)
  • Exec.*Exec* -> Exec.*Call*; the methods with *Exec* still exist but are deprecated.
    • New Exec wrappers for fixed number of outputs: NewExec1(), NewExec2() and NewExec3() for graphs with one,
      two or three outputs.
  • Using mostly fullPath instead of the split scope/key pairs.
  • Variables:
    • Scope.VariableWithValueGraph -> Scope.VariableWithNodeValue
    • InspectVariable -> Store.GetVariable
    • InspectVariableInScope -> Scope.GetVariable
    • SetValueGraph -> SetNodeValue; ValueGraph -> NodeValue
    • Variable.ParameterName because a private function in checkpoint package.
  • Added model.GetStore(): it returns the model.Store attached to the current graph (it accepts a node also),
    so many functions in train and other packages can drop the s *model.Scope (or s *model.Store) parameter.
  • (internal) Graph parameters as well as variable nodes associated to a graph are now stored in the graphStore,
    which is attached to the Graph. This makes the separation cleaner, and they all get automatically GC'ed if
    the Graph is destroyed (preventing some leaks).

Package ml/train:

  • NewTrainer now accepts generic functions matching the ModelFnCompatible constraint. This allows modelFn
    signatures to omit the spec parameter if not used, use named *graph.Node input parameters, and return a single
    *graph.Node (or up to 3 nodes) directly instead of a slice. The passed functions are automatically converted to the
    canonical signature.
    • All standard examples (adult, cifar, mnist, dogsvscats) and their corresponding Jupyter Notebooks have been
      updated to use these simplified/cleaner signatures.
  • Dataset API change: updated to use iterators, and now yields a Batch struct -- more convenient if we need
    future extensions, and easier to ignore non-used fields (like Spec).
  • Clarification of main loss vs regularization loss in ml/train, added:
    • AddMainLoss/GetMainLoss to accumulate the main model losses;
    • AddRegularizationLoss/GetRegularizationLoss to accumulate regularization losses;
    • TotalLoss to return their sum.
    • Older API marked as deprecated.
    • Changed default loss metrics behavior to only return the total loss by default (named "Loss" / "~loss"). Added
      WithMainLossMetric() method to include the "no-reg" metrics when requested.

Package ml/dataset:

  • Updated Dataset and Batch types, and adjusted various datasets implementations accordingly.
  • Added dataset.Buffered, that pre-calculates the dataset.
  • Added dataset.Map, dataset.ParallelMap, dataset.MapOnHost and dataset.ParallelMapOnHost to transform datasets.

Graph (github.com/gomlx/gomlx/core/graph):

  • Exec.*Exec* -> Exec.*Call*; the methods with *Exec* still exist but are deprecated.
    • New Exec wrappers for fixed number of outputs: NewExec1, NewExec2 and NewExec3 for graphs with one, two or
      three outputs.
  • New ops:
    • SchedulingBarrier and OptimizationBarrier: they are implemented in the Go and XLA backends.
  • Gradient Checkpointing: Added Node.Checkpoint() and Node.StopCheckpoint().
  • Updates to FusedScaledDotProductAttention, including adding support to the corresponding VJP: enabling the flash attention in XLA+CUDA.

Tensors (github.com/gomlx/gomlx/core/tensors):

  • Renamed FromAnyValue to MustFromAnyValue and added FromAnyValue returning (tensor, error).

Other improvements

  • Redesigned KVCache implementation (previous was broken) in ml/layers/attention/kvcache: it is used by packages attention, transformer and decode.
  • Many improvements to ml/zoo/transformer: it nows support Gemma4 class of transformer models.
  • Added nn.SoftCap and in the ml/layers/attention added support for attention scores soft-cap (used by Gemma models).
  • Added activation.SwiGLU for Swish Gated Linear activation, and updated corresponding support in the fnn package.
  • Added Dynamic Tanh (DyT) "pseudo" normalizer (https://arxiv.org/abs/2503.10622).

v0.27.3: Improves sub-byte support, optimized raw-byte data transfers, FNN ensembles, and major transformer updates including BERT and Gemma models.

Choose a tag to compare

@janpfeifer janpfeifer released this 16 Apr 09:39
41471d2

v0.27.3: Improves sub-byte support, optimized raw-byte data transfers, FNN ensembles, and major transformer updates including BERT and Gemma models.

Core:

  • Package tensors
    • Improving support for sub-byte data types (Int4, Int2, Uint4, Uint2)
    • Added FromShapeForBackend() to create new tensors with shared memory
      if possible.
    • Added ToDevice() and improved performance of MaterializeOnDevice when copying to shared buffers.
    • Improved MutableBytes(), should improve the performance in some cases.
    • Added FromRaw() to upload a tensor to a backend with the given raw data -- this is the most performant
      way to upload raw data to the backend accelerator.
  • Package dtypes
    • Added several slice creation/copying/casting functions for dtypes, using switch on types as opposed to
      the slower reflect package. Incorporated that into the tensors implementations, as well as exposed
      it publicly (go-huggingface project uses it).
    • Deprecated dtypes.Memory().
  • Package shapes
    • Added ByteSize() method, with proper support for packed dtypes.
    • Deprecated shapes.Memory().
  • Package graph
    • Added CrossCosineSimilarity() operation.
    • Graph.Compile() now returns an error instead of panicking -- API change: it's not a common way to compile
      graphs (in GoMLX it's only used in tests), but it requires change for anyone using it directly.

Packages in pkg/ml

  • Package activations
    • Added HardSigmoid activation.
    • Modified the parametrized activations to be suffixed with With: LeakyReluWith, HardSigmoidWith, HardSwishWith.
  • Package attention:
    • API clean up.
    • Added WithMask, a simplified mask input for when only using padding.
    • Dropout now takes a *Node instead of a float64, allowing dynamic dropout control.
    • Fixed mask and causal mask handling.
  • Package attention/pos:
    • Split Encoder API into QKEncoder and PreEncoder, to support different types of positional encoders.
    • Added WithSlidingWindow to support "sliding attention" (the slow way).
  • Package layers/fnn:
    • Added WithEnsembleSize and WithEnsembleAxis methods for configuring parallel independent executions via ensembles.
  • Package transfromers:
    • Updates and fixes to the API; Added methods to build partial models: AllLayers, ForwardLayer, LogitsFromEmbeddings, EmbedTokesn, etc.
    • Updated positional-encoder support.
    • Added options WithFinalNormalization, WithScalingOfTokenEmbeddings, WithArchitecture, WithSlidingWindow
      and WithLayerTypes, WithEmbedNormalization, WithTokenTypeEmbedding.
    • Added BERT and Gemma types of models.

Packages in pkg/support

  • Added humanize package:
    • It includes Bytes(), Count(), Speed(), Underscores() and Duration().
    • Replaces fsutil.BytesETC and dustin/go-humanize.

Backends:

  • Package xla:
    • BufferToFlatData and BufferFromFlatData now transfer using raw-bytes, for a slight gain in performance.

DotGeneral with AccumulatorDType; Transformer architecture parameter;

Choose a tag to compare

@janpfeifer janpfeifer released this 21 Mar 16:32

Core:

  • Package graph:

    • DotGeneral passing AccumulatorDType and OutputDType to the backend (instead of assuming it doesn't implement and
      converting it). Also, by default, half-precision floats use float32 as accumulator.
      • For the xla backend: added an "hacky" dependency from the variable (weights) to the lhs operand of the DotGeneral
        operation: because XLA CPU creates a temporary re-layout of the weights, this dependency ensures that only one temporary
        buffer is allocated at a time, along the layers of a model (in a 22Gb model with 48 layers, it saved 48Gb! in temporary memory)
  • Package ml/model/transformer:

    • Added architecture parameter ("standard" or "gemma" values).
    • Activation passed an activations.Type values (instead of string) -- but conversion from string as a context hyperparameters still works.
    • Added WithTransposedWeights() and WithCausalMask() options.
    • Simplified code.
  • Package ml/layers

    • Added constants to normalization types.

Backends:

  • Backend xla:

    • Updated dependency to github.com/gomlx/go-xla to v0.2.2: with a fix to NVIDIA CUDA drivers path.
    • DotGeneral with unsupported accumulation dtypes (only float32 is supported): it automatically converts the
      input dtype to the accumulation dtype first.
    • Added executable memory consumption logging if passing -vmodule=executable=1.
    • Added OptimizationBarrier operation. Not exposed in graph though.
    • Added "hack" dependency on the weights of a DotGeneral operation to the lhs operand of the DotGeneral operation,
      to hugely decrease temporary memory usage. See issue in openxla/stablehlo#2923
  • Backend simplego ("go"):

    • DotGeneral with accumulation dtypes: it automatically converts the input dtype to the accumulation dtype first.
      (With the exception of half-precision types, which use float32 as accumulator by default).

v0.27.1 Minor fixes and updates; ONNX-GoMLX examples now use v0.4.1.

Choose a tag to compare

@janpfeifer janpfeifer released this 17 Mar 10:19
  • Package examples/...:

    • Updated gemma3, mxbai-rerank and bert-base-ner to use the new onnx-gomlx v0.4.1 API, bumped dependency.
  • Package graph:

    • Floor and Ceil operations now are identity for integer dtypes.
  • Package simplego:

    • Removed panics during execution: return errors instead.
    • Fixed missing annotation/stacktrace on not-implemented errors.
    • Implemented Pad() operation (and add some more tests in graph.TestPad).
  • Package xla:

v0.27.0: Graph functions; Improved Go backend (fusion ops); Quantization dtypes; more ML layers & fixes

Choose a tag to compare

@janpfeifer janpfeifer released this 13 Mar 07:10
d3d1a59

v0.27.0: Graph functions; Improved Go backend (fusion ops); Quantization dtypes; more ML layers & fixes

  • Package backends: major refactoring to add support for functions/closures.
    • Added backends.Function, which now holds all the "ops" methods.
    • Added NewFunction, Closure and Call.
    • Renamed backends.Op -> backends.Value.
    • Added FusedOps, allowing backends to expose fused (more efficient) operations -- with proper/automatic
      fallback to decomposed operations when not supported or for gradients.
    • Added ErrNotImplemented error and IsNotImplemented(err) function.
    • Added Quantization struct, QuantizationScheme (Linear, NF4), and NF4LookupTable.
    • Removed Dot() operation (redundant with DotGeneral).
    • DotGeneral() now takes a DotGeneralConfig struct, with options for setting the accumulator and output dtypes.
  • Package simplego:
    • Added Float16 support (thx @timkaye11)
    • Added dedup of computation nodes (aka. "common subexpression elimination" CSE) (thx @timkaye11, @janpfeifer)
      • ~6% speedup for CSI-Adult demo training.
    • DotGeneral: Pre-blocking of the blocked path, which may lead to deduplication of blocking nodes (@timekaye11).
    • DotGeneral: Added smallMatMul execution path, optimized for small matrix multiplications (thx @timkaye11)
    • Experimental packgemm support leveraging simd operations (@ajroetker, @janpfeifer)
    • Funtions/closures support (thx @ajroetker)
    • Added Reverse operation.
    • Added fused operations: FusedGelu, FusedDense, FusedSoftmax, FusedLayerNorm,
      FusedScaledDotProductAttention, FusedAttentionQKVProjection.
    • Added FusedQuantizedDense: fused dequantization + matmul + bias + activation for Int4/Int8 weights
      with Linear and NF4 quantization schemes, block-wise scales, and optional zero points.
    • FusedScaledDotProductAttention: added ScaledDotProductAttentionConfig options struct with
      QuantizedMatmuls flag for optional uint8 quantized Q@K/attn@V matmuls (awaiting go-highway
      release for actual acceleration).
    • Bitcast refactored to pure bit reinterpretation; sub-byte unpacking moved to ConvertDType.
  • New package bucketing:
    • Tools to manage bucketing of tensors (or anything else) -- thx @ajroetker
  • Package dtypes:
    • Added 'Uint2', 'Uint4', 'Int2', 'Int4'.
  • Package graph:
    • Added Function concept (and support for closures) and the Function.Call operation.
    • Control Flow: Added While and If operations.
    • Order operations: Added Sort, SortFunc, TopK, BottomK.
    • Fixed Bitcast for packed sub-byte types: 8000 Int4, Int2, Uint4 and Uint2, so they can be "bitcast"
      back and forth from/to uint8 (bytes), to ease quantization.
    • Added Atan2 function.
    • Added test helper functions to test various backends at once.
    • Fixed Gather validation of indexVectorAxis to check against startIndices rank instead of operand rank.
    • Exec graph compilation is now concurrent, avoiding redundant compilations for the same graph shape.
  • Package ml/layers/attention: Improved MultiHeadAttention; Added KVCache support.
    • Added Grouped Query Attention (GQA) support.
    • Added UseQKVProjection() option for fused Q/K/V Dense projection.
    • FusedScaledDotProductAttention now supports boolean masks.
  • Package ml/layers/attention/pos: Added PositionalEncoder interface, and "RoPE" (Rotary Positional Encoding) implementation.
  • Package ml/models/transformers:
    • Added a Transformer "model": a collection of transformer layers are setup based on given configuration.
  • Package ml/decode:
    Added a Decoder object to generate text given a sequential model.
  • Package ml/decode/sample:
    • Added implementation of various sampling strategies (greedy, temperature, beam-search, top-k, top-p, etc.), used by the decode package.
  • Package ml/layers/activations:
    • Added HardSwish.
  • Package examples:
    • Separated in its own sub-module, to separate its dependencies.
    • Added gpt2: A simple GPT-2 implementation using the new transformers and decode packages. It downloads the model from HuggingFace.
    • Added textgen: a minimal transformer text generation model that can be trained.
    • Added gemma3: A simple Gemma 3 implementation using the onnx-gomlx package to convert the model, and go-huggingface to download the model and run the tokenizer.
    • Added mxbai-rerank: A cross-encoder reranking example using the MixedBread Reranker v1. It uses the onnx-gomlx package to convert the model, and go-huggingface to download the model and run the tokenizer.
    • Added BERT-base-NER: A BERT-base model fine-tuned for Named Entity Recognition.
  • Bumped github actions versions to the new "Node24" ones.

v0.26.0: XLA by new github.com/gomlx/go-xla library. Added linux/arm64 and windows/amd64 support for XLA CPU.

Choose a tag to compare

@janpfeifer janpfeifer released this 17 Dec 19:45

API Change: dtypes package moved from github.com/gomlx/gopjrt/dtypes to github.com/gomlx/gomlx/pkg/core/dtypes.
It should be a simple change in import.

XLA:

  • go-xla (replacing the now deprecated stablehlo and gopjrt libraries)
    • Added auto-installation of standard (CPU and GPU/TPU when available) plugins.
      (Can be disabled by setting the environment variable GOMLX_NO_AUTO_INSTALL to anything)
    • Fixed some memory leaks on plugin destruction;
    • Improved performance in some low-latency scenarios (using GenPool as opposed to sync.Pool):
  • Removed old gomlx/backends/xla (the one that used the retired xlabuilder API for XLA).
  • Renamed gomlx/backends/stablehlo --> gomlx/backends/xla, using the new go-xla library.
  • Added xla.EnableAutoInstall(enabled bool) to enable/disable auto-installation of standard plugins.
    And added xla.AutoInstall() to immediately auto-install standard plugins.
  • Conversion from/to new gomlx/gomlx/pkg/core/dtypes (and bfloat16) to/from gomlx/gomlx/pkg/core/dtypes (and corresponding bfloat16)
  • Added linux/arm64 and windows/amd64 support for XLA CPU.

Other updates:

  • Package tensors:
    • Added CopyFlatData() that returns an error (it was previously renamed to MustCopyFlatData)
  • Package graph:
    • Added 'RNGStateFromSeedForGraph' function to create a RNG state from a seed for a graph.
  • Package pkg/core/dtypes
    • New, copied from now deprecated Gopjrt.
  • Package simplego:
    • Registration of executors with priority.

v0.25.0 🎄🎅🤶 -> 🎁 Distributed execution 🎁; API cleanups (and changes)

Choose a tag to compare

@janpfeifer janpfeifer released this 05 Dec 13:36
9edb851

This (early) end-of-year big release comes with a big 🎁: distributed execution. For anyone needing to scale the training (or inference), this is a must. As it goes with these new things, it should be considered experimental. I'll be actually using it, and hopefully any missing issues (including adding a distributed tutorial -- there is a demo already) will be solved by the end of the year, or early next year. 🦌

There is also some API clean ups -- mostly returning error in places that were panicking otherwise. So ... a bit of a "Grinch" gift, is the need for some updates, if you update to this version. All very trivial (added an error to the return list of some functions and methods).

We also had some external collaborations 🎉 Looking forward to more of those, there is so much interesting stuff to be done! (Quantization, using SIMD operations in the "Simple Go" backend, etc).

Hightlights:

  • Distributed (cross-devices) execution: with AutoSharding and SPMD strategies;
    Also added support for "portable device" execution.

  • API changes: (will require simple fixes)

    • Most not graph building APIs now return errors (as opposed to panicking). Graph building functions
      still use panic to return error -- otherwise it's too painful to express math.
    • All "Rng" renamed to "RNG" -- acronyms in Go are usually capitalized.

Distributed computation improvements and refactorings:

  • Package graph:
    • Fixed/improved documentation.
    • Added IsNegative, IsPositive, IsNonNegative, IsNonPositive.
    • Added SubScalar and tests for the '*Scalar' functions.
    • Added Graph.WithDistributedStrategy, Graph.WithDeviceMesh. Graph.DeviceMesh and Graph.NumDevices
    • Added Graph.Distributed() with "collective" (across devices) operations (like AllReduce).
    • Renamed: s/Exec.InDevice/Exec.WithDevice; s/Exec.SetName/Exec.WithName
    • Added RunOnDevice.
    • Added Exec.AutoSharding and Exec.SPMD.
  • Package context:
    • Added context.MustGetParam[T](ctx, key) and context.MustGetGraphParam[T](ctx, graph, key).
    • Added Exec.AutoSharding and Exec.SPMD.
    • Added Variable.DistributedValue and Variable.SetDistributedValue.
  • Package train:
    • Added train.DistributedDataset and train.BaseDataset.
    • Dataset.Reset now returns an error.
    • Trainer.TrainStep, Trainer.EvalStep and Trainer.Eval now return errors as opposed to panicking.
    • Added Trainer.WithDeviceAssignment.
    • Added Trainer.DistributedTrainStep, Trainer.DistributedEvalStep and Trainer.DistributedEval.
  • Package datasets:
    • Added datasets.DistributedAccumulator: converts a normal Dataset into a DistributedDataset.
    • Added datasets.OnDevice: pre-uploads data to devices.
  • Package backend:
    • Added Backend.CopyToDevice
    • Builder.Parameter() now takes an optional ShardingSpec for sharded inputs.
    • Added ops: AllReduce
    • Backend.NumDevices() returns an int now.
    • Package backends/notimplemented:
      • Added dummy Backend that can be used to easily mock backends.
  • Package pkg/core/distributed:
    -Added DeviceMesh, ShardSpec and distributed.Tensor objects.
  • Package pkg/core/tensors:
    • Added Tensor.CheckValid(), Tensor.Device(), Tensor.Backend()
    • Changing it to return an error (as opposed to panic) where possible.

Other improvements:

  • Package simplego:
    • Cleanups and improvements: thanks to @wunderbarb!
    • Fixed the issue with not handling the default value for the donate parameter in the Execute method.
  • Package cosineschedule:
    • Added WarmUpSteps and NumCycles hyperparameters -- removed overloading of periodSteps.
  • Added sponsorship badge and section to README.md. Also added the FUNDING.yml pointing to sponsorship.
  • Added .golangci.yml and fixed many (still a long way to go) lint-warnings.
  • GitHub actions (workflows):
    • Renamed tests to "Linux" and "Darwin."
    • Updated badges in README.md.
  • Updated dependency to Gopjrt v0.8.5, fixing xlabuilder for new C compilers.
  • Removed ui/fyneui:
    • It was incomplete, and it would be better offered as a separate package to avoid the dependencies.
  • Package graph:
    • Added a negative and out-of-bounds indices test for Gather.
  • Package simplego:
    • Partially fixed a race condition where the executable is finalized during the execution, causing crashes --
      Thanks @ajroetker!

v0.24.1: XLA (cpu) for Mac release

Choose a tag to compare

@janpfeifer janpfeifer released this 23 Oct 08:56
  • Updated dependency to Gopjrt v0.8.4: added macOS (darwin/arm64) support and cpu PJRT plugin.
  • Include stablehlo (== xla) by default for MacOS in Darwin.
  • GitHub actions:
    • Added macOS tests.
    • Removed unnecessary apt install of packages.

v0.24.0 🛠 **API change**: package tree restructured under `pkg`, `Exec` normalization; Backend `xla` now provided by `stablehlo`

Choose a tag to compare

@janpfeifer janpfeifer released this 21 Oct 06:24
ca5f4b9

This release breaks the API: mostly directory changes, so easy to fix.

Note: breaking the API is not done lightly (it always pains me). After 2 years of growing the project organically, with accumulating small API mistakes, it was time for a "freshen up".

  • Highlights of this release:
    • Deprecating old "xla" backend (now called "oldxla") in favor of "stablehlo" (aliased to "xla" as well):
      in most cases nothing needs to be done (the github.com/gomlx/gomlx/backends/default will replace one by the other automatically),
      but in special cases there may require small changes.
    • Large refactoring: exported GoMLX packages moved under /pkg. The following changes:
      • This requires changes to the import paths: core packages (tensors, shapes and graph) are under pkg/core;
        machine learning packages (context, layers, train, datasets, ...) are under pkg/ml;
        supporting packages (fsutil, sets, xslices, xsync) are under pkg/support.
      • Normalized graph.Exec and context.Exec slightly changed the API:
        the Exec.Exec... methods now return an error, and the Exec.MustExec... methods panic (instead of the old Exec.Call format);
        The graph.NewExec and context.NewExec return errors, and the graph.MustNewExec and context.MustNewExec panic.
      • File utilities under the old ml/data now are under pkg/support/fsutil, and the package ml/data itself was
        renamed pkg/ml/datasets and now only holds the various datasets types.
      • Packages that were not moved:
        • The backends package: it will move to its own repository later in the year (or early 2026)
        • The ui and example packages: since they are just extras, we keep them where they are for now.
          The core GoMLX doesn't depend on them, so we are more lax with their external dependencies.

  • Copied external trivial must and exceptions packages to /internal/..., to remove external dependencies.
  • Package xla (the old one): now DEPRECATED and called oldxla. The package stablehlo replaces it, including aliasing the xla backend name.
    • The old version is now registered as backend "oldxla".
    • Only included in github.com/gomlx/gomlx/backends/default if compiled with the tag oldxla.
  • Package stablehlo:
    • Now completely replacing xla by default. Using GOMLX_BACKEND=xla will actually use the stablehlo backend.
    • Added github.com/gomlx/gomlx/backends/stablehlo/cpu/dynamic and github.com/gomlx/gomlx/backends/stablehlo/cpu/static
      to optionally force dynamic/static linking of the CPU PJRT plugin.
    • Disabled XLA logs by default by setting TF_CPP_MIN_LOG_LEVEL to 2 (errors level), if it is not already set.
  • Package graph:
    • NewExec, NewExecAny Exec, ExecOnce and ExecOnceN now return an error on failure.
    • MustNewExec, MustNewExecAny, MustExec, MustExecOnce and MustExecOnceN panic on failure.
    • Introduced Exec[1-4] and MustExec[1-4] to execute the graph and return exactly 1-4 values.
    • If no seeds are given, initialize new random number generators with a cryptographically secure seed—on OSes that provide that.
    • Improved Exec tests.
  • Package context:
    • NewExec, NewExecAny Exec, ExecOnce and ExecOnceN now return an error on failure.
    • MustNewExec, MustNewExecAny, MustExec, MustExecOnce and MustExecOnceN panic on failure.
    • Introduced Exec[1-4] and MustExec[1-4] to execute the graph and return exactly 1-4 values.
    • Improved documentation.
  • Packages pkg/support/...:
    • Generic supporting functionality that is not core to GoMLX, but that users may also find useful to interact with it
      are now better (and hopefully more definitively) organized in packages under pkg/support/. The following packages were moved/created:
      • xslices, xmaps, xsync: extensions to the corresponding standard packages.
      • set: previously known as package types/
      • fsutil: file system handling utilities, previously in data.
  • Package inceptionv3 moved to examples
  • Package ui/commandline: fixed progressbar in GoNB notebooks.
  • Package kan: fixed PiecewiseConstant* layers for inputs of rank 1.
  • Packages downloader and huggingface: had been already deprecated for a while, now removed.
    See https://github.com/gomlx/go-huggingface for a replacement.
  • Package hdf5 moved to under examples/inceptionv3, for now the only example that uses it.
    If you need this, please let us know, maybe we move it to under support, or move it to https://github.com/gomlx/go-huggingface.
  • Package data renamed to datasets; Split downloading functionality under examples/downloader.
  • Package commandline:
    • Progressbar now shows the median step duration.
  • Updated and refreshed all notebooks, including the tutorial.
0