{"record":{"id":"378742b13bec2954","repo":"keras-team/keras","slug":"dropout-is-not-supported-when-flash-attention-is-e","errorCode":null,"errorMessage":"Dropout is not supported when flash attention is enabled. Please set dropout to 0.0 to use flash attention.","messagePattern":"Dropout is not supported when flash attention is enabled\\. Please set dropout to 0\\.0 to use flash attention\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/attention/multi_head_attention.py","lineNumber":205,"sourceCode":"                \"`attention_axes` must be an int, list, or tuple.\"\n                f\"Received: attention_axes={attention_axes}\"\n            )\n        self._attention_axes = attention_axes\n        if sliding_window is not None and (\n            not isinstance(sliding_window, int) or sliding_window <= 0\n        ):\n            raise ValueError(\n                \"`sliding_window` must be `None` or a positive integer. \"\n                f\"Received: sliding_window={sliding_window}\"\n            )\n        self._sliding_window = sliding_window\n        self.seed = seed\n\n        self._inverse_sqrt_key_dim = 1.0 / math.sqrt(float(self._key_dim))\n\n        # Check for flash attention constraints\n        if self._flash_attention and self._dropout > 0.0:\n            raise ValueError(\n                \"Dropout is not supported when flash attention is enabled. \"\n                \"Please set dropout to 0.0 to use flash attention.\"\n            )\n\n    @property\n    def num_heads(self):\n        return self._num_heads\n\n    @property\n    def key_dim(self):\n        return self._key_dim\n\n    @property\n    def value_dim(self):\n        return self._value_dim\n\n    @property\n    def dropout(self):","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/attention/multi_head_attention.py#L187-L223","documentation":"Error \"Dropout is not supported when flash attention is enabled. Please set dropout to 0.0 to use flash attention.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/attention/multi_head_attention.py:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}