{"record":{"id":"4498015edb3d4ca7","repo":"jax-ml/jax","slug":"explicit-opt-level-is-only-supported-for-sparsecor","errorCode":null,"errorMessage":"explicit opt_level is only supported for SparseCore kernels.","messagePattern":"explicit opt_level is only supported for SparseCore kernels\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/tpu_custom_call.py","lineNumber":809,"sourceCode":"          \"collective_id has to be specified when using a custom barrier \"\n          \"(cannot auto-allocate without lowering context)\"\n      )\n  elif collective_id is not None and not allow_collective_id_without_custom_barrier:\n    raise ValueError(\n        \"collective_id has to be unspecified or None when not using a custom\"\n        \" barrier\"\n    )\n  if vmem_limit_bytes is not None and not isinstance(vmem_limit_bytes, int):\n    raise ValueError(\n        \"vmem_limit_bytes must be an int: provided with a\"\n        f\" {type(vmem_limit_bytes)}.\"\n    )\n  if tiling is not None and  device_type != \"sparsecore\":\n    raise ValueError(\n        \"explicit tiling is only supported for SparseCore kernels.\"\n    )\n  if opt_level is not None and device_type != \"sparsecore\":\n    raise ValueError(\n        \"explicit opt_level is only supported for SparseCore kernels.\"\n    )\n  return CustomCallBackendConfig(\n      lowered_module_asm,\n      lowered_module_asm_version,\n      has_communication,\n      collective_id,\n      device_type,\n      cost_estimate,\n      needs_hlo_passes,\n      needs_layout_passes,\n      vmem_limit_bytes,\n      flags,\n      allow_input_fusion,\n      serialization_format,\n      internal_scratch_in_bytes,\n      output_memory_spaces,\n      disable_bounds_checks,","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/tpu_custom_call.py#L791-L827","documentation":"An explicit opt_level was passed for a non-sparsecore kernel; explicit optimization level is only supported for SparseCore.","triggerScenarios":"Passing opt_level in compiler params to a dense TensorCore Pallas kernel.","commonSituations":"Trying to control optimization of dense kernels via opt_level.","solutions":["Remove opt_level for TensorCore kernels","Use the default optimization pipeline for dense kernels"],"exampleFix":"// before\nkernel(..., compiler_params=dict(opt_level=2))\n// after\nkernel(...)","handlingStrategy":"validation","validationCode":"if device_type != 'sparsecore':\n    params.pop('opt_level', None)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only expose opt_level in SparseCore kernel configs"],"tags":["tpu","pallas","opt-level","sparsecore","invalid-argument"],"backgroundTag":"invalid-argument-combination","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}