{"record":{"id":"bd7a82b95d6a08c5","repo":"xai-org/x-algorithm","slug":"flashattention2-has-been-removed-please-use-fa-ve","errorCode":null,"errorMessage":"FlashAttention2 has been removed. Please use fa_version='3' instead.","messagePattern":"FlashAttention2 has been removed\\. Please use fa_version='3' instead\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/models/layers.py","lineNumber":399,"sourceCode":"        return query_heads, key_heads\n\n    @hk.transparent\n    def _get_attn_impl(\n        self,\n        extra_attn_kwargs: dict[str, jax.Array | None],\n        *,\n        mask: jax.Array | None,\n        seqpack_layout: SequencePackedLayout | None,\n    ) -> tuple[Type[Attention], dict[str, jax.Array | None]]:\n        match self.config.attn_impl:\n            case \"jax_attn\" | \"jax_attn_interleaved\":\n                extra_attn_kwargs[\"masks\"] = mask\n                attn_class = JaxAttention\n            case \"pallas_attn\":\n                attn_class = PallasAttention\n            case \"flash_attn\":\n                if int(self.config.fa_version) == 2:\n                    raise RuntimeError(\n                        \"FlashAttention2 has been removed. Please use fa_version='3' instead.\"\n                    )\n                attn_class = import_attention_fa3()\n            case \"pallas_ranker_attn\":\n                attn_class = PallasRankerAttention\n            case \"pallas_ranker_attn_infer\":\n                attn_class = PallasRankerAttentionInference\n            case \"pallas_ranker_varlen_attn\":\n                assert seqpack_layout is not None\n                extra_attn_kwargs[\"cu_seqlens\"] = jnp.asarray(\n                    seqpack_layout.cu_seqlens, dtype=jnp.int32\n                )\n                attn_class = PallasRankerVarlenAttention\n            case \"cutedsl_ranker_varlen_attn\":\n                assert seqpack_layout is not None, (\n                    \"cutedsl_ranker_varlen_attn requires seqpack_layout\"\n                )\n                assert seqpack_layout.block_sparse is not None, (","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/models/layers.py#L381-L417","documentation":"_get_attn_impl guards the 'flash_attn' arm: FlashAttention-2 has been removed, so requesting attn_impl='flash_attn' together with fa_version=2 raises RuntimeError and directs you to fa_version=3 (which routes to import_attention_fa3 and therefore requires the fa3 kernels to be present).","triggerScenarios":"config.attn_impl='flash_attn' with config.fa_version=2 (or a config defaulting fa_version to 2); older configs that used FA2 flash attention.","commonSituations":"Legacy configs after the FA2 removal; forgetting to bump fa_version when migrating from FA2 to FA3.","solutions":["Set config.fa_version=3 alongside attn_impl='flash_attn'.","If FA3 kernels are unavailable in your tree, use 'jax_attn' or 'pallas_attn' instead.","Sanitize loaded configs to rewrite fa_version 2 to 3 (or switch impl) at load time."],"exampleFix":"# before\nattn_impl: flash_attn\nfa_version: 2\n\n# after\nattn_impl: flash_attn\nfa_version: 3","handlingStrategy":"validation","validationCode":"if config.attn_impl == \"flash_attn\" and int(config.fa_version) == 2:\n    config.fa_version = 3  # migrate FA2 -> FA3","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Auto-migrate fa_version on config load.","Add config schema constraints tying fa_version to supported values per attn_impl."],"tags":["attention","fa2-removed","fa3","migration","config"],"backgroundTag":"removed-feature-legacy-config","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}