{"record":{"id":"e60468cabe68f6b8","repo":"hiyouga/LlamaFactory","slug":"qwen3-5-packing-seq-forwarding-requires-flash-lin","errorCode":null,"errorMessage":"Qwen3.5 packing-seq forwarding requires `flash-linear-attention>=0.4.1` (provides `fla.modules.convolution.causal_conv1d` and `fla.ops.gated_delta_rule.{chunk,fused_recurrent}_gated_delta_rule`). Please install/upgrade it.","messagePattern":"Qwen3\\.5 packing-seq forwarding requires `flash-linear-attention>=0\\.4\\.1` \\(provides `fla\\.modules\\.convolution\\.causal_conv1d` and `fla\\.ops\\.gated_delta_rule\\.(.+?)_gated_delta_rule`\\)\\. Please install/upgrade it\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/model/patcher.py","lineNumber":80,"sourceCode":"\n\ndef _check_fla_dependencies() -> None:\n    \"\"\"Check that the FLA dependencies required for varlen GDN forwarding are available.\n\n    Requires ``flash-linear-attention >= 0.4.1`` (which exposes the varlen\n    ``causal_conv1d`` under ``fla.modules.convolution`` and the\n    ``chunk_gated_delta_rule`` / ``fused_recurrent_gated_delta_rule`` kernels\n    under ``fla.ops.gated_delta_rule``). Raises ``ImportError`` with an\n    actionable message otherwise.\n    \"\"\"\n    try:\n        from fla.modules.convolution import causal_conv1d  # noqa: F401\n        from fla.ops.gated_delta_rule import (  # noqa: F401\n            chunk_gated_delta_rule,\n            fused_recurrent_gated_delta_rule,\n        )\n    except ImportError as exc:\n        raise ImportError(\n            \"Qwen3.5 packing-seq forwarding requires `flash-linear-attention>=0.4.1` \"\n            \"(provides `fla.modules.convolution.causal_conv1d` and \"\n            \"`fla.ops.gated_delta_rule.{chunk,fused_recurrent}_gated_delta_rule`). \"\n            \"Please install/upgrade it.\"\n        ) from exc\n\n\ndef patch_qwen3_5_forward_npu(model: \"PreTrainedModel\") -> None:\n    \"\"\"Patch for Qwen3.5 models on NPU by importing torch_npu to enable torch.cuda compatibility.\n\n    On NPU, torch.cuda operations will fail unless torch_npu is imported.\n    torch_npu provides compatibility layer that maps torch.cuda calls to NPU operations.\n\n    Also replaces chunk_gated_delta_rule with NPU-compatible implementation.\n    \"\"\"\n    import importlib.metadata\n\n    if \"Ascend910\" not in torch.npu.get_device_name(0):","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/model/patcher.py#L62-L98","documentation":"Error \"Qwen3.5 packing-seq forwarding requires `flash-linear-attention>=0.4.1` (provides `fla.modules.convolution.causal_conv1d` and `fla.ops.gated_delta_rule.{chunk,fused_recurrent}_gated_delta_rule`). Please install/upgrade it.\" thrown in hiyouga/LlamaFactory.","triggerScenarios":"Thrown at src/llamafactory/model/patcher.py:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install or upgrade the flash-linear-attention package: pip install 'flash-linear-attention>=0.4.1'.","If installation fails, disable Qwen3.5 packing-seq forwarding (do not enable packed/packing training for Qwen3.5) so the fla imports are not required."],"exampleFix":"pip install 'flash-linear-attention>=0.4.1'","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}