{"record":{"id":"be14f4d5b1157825","repo":"xai-org/x-algorithm","slug":"invalid-attention-implementation-self-config-att","errorCode":null,"errorMessage":"Invalid attention implementation: {self.config.attn_impl}","messagePattern":"Invalid attention implementation: (.+?)","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/models/layers.py","lineNumber":438,"sourceCode":"                    \"LengthDistribution so block_sparse is constructed.\"\n                )\n                attn_class = CutedslRankerVarlenAttention\n\n                def _add_h_axis(arr):\n                    arr = jnp.asarray(arr, dtype=jnp.int32)\n                    return jnp.broadcast_to(\n                        jnp.expand_dims(arr, axis=1),\n                        (arr.shape[0], self.config.num_q_heads) + arr.shape[1:],\n                    )\n\n                bs = seqpack_layout.block_sparse\n                extra_attn_kwargs.update(\n                    {f\"bsp_{f.name}\": _add_h_axis(getattr(bs, f.name)) for f in dc_fields(bs)}\n                )\n            case \"cutedsl_ranker_attn\":\n                attn_class = CutedslRankerAttention\n            case _:\n                raise NotImplementedError(\n                    f\"Invalid attention implementation: {self.config.attn_impl}\"\n                )\n\n        return attn_class, extra_attn_kwargs\n\n    @hk.transparent\n    def _out_projection(\n        self,\n        x: jax.Array,\n        output_size: int,\n        pspec: Optional[P] = None,\n        lr_multiplier: float = 1.0,\n        init_scale: float = 1.0,\n        name: Optional[str] = None,\n        rms_clip_axes=(-2, -1),\n        with_bias: bool = False,\n        w_init=None,\n    ) -> jax.Array:","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/models/layers.py#L420-L456","documentation":"_get_attn_impl maps config.attn_impl strings to attention classes via a match statement ('jax_attn', 'pallas_attn', 'flash_attn', 'pallas_ranker_attn', 'cutedsl_ranker_attn', ...). Any string not covered falls into `case _` and raises NotImplementedError with the invalid attn_impl value.","triggerScenarios":"Typos in attn_impl (e.g. 'pallas_rank_attn', 'jax-attention'); requesting an impl that exists in another fork but not here; whitespace/case differences in the config string.","commonSituations":"See trigger scenarios.","solutions":["Check the match arms in layers.py _get_attn_impl for the exact supported strings and use one.","Fix typos, casing, and stray whitespace in the config value.","If you added a new attention class, register it with its own match arm."],"exampleFix":"# before\nconfig.attn_impl = \"pallas_rank_attn\"\n\n# after\nconfig.attn_impl = \"pallas_ranker_attn\"","handlingStrategy":"validation","validationCode":"SUPPORTED_ATTN_IMPLS = {\"jax_attn\", \"pallas_attn\", \"flash_attn\", \"pallas_ranker_attn\", \"pallas_ranker_attn_infer\", \"cutedsl_ranker_attn\"}\nassert config.attn_impl in SUPPORTED_ATTN_IMPLS, config.attn_impl","typeGuard":"def is_valid_attn_impl(name: str) -> bool:\n    return name in SUPPORTED_ATTN_IMPLS","tryCatchPattern":null,"preventionTips":["Fail fast on config load with the list of valid values.","Strip/normalize whitespace and case in config strings before use."],"tags":["attention","enum-validation","config","typo"],"backgroundTag":"invalid-config-value","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}