{"record":{"id":"f5379eb26701d973","repo":"jax-ml/jax","slug":"unknown-attribute-attr-name","errorCode":null,"errorMessage":"Unknown attribute: {attr_name}","messagePattern":"Unknown attribute: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/experimental/mosaic/gpu/inference_utils.py","lineNumber":178,"sourceCode":"  return attr[index]\n\n\ndef _in_attr_for_operand(\n    op: MlirOperation,\n    operand: ir.Value,\n    attr_name: str,\n) -> ir.Attribute | None:\n  if attr_name == \"in_layouts\":\n    predicate = lambda v: isinstance(v.type, ir.VectorType)\n  elif attr_name == \"in_transforms\":\n    predicate = is_transformable_smem_memref\n  elif attr_name == \"in_tmem_layouts\":\n    predicate = (\n        lambda v: isinstance(v.type, ir.MemRefType)\n        and ir.MemRefType(v.type).memory_space == utils.tmem()\n    )\n  else:\n    raise ValueError(f\"Unknown attribute: {attr_name}\")\n\n  operand_number = [o for o in op.operands if predicate(o)].index(operand)\n\n  return attr_element(attr_name, op, operand_number)\n\n\nin_layout_for_operand = partial(\n    _in_attr_for_operand, attr_name=\"in_layouts\"\n)\nin_tmem_layout_for_operand = partial(\n    _in_attr_for_operand, attr_name=\"in_tmem_layouts\"\n)\nin_transforms_for_operand = partial(\n    _in_attr_for_operand, attr_name=\"in_transforms\"\n)\n\n\ndef should_have_in_transforms(op: ir.OpView) -> bool:","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/experimental/mosaic/gpu/inference_utils.py#L160-L196","documentation":"_in_attr_for_operand dispatches on the attribute name to find which operand index corresponds to a layout/transform attribute. It only knows in_layouts, out_layouts, in_transforms, out_transforms, and in_tmem_layouts; any other attr_name raises ValueError('Unknown attribute'). It indicates a programming error in the caller (misspelled or unsupported attribute name).","triggerScenarios":"Calling _in_attr_for_operand (or a public wrapper passing through an attr_name) with a name not in the supported set, e.g. 'out_tmem_layouts' before it was added, or a typo like 'in_layout'.","commonSituations":"Version drift where newer code references an attribute the installed inference_utils doesn't handle yet; copy-pasted code with a misspelled attribute name; extending the utilities with a new layout kind without updating the dispatch.","solutions":["Check the dispatch branches in inference_utils.py and only pass supported attribute names (in_layouts, out_layouts, in_transforms, out_transforms, in_tmem_layouts)","Fix typos in the attribute name string at the call site","Upgrade JAX/Mosaic if you need an attribute (e.g. out_tmem_layouts) supported in a newer release"],"exampleFix":"# before\nattr = inference_utils._in_attr_for_operand('in_layout', op, operand)\n\n# after\nattr = inference_utils._in_attr_for_operand('in_layouts', op, operand)","handlingStrategy":"validation","validationCode":"SUPPORTED = {'in_layouts', 'out_layouts', 'in_transforms', 'out_transforms', 'in_tmem_layouts'}\nassert attr_name in SUPPORTED, f'unsupported attr_name: {attr_name}'\nresult = inference_utils._in_attr_for_operand(attr_name, op, operand)","typeGuard":"def is_supported_attr(name: str) -> bool:\n  return name in {'in_layouts', 'out_layouts', 'in_transforms', 'out_transforms', 'in_tmem_layouts'}","tryCatchPattern":"try:\n  ...call _in_attr_for_operand...\nexcept ValueError as e:\n  if 'Unknown attribute' in str(e):\n    raise RuntimeError(f'Unsupported attribute name; check spelling/version: {e}') from e\n  raise","preventionTips":["Use only documented attribute names from inference_utils","Check the dispatch branches in your installed inference_utils.py for the supported set","Pin JAX/Mosaic versions consistently across environments"],"tags":["mosaic-gpu","invalid-argument","attribute-dispatch","internal-api"],"backgroundTag":"invalid-argument-value","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}