{"record":{"id":"ac5d3df3261b49fa","repo":"jax-ml/jax","slug":"unreduced-for-min-is-not-yet-supported","errorCode":null,"errorMessage":"unreduced for min is not yet supported.","messagePattern":"unreduced for min is not yet supported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/ops/scatter.py","lineNumber":450,"sourceCode":"    segment minimums.\n\n  Examples:\n    Simple 1D segment min:\n\n    >>> data = jnp.arange(6)\n    >>> segment_ids = jnp.array([0, 0, 1, 1, 2, 2])\n    >>> segment_min(data, segment_ids)\n    Array([0, 2, 4], dtype=int32)\n\n    Using JIT requires static `num_segments`:\n\n    >>> from jax import jit\n    >>> jit(segment_min, static_argnums=2)(data, segment_ids, 3)\n    Array([0, 2, 4], dtype=int32)\n  \"\"\"\n  out_sharding = canonicalize_sharding(out_sharding, 'segment_min')\n  if out_sharding is not None and out_sharding.spec.unreduced:\n    raise NotImplementedError('unreduced for min is not yet supported.')\n  return _segment_update(\n      \"segment_min\", data, segment_ids, slicing.scatter_min, num_segments,\n      indices_are_sorted, unique_indices, bucket_size, reductions.min,\n      mode=mode, out_sharding=out_sharding)\n","sourceCodeStart":432,"sourceCodeEnd":455,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/ops/scatter.py#L432-L455","documentation":"jax.ops.segment_min does not support unreduced output sharding. Passing an out_sharding whose spec sets unreduced=True triggers NotImplementedError because only segment_sum implements the unreduced lowering.","triggerScenarios":"Calling jax.ops.segment_min(data, segment_ids, out_sharding=sharding) with an unreduced sharding spec in a multi-device/TPU program.","commonSituations":"Reusing sharding configs written for segment_sum with segment_min; distributed training pipelines using GSPMD annotations.","solutions":["Pass out_sharding=None for segment_min","Compute locally then redistribute the result with jax.device_put","Track upstream support for unreduced min"],"exampleFix":"# before\nout = jax.ops.segment_min(data, ids, out_sharding=unreduced_sharding)\n# after\nout = jax.ops.segment_min(data, ids)","handlingStrategy":"validation","validationCode":"if sharding is not None and getattr(sharding.spec, 'unreduced', False):\n    sharding = None\nout = jax.ops.segment_min(data, ids, out_sharding=sharding)","typeGuard":null,"tryCatchPattern":"catch NotImplementedError and recompute without sharding","preventionTips":["Gate unreduced sharding usage behind an op-support check","Keep a matrix of supported pallas/segment features per JAX version"],"tags":["jax","sharding","notimplementederror","distributed"],"backgroundTag":"unsupported-feature-flag","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}