{"record":{"id":"ad63407ef304ebeb","repo":"xai-org/x-algorithm","slug":"self-block-q-must-be-a-multiple-of-64","errorCode":null,"errorMessage":"{self.block_q=} must be a multiple of 64","messagePattern":"(.+?) must be a multiple of 64","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/pallas/ranker_attention_fa3.py","lineNumber":59,"sourceCode":"\n\n@dataclasses.dataclass(frozen=True)\nclass TuningConfig:\n    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","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/pallas/ranker_attention_fa3.py#L41-L77","documentation":"TuningConfig.__post_init__ validates that the forward query tile size block_q is a multiple of 64, a hardware alignment requirement of the warp-specialized TMA kernels in this FA3-style pallas attention.","triggerScenarios":"Constructing TuningConfig with block_q such as 32, 48, or 96 — any value not divisible by 64.","commonSituations":"Copying tuning configs from non-FA2 pallas flash attention (which allows 32/16 tiles), or hand-tuning block sizes for small models without knowing the 64-alignment constraint.","solutions":["Set block_q to a multiple of 64 (128 is the typical default)","If you need smaller tiles, check whether ranker_attention.py (non-FA3) supports them"],"exampleFix":"# before\ncfg = TuningConfig(block_q=96, ...)\n# after\ncfg = TuningConfig(block_q=128, ...)","handlingStrategy":"validation","validationCode":"assert block_q % 64 == 0, \"block_q must be a multiple of 64\"","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Restrict tuning search grids to multiples of 64","Add a config validator that checks all block fields before training starts"],"tags":["jax","pallas","tuning-config","alignment"],"backgroundTag":"invalid-block-size-config","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}