{"record":{"id":"a23a0d374288756b","repo":"jax-ml/jax","slug":"jax-tried-to-execute-function-self-name-but-the","errorCode":null,"errorMessage":"JAX tried to execute function {self.name}, but the no_execution config option is set","messagePattern":"JAX tried to execute function (.+?), but the no_execution config option is set","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"jax/_src/interpreters/pxla.py","lineNumber":402,"sourceCode":"      if len(token_buf) == 1:\n        dispatch.runtime_tokens.set_token_result(eff, core.Token(token_buf[0]))\n      else:\n        token_devices = []\n        for token in token_buf:\n          assert len(token.sharding.device_set) == 1\n          token_devices.append(token.sharding._device_assignment[0])\n        s = NamedSharding(Mesh(token_devices, 'x'), P('x'))\n        global_token_array = array.make_array_from_single_device_arrays(\n            (0,), s, token_buf\n        )\n        dispatch.runtime_tokens.set_token_result(\n            eff, core.Token(global_token_array)\n        )\n\n  @profiler.annotate_function\n  def __call__(self, *args):\n    if config.no_execution.value:\n      raise RuntimeError(\n      f\"JAX tried to execute function {self.name}, but the no_execution config \"\n      \"option is set\")\n    args = [x for i, x in enumerate(args) if i in self.kept_var_idx]\n    if self.mut:\n      args = [*args, *self.mut.in_mut]\n    input_bufs = self.in_handler(args)\n    with profiler.PGLEProfiler.trace(self.pgle_profiler):\n      if (self.ordered_effects or self.has_unordered_effects\n          or self.has_host_callbacks):\n        input_bufs = self._add_tokens_to_inputs(input_bufs)\n        results = self.xla_executable.execute_sharded(input_bufs, with_tokens=True)\n\n        result_token_bufs = results.consume_with_handlers(\n            [lambda xs: xs] * len(self.ordered_effects), strict=False)\n        sharded_runtime_token = results.consume_token()\n        self._handle_token_bufs(result_token_bufs, sharded_runtime_token)\n      else:\n        results = self.xla_executable.execute_sharded(input_bufs)","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/interpreters/pxla.py#L384-L420","documentation":"JAX supports a diagnostic mode (jax_no_execution / config.no_execution) that performs full lowering/setup but skips actually running computations. If a jitted function reaches __call__ with this flag on, it raises instead of executing — used to test compilation-only paths.","triggerScenarios":"Setting JAX_NO_EXECUTION=true (or jax.config.update('no_execution', True)) then calling a jitted/pjitted function. Compilation via .lower().compile() works; only invocation raises.","commonSituations":"CI environments verifying compilability; accidentally exported env var; stale shell config setting the variable globally.","solutions":["Unset the environment variable (export JAX_NO_EXECUTION=false or unset JAX_NO_EXECUTION) or jax.config.update('no_execution', False)","If intentional for compile-only testing, don't call the function — stop at .compile()"],"exampleFix":"# before\n# env: JAX_NO_EXECUTION=true\nout = jitted_fn(x)\n\n# after\n# env: unset JAX_NO_EXECUTION\nout = jitted_fn(x)","handlingStrategy":"validation","validationCode":"import jax\nif jax.config.no_execution.value:\n    raise RuntimeError('unset JAX_NO_EXECUTION before calling functions')","typeGuard":null,"tryCatchPattern":"try:\n    out = jitted_fn(x)\nexcept RuntimeError as e:\n    if 'no_execution' in str(e):\n        jax.config.update('no_execution', False)\n        out = jitted_fn(x)","preventionTips":["Don't export JAX_NO_EXECUTION globally in dev shells","In compile-only CI, stop at .compile() and never call the executable"],"tags":["jax","config","no-execution","environment","diagnostics"],"backgroundTag":"config-flag-prevents-operation","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}