{"record":{"id":"231b484f079d9358","repo":"jax-ml/jax","slug":"slice-index-has-been-deprecated-please-use-par","errorCode":null,"errorMessage":"`slice_index` has been deprecated. Please use `partition_index` instead.","messagePattern":"`slice_index` has been deprecated\\. Please use `partition_index` instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"jax/_src/distributed.py","lineNumber":405,"sourceCode":"  with address ``10.0.0.1:1234``. To initialize the GPU cluster, run the\n  following commands before anything else.\n\n  On process 0:\n\n  >>> jax.distributed.initialize(coordinator_address='10.0.0.1:1234', num_processes=2, process_id=0)  # doctest: +SKIP\n\n  On process 1:\n\n  >>> jax.distributed.initialize(coordinator_address='10.0.0.1:1234', num_processes=2, process_id=1)  # doctest: +SKIP\n  \"\"\"\n  if xla_bridge.backends_are_initialized():\n    raise RuntimeError(\"jax.distributed.initialize() must be called before \"\n                        \"any JAX calls that might initialise the XLA backend. \"\n                        \"This includes any computation, but also calls to jax.devices, jax.device_put, and others.\")\n  if partition_index is None:\n    if slice_index is not None:\n      # Deprecation added 2025-08-05. Should be removed after 3 months.\n      warnings.warn(\n          '`slice_index` has been deprecated. Please use `partition_index` instead.',\n          DeprecationWarning,\n      )\n    partition_index = slice_index\n  global_state.initialize(coordinator_address, num_processes, process_id,\n                          local_device_ids, cluster_detection_method,\n                          initialization_timeout, coordinator_bind_address,\n                          heartbeat_timeout_seconds=heartbeat_timeout_seconds,\n                          shutdown_timeout_seconds=shutdown_timeout_seconds,\n                          partition_index=partition_index,\n                          mtls_cert_file=mtls_cert_file,\n                          mtls_key_file=mtls_key_file,\n                          mtls_ca_file=mtls_ca_file,\n                          mtls_peer_uri_prefix=mtls_peer_uri_prefix,\n                          verify_secure_credentials=verify_secure_credentials)\n\n\ndef is_initialized() -> bool:","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/distributed.py#L387-L423","documentation":"jax.distributed.initialize() was called with the slice_index keyword argument, renamed to partition_index (deprecation added 2025-08-05). JAX warns and forwards the value to partition_index.","triggerScenarios":"Explicitly calling jax.distributed.initialize(slice_index=...) in code; the value is used as partition_index after the warning.","commonSituations":"Existing multi-host training scripts written against older JAX APIs; libraries/tutorials that demonstrate initialize with slice_index.","solutions":["Rename the kwarg: jax.distributed.initialize(partition_index=...).","Update any wrapper utilities that forward slice_index via **kwargs.","Grep the codebase for 'slice_index' to catch all call sites before the deprecation is accelerated."],"exampleFix":"# before\njax.distributed.initialize(coordinator_address=..., num_processes=8, process_id=rank, slice_index=idx)\n# after\njax.distributed.initialize(coordinator_address=..., num_processes=8, process_id=rank, partition_index=idx)","handlingStrategy":"validation","validationCode":"import inspect, jax\nparams = inspect.signature(jax.distributed.initialize).parameters\nassert 'partition_index' in params and 'slice_index' in params  # both accepted for now","typeGuard":null,"tryCatchPattern":"with warnings.catch_warnings(record=True) as w:\n    warnings.simplefilter('always', DeprecationWarning)\n    jax.distributed.initialize(coordinator_address=..., num_processes=n, process_id=i, slice_index=i)\n# rename kwarg once warning observed","preventionTips":["Use only documented kwargs; avoid **kwargs forwarding into initialize.","Grep codebase for 'slice_index' when upgrading JAX past 2025-08."],"tags":["jax","distributed","api-rename","deprecation"],"backgroundTag":"renamed-function-parameter","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}