jax-ml/jax · error · ValueError

Cannot provide both 'factory' and 'options' when registering

Error message

Cannot provide both 'factory' and 'options' when registering PJRT plugin. When providing a custom factory, the factory's must handle its own options.

What it means

Error "Cannot provide both 'factory' and 'options' when registering PJRT plugin. When providing a custom factory, the factory's must handle its own options." thrown in jax-ml/jax.

Source

Thrown at jax/_src/xla_bridge.py:625

  """

  if library_path and c_api:
    logger.error(
        "Both library_path and c_api are provided when registering PJRT plugin"
        " %s",
        plugin_name,
    )
    return
  if not library_path and not c_api:
    logger.error(
        "Neither library_path nor c_api provided when registering PJRT plugin"
        " %s",
        plugin_name,
    )
    return

  if factory is not None and options is not None:
    raise ValueError(
        "Cannot provide both 'factory' and 'options' when registering PJRT"
        " plugin. When providing a custom factory, the factory's must handle"
        " its own options."
    )
  if factory is None:
    factory = partial(make_pjrt_c_api_client, plugin_name, options=options)

  logger.debug(
      'registering PJRT plugin %s from %s', plugin_name, library_path
  )
  if library_path is not None:
    c_api = xla_client.load_pjrt_plugin_dynamically(plugin_name, library_path)
    _profiler.register_plugin_profiler(c_api)
  else:
    assert c_api is not None
    xla_client.load_pjrt_plugin_with_c_api(plugin_name, c_api)

  make_topology = make_topology or partial(xla_client.make_c_api_device_topology, c_api)

View on GitHub (pinned to 1e1c6a8fc0)

When it happens

Trigger: Thrown at jax/_src/xla_bridge.py:625 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27). Data as JSON: /api/errors/d1d41b1e91041cb3. Report an issue: GitHub.