jax-ml/jax · error · ValueError

PJRT plugin config file should contain "library_path" field.

Error message

PJRT plugin config file should contain "library_path" field.

What it means

Raised by _get_pjrt_plugin_config when the JSON plugin config file pointed to by the env variable lacks the required "library_path" field giving the plugin shared-library location. Only library_path is mandatory; create_option is optional.

Solutions

  1. Add a 'library_path' key pointing to the plugin shared library in the plugin JSON config file
  2. Check the JSON path configured for the PJRT plugin points to the correct config file
  3. Regenerate the plugin's config file from its installation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at jax/_src/xla_bridge.py:428 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/3a9b6c23cc4794ee. Report an issue: GitHub.

Appendix: source

Thrown at jax/_src/xla_bridge.py:428


def _get_pjrt_plugin_config(
    json_path: str,
) -> tuple[
    str, Mapping[str, str | int | list[int] | float | bool] | None
]:
  """Gets PJRT plugin configuration from a json file.

  The json file needs to have a "library_path" field for the plugin library
  path. It can have an optional "create_option" field for the options used when
  creating a PJRT plugin client. The value of "create_option" is key-value
  pairs. Please see xla_client._NameValueMapping for the supported types of
  values.
  """
  with open(json_path) as f:
    config = json.load(f)
  if 'library_path' not in config.keys():
    raise ValueError(
        'PJRT plugin config file should contain "library_path" field.'
    )
  return (config['library_path'], config.get('create_options'))

def discover_pjrt_plugins() -> None:
  """Discovers plugins in the namespace package `jax_plugins` and import them.

  There are two methods used to discover plugin modules. They are intended
  to be used together by implementers in order to cover all packaging and
  development cases:

  1. Define a globally unique module under the `jax_plugins` namespace
     package (i.e. just create a `jax_plugins` directory and define your
     module below it).
  2. If building a package via pyproject.toml or setup.py, advertise your
     plugin module name by including an entry-point under the `jax_plugins`
     group which points to your full module name.

View on GitHub (pinned to 1e1c6a8fc0)