jax-ml/jax · error · ValueError

unsupported pointer type: {ptr_type}

Error message

unsupported pointer type: {ptr_type}

What it means

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.

Source

Thrown at jax/_src/pallas/triton/lowering.py:2042

    raise ValueError(f"unsupported cache modifier: {cache_modifier}")
  if eviction_policy is None:
    evict = tt_dialect.EvictionPolicy.NORMAL
  else:
    try:
      evict = _STR_TO_EVICTION_POLICY[eviction_policy]
    except KeyError:
      raise ValueError(
          f"unsupported eviction policy: {eviction_policy}"
      ) from None

  if _is_triton_pointer_type(ptr.type):
    ptr_type = tt_dialect.PointerType(ptr.type)
    if isinstance(ptr_type.pointee_type, ir.RankedTensorType):
      raise NotImplementedError("loading from a block pointer is not supported")

  ptr_type = _element_type(ptr.type)
  if not _is_triton_pointer_type(ptr_type):
    raise ValueError(f"unsupported pointer type: {ptr_type}")
  ptr_type = tt_dialect.PointerType(ptr_type)
  if other is not None and mask is None:
    raise ValueError("other requires mask to be provided")
  if not isinstance(ptr.type, ir.RankedTensorType):
    if other is not None and isinstance(other.type, ir.RankedTensorType):
      raise ValueError("other cannot be a block if pointer is not a block")
    if mask is not None and isinstance(mask.type, ir.RankedTensorType):
      raise ValueError("mask cannot be a block if pointer is not a block")

  pointee_type = ptr_type.pointee_type
  is_int1 = isinstance(pointee_type, ir.IntegerType) and pointee_type.width == 1
  if is_int1:
    pointee_type = ir.IntegerType.get_signless(8)
    ptr = _ir_cast(
        ptr,
        tt_dialect.PointerType.get(pointee_type, ptr_type.address_space),
        signed=False,
    )

View on GitHub (pinned to 1e1c6a8fc0)

Solutions

  1. Load from actual references (BlockRef/TypedRef) via the public pl.load / ref[...] API rather than raw lowered values
  2. Verify the value being loaded is a pointer (e.g. produced from a memory reference) before calling load internals
  3. Update JAX if hitting this via public APIs — it may be a lowering bug

Example fix

// before
v = pl.load(idx)  # idx is an integer offset

// after
v = ref[idx]  # index into the reference; pl.load takes a reference
Defensive patterns

Strategy: validation

Validate before calling

# use public APIs: load via references, never raw lowered values
v = pl.load(ref, mask=m)  # ref must be a BlockRef/TypedRef

Try / catch

try:
    v = pl.load(x, mask=m)
except ValueError as e:
    if 'unsupported pointer type' in str(e):
        raise TypeError('argument to load is not a memory reference') from e
    raise

Prevention

When it happens

Trigger: 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.

Common situations: Internal misuse or bugs in kernel code that reinterprets references; passing indices instead of pointers; version skew between JAX's Pallas layers.

Understand the failure class

Background: Invalid argument type errors: "must be of type string", "expected X, got Y", and ERR_INVALID_ARG_TYPE explained — this error's family across 15 libraries.

Related errors


AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27). Data as JSON: /api/errors/1e3c4e0d70220346. Report an issue: GitHub.