All notable changes to ejKernel will be documented in this file.
- New
_ring_splash.pyimplementation using JAX Splash Attention kernels for TPU ring attention RingSplashAttentionKernelclass with PyTree registration for JAX compatibilitymake_ring_attention()factory function for creating ring attention kernelsring_splash_attention()low-level API for direct splash attention access- Platform detection utilities:
get_platform(),is_tpu(),is_gpu(),is_cpu()inejkernel/utils.py replicate_to_local_devices()utility inejkernel/xla_utils/shardings.pychunk_sizeparameter for chunked causal attention (Llama4 style)mask_builderparameter for custom mask constructionfwd_paramsandbwd_paramsfor fine-grained block size control- Initial Triton ring attention implementation scaffolding
- BREAKING: Ring attention TPU implementation now uses Splash Attention kernels instead of custom Pallas kernels
- BREAKING:
softmax_auxparameter simplified fromFloat[Array, "num_kv_heads num_sinks"] | Float[Array, "num_sinks"]toFloat[Array, "num_sinks"]across all attention kernels - BREAKING:
biasparameter in TPU ring attention now raisesNotImplementedError - Blocksparse attention now uses
make_splash_mhainstead ofmake_splash_mqa_single_device FwdParamsandBwdParamsconfigs are now hashable- Simplified
SplashCustomReturnTypetype definition formatting
_pallas_impl_fwd.py(769 lines) - replaced by splash attention_pallas_impl_bwd.py(1003 lines) - replaced by splash attention_utils.py(192 lines) - utilities merged into new implementation- Ring attention parameters:
float32_logits,deterministic,dropout_rng,pdrop,policy,prevent_cse,precision,dtype,cache_idx,attention_mask
- Configs not being hashable issue (bed7c39)
Before (0.0.22):
ring_attention(
query, key, value,
attention_mask=mask,
float32_logits=True,
deterministic=True,
dropout_rng=None,
pdrop=0.0,
...
)After (0.0.23):
ring_attention(
query, key, value,
causal=True, # or use mask_builder for custom masks
fwd_params=FwdParams(q_blocksize=512, kv_blocksize=512),
...
)Before:
softmax_aux = jnp.zeros((num_kv_heads, num_sinks)) # 2D allowedAfter:
softmax_aux = jnp.zeros((num_sinks,)) # Must be 1D