{"record":{"id":"c77da4e76a5f6ce1","repo":"jax-ml/jax","slug":"only-one-of-core-axis-or-core-axis-name-can-be","errorCode":null,"errorMessage":"Only one of `core_axis` or `core_axis_name` can be set.","messagePattern":"Only one of `core_axis` or `core_axis_name` can be set\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/pipeline.py","lineNumber":2023,"sourceCode":"    out_specs=(),\n    tiling: Tiling | None = None,\n    core_axis: tuple[int, ...] | int | None = None,\n    core_axis_name: tuple[str, ...] | str | None = None,\n    dimension_semantics: tuple[GridDimensionSemantics, ...] | None = None,\n    trace_scopes: bool = True,\n    no_pipelining: bool = False,\n    _explicit_indices: bool = False,\n):\n  in_specs = _normalize_specs(in_specs)\n  out_specs = _normalize_specs(out_specs)\n\n  if any(g <= 0 for g in grid if isinstance(g, int)):\n    raise ValueError(\n        f\"All elements in the grid must be strictly positive, but got {grid=}\"\n    )\n\n  if core_axis is not None and core_axis_name is not None:\n    raise ValueError(\"Only one of `core_axis` or `core_axis_name` can be set.\")\n  core_axis_ = core_axis_name if core_axis is None else core_axis\n  if dimension_semantics is None:\n    dimension_semantics = (ARBITRARY,) * len(grid)\n\n  num_in_specs = len(in_specs)\n\n  def wrapped(*args, allocations=None, **kwargs):\n    num_cores, core_id = _resolve_core_info(core_axis_)\n\n    if allocations is not None and not in_specs and not out_specs:\n      flat_allocs = [\n          b for b in allocations if isinstance(b, BufferedRefBase) or b is None\n      ]\n      in_specs_ = tuple(\n          b.spec if isinstance(b, BufferedRefBase) else None\n          for b in flat_allocs if b is None or b.buffer_type == BufferType.INPUT\n      )\n      out_specs_ = tuple(","sourceCodeStart":2005,"sourceCodeEnd":2041,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/pipeline.py#L2005-L2041","documentation":"Multi-core grid partitioning can be specified either positionally via core_axis or by name via core_axis_name. Supplying both is ambiguous, so the API rejects it with ValueError.","triggerScenarios":"Calling emit_pipeline with both core_axis=1 and core_axis_name='data' set on the same invocation.","commonSituations":"Refactoring from positional to named axis specification and leaving both arguments populated; copy-pasted kwargs from another call site.","solutions":["Keep exactly one of core_axis or core_axis_name; prefer core_axis_name for clarity","If defaults leaked in from a config dict, unset the other key before passing kwargs"],"exampleFix":"# before\nemit_pipeline(..., core_axis=1, core_axis_name='data')\n# after\nemit_pipeline(..., core_axis_name='data')","handlingStrategy":"validation","validationCode":"assert not (core_axis is not None and core_axis_name is not None), \\\n    'pass only one of core_axis / core_axis_name'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on core_axis_name in your codebase","Sanitize kwargs dicts before forwarding to emit_pipeline"],"tags":["jax","pallas","mutually-exclusive-args","validation"],"backgroundTag":"conflicting-arguments","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}