{"record":{"id":"1e3c4e0d70220346","repo":"jax-ml/jax","slug":"unsupported-pointer-type-ptr-type","errorCode":null,"errorMessage":"unsupported pointer type: {ptr_type}","messagePattern":"unsupported pointer type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/triton/lowering.py","lineNumber":2042,"sourceCode":"    raise ValueError(f\"unsupported cache modifier: {cache_modifier}\")\n  if eviction_policy is None:\n    evict = tt_dialect.EvictionPolicy.NORMAL\n  else:\n    try:\n      evict = _STR_TO_EVICTION_POLICY[eviction_policy]\n    except KeyError:\n      raise ValueError(\n          f\"unsupported eviction policy: {eviction_policy}\"\n      ) from None\n\n  if _is_triton_pointer_type(ptr.type):\n    ptr_type = tt_dialect.PointerType(ptr.type)\n    if isinstance(ptr_type.pointee_type, ir.RankedTensorType):\n      raise NotImplementedError(\"loading from a block pointer is not supported\")\n\n  ptr_type = _element_type(ptr.type)\n  if not _is_triton_pointer_type(ptr_type):\n    raise ValueError(f\"unsupported pointer type: {ptr_type}\")\n  ptr_type = tt_dialect.PointerType(ptr_type)\n  if other is not None and mask is None:\n    raise ValueError(\"other requires mask to be provided\")\n  if not isinstance(ptr.type, ir.RankedTensorType):\n    if other is not None and isinstance(other.type, ir.RankedTensorType):\n      raise ValueError(\"other cannot be a block if pointer is not a block\")\n    if mask is not None and isinstance(mask.type, ir.RankedTensorType):\n      raise ValueError(\"mask cannot be a block if pointer is not a block\")\n\n  pointee_type = ptr_type.pointee_type\n  is_int1 = isinstance(pointee_type, ir.IntegerType) and pointee_type.width == 1\n  if is_int1:\n    pointee_type = ir.IntegerType.get_signless(8)\n    ptr = _ir_cast(\n        ptr,\n        tt_dialect.PointerType.get(pointee_type, ptr_type.address_space),\n        signed=False,\n    )","sourceCodeStart":2024,"sourceCodeEnd":2060,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/triton/lowering.py#L2024-L2060","documentation":"After unwrapping the element type of the loaded pointer, it must be a Triton pointer type. If it is not (e.g. a plain integer/float MLIR type because the value isn't actually a pointer), _load raises this ValueError — usually indicating the kernel passed a non-pointer value where a pointer was expected.","triggerScenarios":"Calling the load primitive with a value that is not pointer-typed in the lowered IR — e.g. loading from a computed integer offset, a reference that got cast to a numeric type, or an API misuse of the internal _load function.","commonSituations":"Internal misuse or bugs in kernel code that reinterprets references; passing indices instead of pointers; version skew between JAX's Pallas layers.","solutions":["Load from actual references (BlockRef/TypedRef) via the public pl.load / ref[...] API rather than raw lowered values","Verify the value being loaded is a pointer (e.g. produced from a memory reference) before calling load internals","Update JAX if hitting this via public APIs — it may be a lowering bug"],"exampleFix":"// before\nv = pl.load(idx)  # idx is an integer offset\n\n// after\nv = ref[idx]  # index into the reference; pl.load takes a reference","handlingStrategy":"validation","validationCode":"# use public APIs: load via references, never raw lowered values\nv = pl.load(ref, mask=m)  # ref must be a BlockRef/TypedRef","typeGuard":null,"tryCatchPattern":"try:\n    v = pl.load(x, mask=m)\nexcept ValueError as e:\n    if 'unsupported pointer type' in str(e):\n        raise TypeError('argument to load is not a memory reference') from e\n    raise","preventionTips":["Only call pl.load on references obtained from kernel arguments","Never pass indices or numeric values where a reference is expected","Update JAX if the error comes from public API usage"],"tags":["jax","triton","pallas","load","pointer","validation"],"backgroundTag":"invalid-argument-type","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}