Pallas Changelog#
This is the list of changes specific to jax.experimental.pallas.
For the overall JAX change log see here.
Unreleased#
Changes
jax.experimental.pallas.kernel()now only aliases closed over or passed in refs if the kernel writes to them. If you need aliasing without an explicit write, usejax.experimental.pallas.tpu.touch().
Triton#
The Triton backend is deprecated and will be removed in a future version of JAX.
To keep using Pallas on GPU, please migrate to the Mosaic GPU backend. To keep
using Triton, switch to the official Triton bindings and jax_triton.
New features
Added
jax.experimental.pallas.triton.CUSTOM_CALL_TARGET_NAME, the name of the custom call targeted by Pallas Triton. The exact value is not guaranteed to be stable, but it is safe to assume that it is always aligned with what the lowering emits. This is useful, for example, when exporting a computation with Pallas Triton kernels viajax.experimental.export.export(), since the corresponding custom call is not considered export-stable and needs to be enabled explicitly.
Mosaic GPU#
New features
Added support for Ampere matrix multiply-accumulate instructions via
jax.experimental.pallas.mosaic_gpu.mma().Added support for
cp.asynctojax.experimental.pallas.mosaic_gpu.copy_gmem_to_smem().jax.experimental.pallas.mosaic_gpu.wgmma()now supports mixing the e4m3 and e5m2 FP8 types across its two operands.Added support for manual âreadyâ barriers to
jax.experimental.pallas.mosaic_gpu.emit_pipeline_warp_specialized().Added
oob_fill_modetojax.experimental.pallas.mosaic_gpu.BlockSpec, which controls the behavior for out-of-bounds accesses during pipelined GMEM-to-SMEM copies.
Deprecations
The
idxparameter ofjax.experimental.pallas.mosaic_gpu.load()is deprecated. Index the ref explicitly viaref.at[idx]prior to loading from it.
Released with JAX 0.10.2#
New features
Added
jax.experimental.pallas.enable_poison_buffers(config flagjax_pallas_poison_buffers) to poison (initialize with NaNs or lowest possible integers) any scratch buffers allocated by Pallas for debugging.
Deprecations
pl.debug_checks_enabledis deprecated. Usepl.enable_debug_checks.value.pl.dotwas moved intojax.experimental.pallas.triton. Accessing it viajax.experimental.pallasis deprecated. You can usejax.numpy.dot(),jax.numpy.einsum()or the@operator instead in a TPU or MGPU kernel.
TPU#
New features
Added
jax_pallas_auto_assign_collective_idsconfig flag to allow two new custom semaphore barrier collective IDs modes: (âyesâ) assigning missing collective IDs automatically or (âoverrideâ) overridding all collective IDs and assigning them automatically, both based on the serialized kernel hash.
Changes
jax.experimental.pallas.tpu.CompilerParamsnow defaultsneeds_layout_passesto True. The layout passes are still a work in progress. Please file a bug if you encounter a compilation error with them enabled.jax.experimental.pallas.tpu.CompilerParamsnow defaultsuse_tc_tiling_on_scto True for SparseCore kernels.
Removals
Removed the previously deprecated
jax.experimental.pallas.tpu.KernelTypeandjax.experimental.pallas.tpu.repeat().
Deprecations
Deprecated
pltpu.HOSTandpltpu.MemorySpace.HOSTin favor ofpl.HOST.
Mosaic GPU#
New features
Support using
jax.experimental.pallas.multiple_of()to specify divisibility requirements on dynamic indices.Support allocating multidimensional
plgpu.Barriers andplgpu.ClusterBarriers, by providing a nD shape as thenum_barriersparameter.Support for TMEM references with batch dimensions. This includes indexing over batch dimensions and
plgpu.async_store_tmemsupport for TMEM references with batch dimensions.Support TMA scatter.
Rename
TMA_GATHER_INDICES_LAYOUTtoTMA_INDICES_LAYOUT.
Changes
Breaking change:
jax.experimental.pallas.program_id()andjax.experimental.pallas.num_programs()no longer work inside kernels defined viajax.experimental.pallas.mosaic_gpu.kernel(). Usejax.lax.axis_index()andjax.lax.axis_size()instead.jax.experimental.pallas.mosaic_gpu.kernel()now has the same API asjax.experimental.pallas.kernel(), meaning that it can be used as a decorator and also usesout_typeandscratch_typesinstead ofout_shapeandscratch_shapes.
Removals
Deleted
plgpu.unswizzle_refandplgpu.untile_ref.
Deprecations
Using
jax.experimental.pallas.pallas_call()for Mosaic GPU kernels is deprecated. Please migrate tojax.experimental.pallas.mosaic_gpu.kernel()andjax.experimental.pallas.mosaic_gpu.emit_pipeline().
Released with JAX 0.10.1#
Changes
Added
jax.experimental.pallas.align_to(), a utility that rounds a value up to the nearest multiple of a given alignment.jax.experimental.pallas.pallas_call()no longer supports checkify. We expect this change to affect few users, as in our experience most kernels either perform no checking or usejax.experimental.pallas.debug_check()for conditionally-enabled runtime checks.jax.experimental.pallas.kernel()now always aliases Refs that are passed in or closed-over.
TPU#
Removals
Removed the
kernel_typefield fromjax.experimental.pallas.tpu.CompilerParams. It was only used for writing SparseCore kernels viajax.experimental.pallas.pallas_call(), which is now unsupported. The recommended API for SparseCore kernels isjax.experimental.pallas.kernel().
Mosaic GPU#
New features
Added
jax.experimental.pallas.mosaic_gpu.barrier_test()function; a non-blocking equivalent ofjax.experimental.pallas.mosaic_gpu.barrier_wait()only supported in a warp context.
Changes
Breaking change: removed
plgpu.TransposeTransform.
Released with JAX 0.10.0#
Changes
Breaking change: refactored
pl.kernelto useout_typeinstead ofout_shapeandscratch_typesinstead ofscratch_shapes. Existing usages callingjax.experimental.pallas.kernel()with these keyword arguments must be updated.
TPU#
Deprecations
pltpu.semaphore,pltpu.DeviceIdType,pltpu.semaphore_signal,pltpu.semaphore_wait, andpltpu.semaphore_readare now available injax.experimental.pallas. Accessing them viajax.experimental.pallas.tpuis deprecated.
Removals
Removed the previously deprecated
pltpu.ANYandpltpu.MemorySpace.ANY. Usepl.ANYinstead.Removed the deprecated
pltpu.delay, which is now available aspl.delay.
Mosaic GPU#
New features
Added the
leader_trackedargument toClusterBarrier, which allows tracking barrier completions solely from the leader block along a specific axis in a cluster.
Released with JAX 0.9.2#
New features:
Added support for atomics to the Mosaic GPU backend, through
jax.experimental.pallas.mosaic_gpu.atomic_add(),jax.experimental.pallas.mosaic_gpu.atomic_max(),jax.experimental.pallas.mosaic_gpu.atomic_min(),jax.experimental.pallas.mosaic_gpu.atomic_and(),jax.experimental.pallas.mosaic_gpu.atomic_or(), andjax.experimental.pallas.mosaic_gpu.atomic_xor().Added a
leader_trackedargument tojax.experimental.pallas.mosaic_gpu.copy_gmem_to_smem(). This adds support for cluster-collective partitioned/replicated GMEM to SMEM copies whose completion is tracked only by the leader block. Removed thepartitioned_axisargument (which provided limited access to this feature) from the API.
Released with JAX 0.9.1#
New features:
Added a
jax.experimental.pallas.with_scoped()decorator that provides the function with scope-allocated scratch buffers.
Changes
Removed the
backendargument ofjax.experimental.pallas.pallas_call()in favor ofcompiler_params. For example, to force the use of the Triton backend you have to now writecompiler_params=pltriton.CompilerParams(), wherepltritonrefers tojax.experimental.pallas.triton.Renamed
jax.experimental.pallas.tpu.KernelTypetoCoreType. The old name is deprecated and will be removed in a future release.
Released with JAX 0.9.0#
New features:
Added a
reduction_scratch_bytesfield tojax.experimental.pallas.mosaic_gpu.CompilerParams. This gives user control over how much shared memory Pallas is allowed to reserve for cross-warp reductions on GPU. Increasing this value typically allows for faster reductions.
Changes
The default lowering path on GPU now goes through Mosaic GPU. To keep using Triton, call
jax.experimental.pallas.pallas_call()with thebackendargument set to'triton'.
Removals
Removed the previously deprecated
pl.atomic_*,pl.load,pl.store,pl.swapandpl.max_contiguous.
Released with jax 0.8.1#
New features:
Added
jax.experimental.pallas.tpu.get_tpu_info()to get TPU hardware information.
Deprecations
pl.max_contiguoushas been moved tojax.experimental.pallas.triton. Accessing it viajax.experimental.pallasis deprecated.pl.swapis deprecated and will be removed in a future release. Use indexing or backend-specific loading/storing APIs instead.
Removals
Removed the previously deprecated
jax.experimental.pallas.tpu.TPUCompilerParams,jax.experimental.pallas.tpu.TPUMemorySpace,jax.experimental.pallas.tpu.TritonCompilerParams.
Released with jax 0.7.1#
New features:
pltpu.make_async_remote_copyandpltpu.semaphore_signalâsdevice_idargument now allows user to pass in a dictionary that only specifies the device index along the communication axis, instead of the full coordinates. It also supports TPU core id index.jax.debug.printnow works in Pallas kernels and is the recommended way to print.
Deprecations
pl.atomic_*APIs have been moved tojax.experimental.pallas.triton. Accessing them viajax.experimental.pallasis deprecated.pl.loadandpl.storeare deprecated. Use indexing or backend-specific loading/storing APIs instead.
Released with jax 0.7.0#
New functionality
Added a new decorator
jax.experimental.pallas.loop()which allows to write stateless loops as functions.Added new multiple buffering and lookahead functionality to
jax.experimental.pallas.tpu.emit_pipeline(). Input buffers can now be multiple-buffered with more than 2 buffers and support a lookahead option to fetch blocks that are an arbitrary number of grid iterations ahead rather than the immediate next iterations. Additionally, pipeline state can now be held in registers to reduce scalar memory usage.
Deprecations
jax.experimental.pallas.triton.TritonCompilerParamshas been renamed tojax.experimental.pallas.triton.CompilerParams. The old name is deprecated and will be removed in a future release.jax.experimental.pallas.tpu.TPUCompilerParamsandjax.experimental.pallas.tpu.TPUMemorySpacehave been renamed tojax.experimental.pallas.tpu.CompilerParamsandjax.experimental.pallas.tpu.MemorySpace. The old names are deprecated and will be removed in a future release.
Released with jax 0.6.1#
Removals
Removed previously deprecated
jax.experimental.pallas.gpu. To use the Triton backend importjax.experimental.pallas.triton.
Changes
jax.experimental.pallas.BlockSpec()now takes in special types in addition to ints/None in theblock_shape.indexing_modehas been removed. To achieve âUnblockedâ, pass apl.Element(size)intoblock_shapefor each entry that needs unblocked indexing.jax.experimental.pallas.pallas_call()now requirescompiler_paramsto be a backend-specific dataclass instead of a param to value mapping.jax.experimental.pallas.debug_check()is now supported both on TPU and Mosaic GPU. Previously, this functionality was only supported on TPU and required using the APIs fromjax.experimental.checkify. Note that debug checks are not executed unlessjax.experimental.pallas.enable_debug_checksis set.
Released with jax 0.5.0#
New functionality
Added vector support for
jax.experimental.pallas.debug_print()on TPU.
Released with jax 0.4.37#
New functionality
Added support for
DotAlgorithmPresetprecision arguments fordotlowering on Triton backend.
Released with jax 0.4.36 (December 6, 2024)#
Released with jax 0.4.35 (October 22, 2024)#
Removals
Removed previously deprecated aliases
jax.experimental.pallas.tpu.CostEstimateandjax.experimental.tpu.run_scoped(). Both are now available injax.experimental.pallas.
New functionality
Added a cost estimate tool
pl.estimate_cost()for automatically constructing a kernel cost estimate from a JAX reference function.
Released with jax 0.4.34 (October 4, 2024)#
Changes
jax.experimental.pallas.debug_print()no longer requires all arguments to be scalars. The restrictions on the arguments are backend-specific: Non-scalar arguments are currently only supported on GPU, when using Triton.jax.experimental.pallas.BlockSpecno longer supports the previously deprecated argument order, whereindex_mapcomes beforeblock_shape.
Deprecations
The
jax.experimental.pallas.gpusubmodule is deprecated to avoid ambiguite withjax.experimental.pallas.mosaic_gpu. To use the Triton backend importjax.experimental.pallas.triton.
New functionality
jax.experimental.pallas.pallas_call()now acceptsscratch_shapes, a PyTree specifying backend-specific temporary objects needed by the kernel, for example, buffers, synchronization primitives etc.checkify.check()can now be used to insert runtime asserts when pallas_call is called with thepltpu.enable_runtime_assert(True)context manager.
Released with jax 0.4.33 (September 16, 2024)#
Released with jax 0.4.32 (September 11, 2024)#
Changes
The kernel function is not allowed to close over constants. Instead, all the needed arrays must be passed as inputs, with proper block specs (#22746).
New functionality
Improved error messages for mistakes in the signature of the index map functions, to include the name and source location of the index map.
Released with jax 0.4.31 (July 29, 2024)#
Changes
jax.experimental.pallas.BlockSpecnow expectsblock_shapeto be passed beforeindex_map. The old argument order is deprecated and will be removed in a future release.jax.experimental.pallas.GridSpecdoes not have anymore thein_specs_tree, and theout_specs_treefields, and thein_specsandout_specstree now store the values as pytrees of BlockSpec. Previously,in_specsandout_specswere flattened (#22552).The method
compute_indexofjax.experimental.pallas.GridSpechas been removed because it is private. Similarly, theget_grid_mappingandunzip_dynamic_boundshave been removed fromBlockSpec(#22593).Fixed the interpret mode to work with BlockSpec that involve padding (#22275). Padding in interpret mode will be with NaN, to help debug out-of-bounds errors, but this behavior is not present when running in custom kernel mode, and should not be depended on.
Previously it was possible to import many APIs that are meant to be private, as
jax.experimental.pallas.pallas. This is not possible anymore.
New Functionality
Added documentation for BlockSpec: Grids and BlockSpecs.
Improved error messages for the
jax.experimental.pallas.pallas_call()API.Added lowering rules for TPU for
lax.shift_right_arithmetic(#22279) andlax.erf_inv(#22310).Added initial support for shape polymorphism for the Pallas TPU custom kernels
(#22084).Added TPU support for checkify. (#22480)
Added clearer error messages when the block sizes do not match the TPU requirements. Previously, the errors were coming from the Mosaic backend and did not have useful Python stack traces.
Added support for TPU lowering with 1D blocks, and relaxed the requirements for the block sizes with at least 2 dimensions: the last 2 dimensions must be divisible by 8 and 128 respectively, unless they span the entire corresponding array dimension. Previously, block dimensions that spanned the entire array were allowed only if the block dimensions in the last two dimensions were smaller than 8 and 128 respectively.
Released with JAX 0.4.30 (June 18, 2024)#
New Functionality
Added checkify support for
jax.experimental.pallas.pallas_call()in interpret mode (#21862).Improved support for PRNG keys for TPU kernels (#21773).