{"record":{"id":"43925cc293662cb0","repo":"sgl-project/sglang","slug":"invalid-causality-axis-causality-axis","errorCode":null,"errorMessage":"Invalid causality_axis: {causality_axis}","messagePattern":"Invalid causality_axis: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/vaes/ltx_2_audio.py","lineNumber":52,"sourceCode":"        super().__init__()\n\n        self.causality_axis = causality_axis\n        kernel_size = (\n            (kernel_size, kernel_size) if isinstance(kernel_size, int) else kernel_size\n        )\n        dilation = (dilation, dilation) if isinstance(dilation, int) else dilation\n\n        pad_h = (kernel_size[0] - 1) * dilation[0]\n        pad_w = (kernel_size[1] - 1) * dilation[1]\n\n        if self.causality_axis == \"none\":\n            padding = (pad_w // 2, pad_w - pad_w // 2, pad_h // 2, pad_h - pad_h // 2)\n        elif self.causality_axis in {\"width\", \"width-compatibility\"}:\n            padding = (pad_w, 0, pad_h // 2, pad_h - pad_h // 2)\n        elif self.causality_axis == \"height\":\n            padding = (pad_w // 2, pad_w - pad_w // 2, pad_h, 0)\n        else:\n            raise ValueError(f\"Invalid causality_axis: {causality_axis}\")\n\n        self.padding = padding\n        self.conv = nn.Conv2d(\n            in_channels,\n            out_channels,\n            kernel_size,\n            stride=stride,\n            padding=0,\n            dilation=dilation,\n            groups=groups,\n            bias=bias,\n        )\n\n    def forward(self, x: torch.Tensor) -> torch.Tensor:\n        x = F.pad(x, self.padding)\n        return self.conv(x)\n\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/vaes/ltx_2_audio.py#L34-L70","documentation":"LTX2AudioCausalConv2d computes asymmetric padding based on causality_axis and only accepts 'none', 'width', 'width-compatibility', and 'height'. Any other value raises this ValueError during module construction, since no padding scheme is defined for it.","triggerScenarios":"Instantiating LTX2AudioCausalConv2d (or building the LTX-2 audio VAE whose config feeds causality_axis) with a string outside the accepted set — e.g. 'h', 'w', 'time', 'batch', or a typo like 'Height'.","commonSituations":"Loading an audio-VAE checkpoint with a config using shorthand or renamed axis names; writing a custom causal conv stack and guessing the axis values; version skew where a newer release added an axis (e.g. 'width-compatibility') not present in the installed one.","solutions":["Set causality_axis to one of 'none', 'width', 'width-compatibility', or 'height'","Use the exact value from the official LTX-2 audio checkpoint config","Upgrade sglang if the checkpoint requires an axis value added in a newer version"],"exampleFix":"// before\nconv = LTX2AudioCausalConv2d(64, 128, 3, causality_axis='w')\n\n// after\nconv = LTX2AudioCausalConv2d(64, 128, 3, causality_axis='width')","handlingStrategy":"validation","validationCode":"VALID_AXES = {'none', 'width', 'width-compatibility', 'height'}\nassert causality_axis in VALID_AXES, f'causality_axis must be one of {VALID_AXES}'","typeGuard":"def is_valid_causality_axis(axis: str) -> bool:\n    return axis in {'none', 'width', 'width-compatibility', 'height'}","tryCatchPattern":null,"preventionTips":["Use full axis names ('height', 'width'), not shorthand ('h', 'w')","Take the value from the official LTX-2 audio checkpoint config","Upgrade sglang if a checkpoint needs 'width-compatibility' absent in older versions"],"tags":["python","value-error","invalid-argument","ltx-2-audio","causal-conv"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}