{"record":{"id":"83c31f7f3f1c2afd","repo":"jax-ml/jax","slug":"unsupported-eviction-policy-eviction-policy","errorCode":null,"errorMessage":"unsupported eviction policy: {eviction_policy}","messagePattern":"unsupported eviction policy: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/triton/lowering.py","lineNumber":2031,"sourceCode":"    other: ir.Value | None = None,\n    *,\n    cache_modifier: str | None = None,\n    eviction_policy: str | None = None,\n    is_volatile: bool = False,\n) -> ir.Value:\n  if cache_modifier is None:\n    cache = tt_dialect.CacheModifier.NONE\n  elif cache_modifier == \".ca\" or cache_modifier == \".cg\":\n    cache = _STR_TO_CACHE_MODIFIER[cache_modifier]\n  else:\n    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):","sourceCodeStart":2013,"sourceCodeEnd":2049,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/triton/lowering.py#L2013-L2049","documentation":"The eviction_policy string passed to a Triton Pallas load must exist in _STR_TO_EVICTION_POLICY (e.g. 'evict_first', 'evict_last'); anything else raises this ValueError via the KeyError conversion.","triggerScenarios":"Passing an unsupported eviction_policy string (e.g. 'evict_normal', typo'd values, or CUDA-only names) to a load inside a Triton Pallas kernel.","commonSituations":"Porting Triton-lang kernel annotations verbatim into Pallas; assuming all Triton eviction policy names are exposed; typos.","solutions":["Use a supported policy name ('evict_first', 'evict_last') or None for NORMAL","Omit eviction_policy to use the default","Verify against the _STR_TO_EVICTION_POLICY mapping in your JAX version"],"exampleFix":"// before\nv = pl.load(ref, eviction_policy='evict_normal')\n\n// after\nv = pl.load(ref, eviction_policy='evict_last')  # or omit","handlingStrategy":"validation","validationCode":"SUPPORTED_EVICTION = {None, 'evict_first', 'evict_last'}\nassert eviction_policy in SUPPORTED_EVICTION, f'bad eviction_policy: {eviction_policy}'","typeGuard":"def valid_eviction_policy(p) -> bool:\n    return p is None or p in ('evict_first', 'evict_last')","tryCatchPattern":"try:\n    v = pl.load(ref, mask=m, eviction_policy=ep)\nexcept ValueError:\n    v = pl.load(ref, mask=m)  # retry with default eviction","preventionTips":["Only use 'evict_first'/'evict_last'/None for eviction policies","Don't copy CUDA-level cache hints verbatim into Pallas loads","Validate policy strings in one shared helper"],"tags":["jax","triton","pallas","load","eviction-policy","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}