Skip to content

Installation

Dew’s package name is dewml and its import name is dew.

Dew needs Python 3.12 or newer, and CI tests 3.12 and 3.14.

Terminal window
curl -LsSf https://dewml.dev/install.sh | sh

The script shows the hardware it found (an NVIDIA GPU with its driver and the CUDA build that driver runs, a TPU VM, Apple silicon or the CPU) and the Python environment that is active. It asks one question, where to install: the active environment, a new .venv in the current directory, a conda environment when conda is installed, or another path. Enter takes the first. It installs uv with uv’s own installer if uv is missing, prints the install command and runs it, then prints the dewml and JAX versions it installed, a command that lists the devices JAX sees, and how to activate the environment.

With -y, or DEW_YES=1, or no terminal to ask on, it takes every default. Options choose for it: --cuda 12 or --cuda 13, --tpu, --cpu, --venv PATH, --conda NAME, --version X, and --pip to use pip instead of uv. They follow sh -s --:

Terminal window
curl -LsSf https://dewml.dev/install.sh | sh -s -- -y --venv ~/envs/dew --cuda 12

Dew runs on its own build of JAX (Dew’s JAX build), which Dew’s package index serves, so every install names it:

Terminal window
uv pip install dewml --extra-index-url https://pypi.dewml.dev/simple

Each command installs that JAX build and the matching accelerator build of jaxlib for the hardware:

Hardwareuvpip
CPUuv pip install dewml --extra-index-url https://pypi.dewml.dev/simplepip install dewml --extra-index-url https://pypi.dewml.dev/simple
NVIDIA GPU, driver 580+ (CUDA 13)uv pip install "dewml[cuda13]" --extra-index-url https://pypi.dewml.dev/simplepip install "dewml[cuda13]" --extra-index-url https://pypi.dewml.dev/simple
NVIDIA GPU, driver 525+ (CUDA 12)uv pip install "dewml[cuda12]" --extra-index-url https://pypi.dewml.dev/simplepip install "dewml[cuda12]" --extra-index-url https://pypi.dewml.dev/simple
Google TPU VMuv pip install "dewml[tpu]" --extra-index-url https://pypi.dewml.dev/simplepip install "dewml[tpu]" --extra-index-url https://pypi.dewml.dev/simple

Use pip 26.2.2 or newer and uv 0.13.4 or newer: older ones trust the roots of eMudhra’s compromised certificate authorities (October 2026). Update pip from its wheel by hash, so the update holds whatever the older pip trusts, and uv through the system’s certificates once they are updated:

Terminal window
python -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
UV_SYSTEM_CERTS=true uv self update

Without the index the install stops before it installs anything: dewml’s releases are on Dew’s index beside Dew’s JAX build, which PyPI does not hold, and PyPI’s dewml is a pointer whose build stops with dewml is not installed from PyPI. and the command to run. Add --extra-index-url https://pypi.dewml.dev/simple and run it again.

Which CUDA build explains the choice between the two. With uv, make an environment first:

Terminal window
uv venv --python 3.14
source .venv/bin/activate
uv pip install dewml --extra-index-url https://pypi.dewml.dev/simple

To install the current revision of the repository instead of the release, name it: uv pip install "dewml @ git+https://github.com/AshishKumar4/dew" --extra-index-url https://pypi.dewml.dev/simple, and pin a commit, "dewml @ git+https://github.com/AshishKumar4/dew@<commit>", to reproduce a run later. Dew installs its JAX build and the Flax release pyproject.toml’s dependencies allow.

The CPU install is enough for the Quickstart.

import jax
import flax
import dew
print("Dew:", dew.__version__)
print("JAX:", jax.__version__)
print("Flax:", flax.__version__)
print("Devices:", jax.devices())

jax.devices() lists the devices this process can use, which can be fewer than the accelerators in the machine.

The cuda13, cuda12 and tpu extras each install the accelerator build of jaxlib that matches Dew’s JAX build; they are JAX’s own extras of the same names. A later -U "jax[...]" would replace it with a release Dew isn’t tested on. Extras combine, as in dewml[cuda13,interop,streaming].

The driver and the GPU decide the build, newest first:

BuildCUDANVIDIA driverGPU (SM)
cuda1313.0 or later580 or later, or an older one under NVIDIA’s cuda-compat7.5 or later
cuda1212.0 or later525 or later, or an older one under NVIDIA’s cuda-compat5.2 or later

nvidia-smi --query-gpu=driver_version,compute_cap --format=csv,noheader prints both; with several GPUs the oldest SM counts. These are the minimums in the JAX installation guide and in Table 3 of NVIDIA’s CUDA release notes. The CUDA version is the one the driver library a process loads supports: a driver’s own, or a newer one under NVIDIA’s forward-compatibility package (cuda-compat), which runs the cuda13 build on a 570 driver; Dew reads it from the library (cuDriverGetVersion). Neither build runs on an older GPU. The dewml.dev install script chooses by the driver alone.

A run applies it too: on a machine with an NVIDIA GPU, prepare_process, or the first Trainer.fit of a program that never called it, raises dew.training.CPUOnlyJax when JAX opened on the CPU, naming the install that fixes it where no CUDA build is installed or the installed one can’t run on this driver. import dew asks nothing of the hardware, so the check runs once the process’s XLA flags are set. JAX_PLATFORMS selects the backend before JAX is imported. JAX_PLATFORMS=cpu python train.py runs on the CPU on a GPU machine, and the check leaves it alone. On Colab the tutorials install dewml[cuda13]. Cloud TPUs covers TPU provisioning.

Dew requires jax>=0.12.0.1.post60,<0.12.1.

It is the JAX release that requirement names, with fixes no JAX release has yet, built from AshishKumar4/jax and served by Dew’s package index, the one every install above names, which serves Dew’s JAX build, dewml’s releases and the forks Dew carries, Qwix’s build among them (the quantization extra). The CUDA plugins the cuda12 and cuda13 extras install (jax-cuda12-plugin, jax-cuda13-plugin) and their PJRT plugins (jax-cuda12-pjrt, jax-cuda13-pjrt, where Mosaic GPU compiles a kernel’s PTX) are Dew’s builds of its native code, post45’s, which post46’s to post60’s Python fixes left as it was, carrying the Mosaic GPU fixes below that live in them, and the index serves them too. Every other package, jaxlib included, comes from PyPI. The fixes:

  • A Pallas Triton kernel’s cache key leaves out its source locations (jax-ml/jax#41502), so two checkouts share one compiled kernel. JAX is removing its Pallas Triton backend and takes no change to it, so this fix stays in the build while Dew runs Pallas Triton.
  • The device-to-host transfer guard holds on a CPU array’s first implicit host read (float, item, np.asarray, its buffer), as on the copy an accelerator array’s first read caches.
  • Pallas Triton divides 16-bit floats and computes erf_inv through float32, correctly rounded, which a GEMM template’s prologue dividing in bfloat16 needs on CUDA.
  • A custom_vjp call (and Mosaic GPU’s custom_jvp call) in a Pallas Triton or Mosaic GPU kernel lowers as its primal function, which a template’s score hook through a jax.custom_vjp needs.
  • Mosaic GPU relays an MMA’s accumulator out to a 16-bit MMA’s left operand in registers, and an abstract device states its compute capability, which Mosaic GPU lowers for: the templates’ Mosaic kernels need both on sm80.
  • The persistent compilation cache keys a CPU program by the host’s CPU, which XLA:CPU compiles for, and every program by JAX’s own build as well as jaxlib’s, so neither another CPU nor another build over one jaxlib reads a program it cannot run.
  • Mosaic GPU and Pallas Mosaic GPU lower ceil and floor, which a template’s Mosaic kernel that rounds a value needs on an H100.
  • Pallas Mosaic GPU lowers add_any and integer_pow of every integer exponent, which the Mosaic attention backward under a score hook needs: a hook’s transposed pullback sums its cotangents, and a temperature’s backward raises it to the power -2.
  • Mosaic GPU’s layout inference solves groups of unknowns that no constraint relates separately, so sm80’s mma.sync GEMM tiles find their layouts.
  • A Mosaic GPU MMA may state its warpgroup’s warp split (plgpu.mma(..., m_warps=...)), for Ampere GEMM tiles that split their warps 2 x 2.
  • A platform-dependent conditional whose lowering keeps one branch lowers that branch inline, so a collective inside it is not a runtime conditional; on the CPU, devices diverged on such a conditional.
  • A block’s Mosaic GPU warpgroups each take their own share of the reduction scratch.
  • A Mosaic GPU kernel’s debug info stays out of the persistent compilation cache key, so the same kernel compiled from two checkouts keys alike.
  • A Pallas kernel’s body may call a call primitive (a span a library marks, as jax.extend.core.create_call_primitive makes one): on Mosaic GPU, Triton and Mosaic TPU it lowers as its body, inlined where it is.
  • Under checkify a call primitive is checked within its body and kept a call, as jit’s is; it raised a TypeError before.
  • Under vmap, a staged custom_jvp call with a mapped input is batched alike in its primal and its JVP, so its gradient is its function’s: a jitted custom_jvp under vmap with an unmapped argument doubled it before. Returning such a call’s output shared (out_axes=None, or sum_match) is refused, naming the call; an unjitted one, or one with no mapped input, returns it shared as before.
  • JAX takes as its CUDA root only a package that holds ptxas: CUDA 13’s wheels share nvidia/cu13, so one of its other tools installed beside CUDA 12’s compiler (nvdisasm, which the test suite’s environment carries) left JAX’s root the string None, and XLA linked the system CUDA’s libdevice.
  • A mesh of compile-only GPUs (a topology’s devices, which state their compute capability) carries that capability into its abstract device, so a step compiled ahead for an A100 on a host with no GPU lowers its Mosaic kernels for sm80; they were lowered for sm90, which an A100 cannot run.
  • A compile-only Mosaic GPU target, one that states its compute capability or, stating none, another GPU’s kind (an H100 lowered on an A100’s host), is held to its own default shared memory limit, not the attached device’s.
  • A transformation keeps a wide dtype its trace already holds, while a Python type asked of a wide value still narrows as a user’s request.
  • Pallas’s Mosaic GPU interpreter transfers a thread map’s constants and inputs to the device once, shared by its threads.
  • Pallas’s Mosaic GPU slices, applies pointwise ops to and broadcasts a unit row or column of a tiled array.
  • Mosaic GPU’s CP_ASYNC copies a head’s [S, D] block of [B, S, H, D], a squeezed dimension between sliced ones, under a tile transform.
  • Mosaic GPU’s emit_pipeline carries its ring slots rather than recomputing them each step.
  • Mosaic GPU’s WGMMA forms its shared-operand descriptors at its instructions rather than hoisting them out of an enclosing loop.
  • Mosaic GPU’s TMA load coordinates reach ptxas as values it cannot fold: ptxas had miscompiled a literal coordinate into a misaligned copy, which stopped the attention training forward at head dim 128 on an H100 on an illegal instruction.
  • A persistent compilation cache entry is written aside and renamed into place, so a process reading the cache beside its writer, as packed jobs on one GPU do, sees the whole entry or none of it.
  • Resetting the compilation cache (jax.experimental.compilation_cache.compilation_cache.reset_cache) takes the lock its initialization holds, so a compile that sets the cache up while a reset runs is waited for, and the reset never leaves a cache behind that its flags call uninitialized.
  • JAX_EXPLAIN_CACHE_MISSES explains, rather than fails, a Pallas Triton reduction, whose body’s earlier traces are keyed by keyword.
  • Mosaic GPU compiles a kernel’s PTX with nvJitLink off, so ptxas honours its warpgroups’ register raises (setmaxnreg), which it ignored in a relocatable compile (ptxas warning C7504; upstream f365a65e3a). This fix lives in the PJRT plugin, where Mosaic GPU’s custom call compiles: post42 carried it in the CUDA plugin alone, and its kernels compiled through the release’s PJRT plugin, so it holds from post43.
  • A Mosaic GPU kernel may state its minimum resident blocks per SM (min_blocks_per_sm), which bounds the registers ptxas gives each thread. This fix lives in the CUDA and PJRT plugins.
  • Mosaic GPU’s untiled CP_ASYNC copies follow the source’s strides and alignment, so a block narrower than its row reads the rows it names.
  • A Mosaic GPU mma.sync multiplies float32 operands as TF32 (m16n8k8.tf32), each rounded to nearest first, and transfers 32-bit operands without ldmatrix.
  • Mosaic GPU issues scoped and ordered atomics, memory fences and griddepcontrol (programmatic dependent launch), and Pallas Mosaic GPU’s barrier_wait takes an explicit parity, checked by its interpreter.
  • Pallas’s Mosaic GPU interpreter hands its own callbacks the host’s NumPy arrays, with no transfer to the CPU device a call; jax.experimental.io_callback still hands its callback jax.Arrays.
  • Ragged products differentiate through contracting and batch dimensions at higher orders, preserving explicit sharding, metadata prefixes and the requested accumulation precision, a named dot algorithm among them; grouped expert products can take reverse-over-reverse derivatives.
  • A reduction’s forward derivative keeps a symbolic zero tangent zero instead of materializing it, and Mosaic GPU’s warpgroup loads preserve their requested fragment layout.
  • Triton’s pipeliner gives a loaded tile a second shared-memory buffer a stage where a wgmma reads it from shared memory and another use reads it in registers, so the next stage’s copy no longer overwrites the tile while the wgmma still reads it (Pallas Triton attention’s backward on an H100 computed dK wrong, and differently each run, at two stages). The patch is to the Triton XLA builds, in the CUDA and PJRT plugins, from post45.
  • Mosaic GPU’s layout inference computes each check of a shared-memory-to-registers transfer once, where its search asked the same one again on every reduction, about a millisecond a time: an sm90 Kimi delta attention kernel with three shared-memory scratch refs had spent 134 s of 150 s in it, and its lowering ran past ten minutes.
  • A Pallas Mosaic GPU scratch ref can state that it is plain, neither tiled nor swizzled (plgpu.PlainTransform()), so layout inference takes its layout as given rather than searching every tiling and swizzle for it and its subviews, which ran out of fuel on Kimi delta attention’s (64, 32) subviews read at row offsets no tiling divides. With both, that kernel’s forward lowers in 3.8 s and compiles in 8.2 s for sm90.
  • A Mosaic GPU async_load after a warpgroup barrier and the GPU dialect’s index and dimension reads or its dynamic shared memory base takes no automatic barrier of its own, as none of them touches a thread’s shared memory: a pre-Hopper pipeline’s step synchronizes once, which made an A100 GEMM’s kernel gradient 8% faster.
  • A program’s compilation cache key reads each kernel its custom calls serialize in an MLIR context of its own, so threads keying programs at once, each of them holding Mosaic GPU kernels, key them alike; the program’s own context, which its thread’s lowerings share, is left as it was.
  • Mosaic GPU’s emit_pipeline runs collectively over a thread axis (thread_axis): every thread of a kernel’s warpgroups runs one input pipeline over shared buffers, each copying an equal share of a block on a pre-Hopper GPU, as an Ampere kernel with several consumer warpgroups splits its loads.
  • Pallas Mosaic GPU’s multiple_of lowers in a warp’s code (plgpu.warp_map): a persistent kernel’s load or product warp proves a slice start’s divisibility to layout inference as a warpgroup’s does, so a tcgen05 GEMM’s TMA row start lowers.
  • Mosaic GPU’s layout inference answers each SMEM-to-registers transfer check once per target, so one process compiling a kernel for an H100 and a B200 reads each GPU’s own answer (a transposed 8-bit transfer is Blackwell’s alone).
  • lax.ragged_all_to_all’s transpose and batching keep its axis_index_groups, so a grouped exchange’s gradient is its own (upstream’s fix, carried until a release has it).
  • lax.ragged_all_to_all lowers on the CPU, which emits no ragged collective of its own: one padded all_to_all of each peer’s run and of the offsets each sender states, each received run written where the ragged collective lands it, so a mixture of experts’ token exchange runs on every platform.
  • A checkify check whose error reaches a shard_map manual over some of a mesh’s axes traces its errors under the body’s manual axes and partitions them over those axes alone; such a check failed on a context-mesh mismatch or the manual axes’ order, so a sampling loop under checkify can run an expert exchange.
  • A custom_jvp whose primal makes and frees its own refs (a kernel’s in-place outputs) discharges them inside a jit, rebound on its discharged primal with its custom JVP kept; a custom_jvp taking a ref argument stays refused. A grouped paged-KV decode’s in-place kernel holds such refs.

Each fix goes from the build once a JAX release has it, and Dew then returns to that release.

The plain install includes Transformers, the Hugging Face Hub client and the image libraries. These extras add more:

ExtraAdds
cuda12, cuda13JAX’s CUDA build and Dew’s FlashAttention wheel for that CUDA major (Which CUDA build)
tpulibtpu, for Cloud TPUs
interopsafetensors reading and writing
torchPyTorch on the host, to read pytorch_model.bin files and to check unregistered decoders against Transformers
diffusersLoading original-format single-file diffusion checkpoints (Pretrained.load(..., single_file=))
ggufLoading GGUF files (Pretrained.load(..., gguf_file=))
wanftfy, which cleans Wan 2.1’s prompts as its pipeline does
torchaxTier 3 of Pretrained.load, which runs a Transformers PyTorch model lowered to JAX: an unregistered causal LM, or any checkpoint with fallback="torchax"
guidedRegex and JSON-schema guided decoding (dew.sampling.guided)
streamingHugging Face datasets and online sources
deltadeltalake, to read Delta tables
curationDataTrove’s language, quality, fastText and decontamination filters with spaCy’s word splitting (dew.data.text.Language, Quality, Classifier, Decontaminated)
tfdsReading prepared TFDS ArrayRecords without TensorFlow
avVideo readers (moviepy, with ffmpeg)
visionHugging Face image processors, run with torchvision on the host
augmentAlbumentations pipelines as a seeded random step (dew.data.images.Albumentations)
metricsrequests, which downloads FID’s Inception weights
wandb, mlflow, tensorboardExperiment trackers
inference-clientsThe Ollama and OpenAI Python clients, including vLLM-compatible endpoints
serveStarlette and uvicorn, for serving a decision model in Jev’s wire format (examples/serve_decisions.py)
environmentsAgent environments and remote sandboxes for rollouts: OpenEnv and the Modal, E2B and Daytona SDKs
playgroundMuJoCo Playground’s MJX environments as Dew environments (dew.rl.playground)
hyperluxHyperLux’s ray tracer drawing the gate race’s cameras (dew.rl.hyperlux), on an NVIDIA GPU with OptiX
hpoOptuna, for dew.config.sweep
eval-harnesslm-evaluation-harness tasks through dew.eval.harness.DewLM
profileThe xprof profiler
quantizationQwix, for quantized training and serving (dew.quantization)
testThe test suite’s dependencies and pinned reference libraries
ciThe test suite’s whole environment: test and every extra a test file imports
kernel-compileJAX’s CUDA plugin, CUDA’s compiler and libtpu, to compile every kernel config on a host with no accelerator
notebooksnbclient, nbformat and an IPython kernel, to execute notebooks
tutorialsThe tutorial notebooks’ environment outside Colab: streaming, interop, notebooks and matplotlib
liveThe live site container’s bridge: its WebSocket release, the kernel gateway, an IPython kernel and ipywidgets
Terminal window
uv pip install 'dewml[interop,streaming] @ git+https://github.com/AshishKumar4/dew' --extra-index-url https://pypi.dewml.dev/simple

The vision extra expects CPU builds of PyTorch and torchvision, installed first, so that no CUDA PyTorch sits beside JAX’s accelerator runtime. Without it the native multimodal checkpoints still load, but their processors raise an error when given images.

Terminal window
uv pip install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install 'dewml[interop,vision] @ git+https://github.com/AshishKumar4/dew' --extra-index-url https://pypi.dewml.dev/simple

Run the first command even if CPU torch is already installed. Installing vision from PyPI alone can add a CUDA-enabled torchvision beside it on Linux. Its torch requirement accepts the CPU build, but its extension cannot load and importing it fails with operator torchvision::nms does not exist. Resolving both from the CPU index gives them the same build flavor; --upgrade also replaces an existing torchvision from the wrong index. A package extra cannot select an index.

The profile extra installs XProf, never 2.23.2. XProf 2.23.2 declares setuptools<70, and PyTorch 2.13 and later declare setuptools>=77.0.3, so 2.23.2 can’t be installed beside the torch, vision, diffusers, torchax or test extras. Don’t upgrade XProf to 2.23.2 by hand in such an environment.

FlashAttention comes as Dew’s own wheel, dew-flash-attn-cu12 or dew-flash-attn-cu13 (kernels/flash_attn), for the CUDA major of your jax: FlashAttention-2 for sm8x and sm120, and FlashAttention-3 for Hopper (sm90). The cuda12 and cuda13 extras install it on Linux x86_64 and aarch64 (a GH200). With it installed, "auto" runs it on the GPUs whose measured kernel it is, for the calls its requirements admit (FLASH_SUPPORTS in dew.nn.attention_kernels); a call it turns down on such a GPU is logged once, with why.

CUTLASS’s grouped GEMMs come as Dew’s own wheel too, dew-cutlass-cu12 or dew-cutlass-cu13 (kernels/cutlass), from Dew’s package index, with the cuda12 and cuda13 extras on Linux x86_64 and aarch64: a mixture of experts’ projection placed on CUTLASS runs it on the GPUs whose grouped kernels the installed build holds (dew_cutlass.ARCHITECTURES, Hopper’s today).

tokamax comes with Dew: Dew’s Pallas kernels take the config they derive from the GPU’s facts, which is fast without tuning. The opt-in tuner (dew.nn.kernels.tuning), python tools/kernel_picks.py or Trainer(tune_kernels=True), times a few tested variants of each kernel’s config on a GPU it has to itself and stores the fastest for the GPU model; a later compile takes those picks, else the nearest measured shape’s, else the derived config, and measures nothing. Which kernel "auto" runs for a call is the selectors’ (kernels and precision). Earlier releases pin typeguard==2.13.3, which tyro excludes, so installing one by hand breaks every recipe’s command line.

Terminal window
git clone https://github.com/AshishKumar4/dew.git
cd dew
uv venv --python 3.14
source .venv/bin/activate
sh tools/install_environment.sh cpu # cuda12 or cuda13 on a GPU host

The ci extra is the test suite’s environment, every package a test file imports. tools/lock_environment.sh locks it in locks/, and CI, the GPU nodes and the kernel lab’s GPU jobs all install the lock for their host, with the same JAX build CI uses: constraints.txt names Dew’s JAX build, which the multi-process cache tests need. PyTorch is used only by the reference tests and the image processors; Dew’s model computation runs in JAX.

CI runs on CPUs. Two diagnostics read a new JAX release on a GPU when you want them, Colab’s among them:

  • tests/test_gpu_recurrence.py’s cell “a gated delta net decodes on its step kernel” and tests/test_decode_attention.py::test_the_decode_kernel_reads_each_row_to_its_length_at_every_config: the gated delta net’s and the decode attention’s kernels are on the Pallas Triton backend JAX 0.11 deprecates, and each one’s fits is its off switch;
  • python tools/gpu_profile_check.py --out out/profile-check, about a minute: a warmed step captured under dew.Profiler with command buffers on and off. It fails unless the capture with them off attributes device time to HLO ops and every capture’s device time a step is positive and within its wall time. It records whether the default capture attributes ops (none on 0.11.2) and whether XLA ran its command buffers op by op for the session, so a release that changes either shows.

Quirks of XLA’s CPU backend that Dew records rather than works around (CONTRIBUTING.md’s one exception): the same computation in float64 shows Dew’s own arithmetic right in each.

  • A reduction split across CPU devices, a bias gradient summed over the positions a layout splits among them, takes none of the YNNPACK fusion the same reduction takes on one device: each shard sums with XLA’s own reduction, so the split result is the unfused one’s, 1.57 times one device’s error from float64 for a [8192, 3] float32 sum and 5.7 times for a split Dense bias gradient. With xla_cpu_experimental_ynn_fusion_type="" the two agree (ledger row 4520).
  • A float32 dot whose output is narrower than 16 runs through YNNPACK’s generic dot_1x1x1, which rounds each product before it adds it; from width 16, and in XLA’s own dot, each product is fused into its sum (ledger row 4522).
  • An attention’s weighted sum over many keys is one plain float32 dot (dot_f32_f32_f32), where PyTorch’s CPU kernel sums in blocks: over the 1,296 keys of a decision head’s evidence cross-attention, Dew’s CPU error at that sum is 2.4 to 2.9 times PyTorch’s, and the same products summed in float64 are 0.55 times (ledger row 4610).

A run, a recipe’s or a library Trainer.fit’s, and a loaded task keep JAX’s persistent compilation cache on by default, so a restart reads the programs the last run compiled instead of compiling them again. Dew stores compiled executables in ~/.cache/dew/xla/python3.X, or $XDG_CACHE_HOME/dew/xla/python3.X when XDG_CACHE_HOME is set, and the GPU autotuner’s picks beside them for each jaxlib. Hosts that share a home directory share it whatever their CPU: XLA compiles a CPU program for the host that compiles it, and Dew’s JAX build keys the program by that host’s CPU, so no host reads one that would not link there. A directory named in JAX_COMPILATION_CACHE_DIR is used as it is. JAX_ENABLE_COMPILATION_CACHE=false turns the cache off. JAX writes entries from process 0 alone, so a process pool caches only where every process reads the cache directory as one, which Dew checks as the pool forms: a pool on one host, or on hosts that share a home directory, caches by default, and a pool whose hosts each keep their own compiles every run unless it names a directory on storage they share (compilation_cache_dir). Caches apart would find a step on one process and compile it on another, which waits for ever for its peers. JAX keeps every entry (jax_compilation_cache_max_size is unbounded by default); set it, or clear the directory, to bound its size. Each Python minor version has its own directory because JAX 0.11 on Python 3.14 compresses entries with compression.zstd while its cache key still says zlib, and an older interpreter cannot read them. A run that passes its own compilation_cache_dir uses that path as given, so do not share one explicit directory between Python versions.

Training reads prepared TFDS ArrayRecords and does not import TensorFlow. Preparing a dataset does need TensorFlow and sometimes dataset-specific packages (Oxford Flowers reads its label files with SciPy). TFDS 4.9.10 also imports importlib_resources while it prepares a dataset but only declares it for Python before 3.9, so the command installs it too.

Preparation is explicit: call TFDS.provision(), pass provision=True to load, or run dew data provision tfds://mnist. Those choices can download data. Indexed reads otherwise require prepared ArrayRecords and name the missing artifact. TensorFlow 2.21.0 has no Python 3.14 wheels, so prepare in a separate Python 3.13 environment when needed:

Terminal window
uv venv --python 3.13 .venv-tfds-prepare
uv pip install --python .venv-tfds-prepare/bin/python \
tensorflow-datasets==4.9.10 tensorflow==2.21.0 scipy importlib_resources
export TFDS_DATA_DIR="$HOME/tensorflow_datasets"
.venv-tfds-prepare/bin/python - <<'PY'
import shlex
import tensorflow_datasets as tfds
builder = tfds.builder("oxford_flowers102", try_gcs=False)
builder.download_and_prepare(
file_format="array_record",
download_config=tfds.download.DownloadConfig(try_download_gcs=False),
)
print("export DEW_FLOWERS_PATH=" + shlex.quote(str(builder.data_dir)))
PY

The script prints the prepared version directory. Run that export line in the training shell and bind it as the TFDS Source’s path:

import os
from dew.data import TFDS, images, presets
flowers = TFDS("oxford_flowers102", split="all", path=os.environ["DEW_FLOWERS_PATH"])
train, val = flowers.holdout(records=16)
caption = images.caption("a photo of a {label}")
data = train.shuffle(seed=0).repeat().pipe(presets.images, 64, batch=4, augment=True, caption=caption)
held = val.pipe(presets.images, 64, batch=4, caption=caption)

The images preset takes its caption’s class names from TFDS’s class-label metadata. Missing shards are named errors. Non-local, non-GCS TFDS stores currently require an explicit local provision mirror; they are not silently materialized.

The site at dewml.dev is built from docs/, the notebooks in tutorials/ with their recorded outputs, and API pages generated from the docstrings in src/dew. It needs the Node release engines names in site/package.json, pnpm and uv:

Terminal window
cd site
pnpm install
pnpm build
pnpm preview

pnpm build fails on a broken link, a notebook that records an error it does not declare, a public module without an API page, or a model family the supported-models page does not list; a notebook cell that recorded no output is shown without one, and named in the build’s log. pnpm dev serves the site with live reload.