{"record":{"id":"9be37d25c43b370b","repo":"keras-team/keras","slug":"the-provided-job-addresses-job-addresses-has-le","errorCode":null,"errorMessage":"The provided job_addresses {job_addresses} has {len(job_addresses)} jobs, but num_processes is {num_processes}","messagePattern":"The provided job_addresses (.+?) has (.+?) jobs, but num_processes is (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/distribution_lib.py","lineNumber":146,"sourceCode":"        # Sum across processes and pull out the first item.\n        global_seed = jax.pmap(\n            lambda x: jax.lax.psum(x, \"all\"),\n            axis_name=\"all\",\n            devices=cpu_devices,\n        )(local_seed).item(0)\n        # Set the global seed.\n        rng_utils.set_random_seed(global_seed)\n\n\ndef initialize(job_addresses, num_processes, process_id):\n    if job_addresses and \",\" in job_addresses:\n        # When user provide all the job addresses, we will split and get the\n        # first one, which is the coordinator.\n        job_addresses = job_addresses.split(\",\")\n        # Do a sanity check to make sure the number of addresses also match\n        # the num_processes.\n        if num_processes is not None and num_processes != len(job_addresses):\n            raise ValueError(\n                f\"The provided job_addresses {job_addresses} has \"\n                f\"{len(job_addresses)} jobs, but num_processes is \"\n                f\"{num_processes}\"\n            )\n        coordinator_address = job_addresses[0]\n    else:\n        coordinator_address = job_addresses\n\n    jax.distributed.initialize(\n        coordinator_address=coordinator_address,\n        num_processes=num_processes,\n        process_id=process_id,\n    )\n\n    # Ensure the random number generator is initialized across processes.\n    initialize_rng()\n\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/distribution_lib.py#L128-L164","documentation":"Error \"The provided job_addresses {job_addresses} has {len(job_addresses)} jobs, but num_processes is {num_processes}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/distribution_lib.py:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}