{"record":{"id":"4702ce197731e0f4","repo":"xai-org/x-algorithm","slug":"self-max-concurrent-steps-must-be-at-least-2","errorCode":null,"errorMessage":"{self.max_concurrent_steps=} must be at least 2","messagePattern":"(.+?) must be at least 2","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/pallas/ranker_attention_fa3.py","lineNumber":63,"sourceCode":"    block_q: int\n    block_kv: int\n    max_concurrent_steps: int\n    use_schedule_barrier: bool = True\n    causal: bool = False\n    compute_wgs_bwd: int = 1\n\n    block_q_dkv: int | None = None\n    block_kv_dkv: int | None = None\n    block_q_dq: int | None = None\n    block_kv_dq: int | None = None\n\n    def __post_init__(self):\n        if self.block_q % 64:\n            raise ValueError(f\"{self.block_q=} must be a multiple of 64\")\n        if self.block_kv % 64:\n            raise ValueError(f\"{self.block_kv=} must be a multiple of 64\")\n        if self.max_concurrent_steps < 2:\n            raise ValueError(f\"{self.max_concurrent_steps=} must be at least 2\")\n\n        backward_blocks = [self.block_q_dkv, self.block_kv_dkv, self.block_q_dq, self.block_kv_dq]\n        block_is_set = [blk is not None for blk in backward_blocks]\n        if any(block_is_set) and not all(block_is_set):\n            raise ValueError(\n                \"Backward block sizes (block_q_dkv, block_kv_dkv, block_q_dq, \"\n                \"block_kv_dq) must either all be specified or all be None.\"\n            )\n\n    @property\n    def has_backward_blocks(self) -> bool:\n        return self.block_q_dkv is not None\n\n\ndef _attention_forward(\n    q,\n    k,\n    v,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/pallas/ranker_attention_fa3.py#L45-L81","documentation":"TuningConfig.__post_init__ enforces max_concurrent_steps >= 2 because the warp-specialized kernel runs a producer and at least one consumer warp group in parallel; a single concurrent step cannot overlap loads and compute.","triggerScenarios":"Constructing TuningConfig with max_concurrent_steps=1 (or 0/negative) trying to serialize pipeline stages to save shared memory.","commonSituations":"Memory-constrained tuning where users lower pipeline depth to 1; misreading max_concurrent_steps as a total-steps knob rather than pipeline depth.","solutions":["Set max_concurrent_steps to 2 or higher","If memory is tight, reduce block sizes or num_stages instead"],"exampleFix":"# before\ncfg = TuningConfig(..., max_concurrent_steps=1)\n# after\ncfg = TuningConfig(..., max_concurrent_steps=2)","handlingStrategy":"validation","validationCode":"assert max_concurrent_steps >= 2","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Treat 2 as the minimum pipeline depth in tuning scripts","Reduce block sizes, not pipeline depth, when memory-bound"],"tags":["jax","pallas","tuning-config","pipeline"],"backgroundTag":"invalid-block-size-config","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}