{"record":{"id":"7fa72329624bb34a","repo":"sgl-project/sglang","slug":"unsupported-up-block-type-up-block-type","errorCode":null,"errorMessage":"Unsupported up_block_type: {up_block_type}","messagePattern":"Unsupported up_block_type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/vaes/hunyuanvae.py","lineNumber":771,"sourceCode":"        )\n        self.up_blocks = nn.ModuleList([])\n\n        # mid\n        self.mid_block = HunyuanVideoMidBlock3D(\n            in_channels=block_out_channels[-1],\n            resnet_eps=1e-6,\n            resnet_act_fn=act_fn,\n            attention_head_dim=block_out_channels[-1],\n            resnet_groups=norm_num_groups,\n            add_attention=mid_block_add_attention,\n        )\n\n        # up\n        reversed_block_out_channels = list(reversed(block_out_channels))\n        output_channel = reversed_block_out_channels[0]\n        for i, up_block_type in enumerate(up_block_types):\n            if up_block_type != \"HunyuanVideoUpBlock3D\":\n                raise ValueError(f\"Unsupported up_block_type: {up_block_type}\")\n\n            prev_output_channel = output_channel\n            output_channel = reversed_block_out_channels[i]\n            is_final_block = i == len(block_out_channels) - 1\n            num_spatial_upsample_layers = int(np.log2(spatial_compression_ratio))\n            num_time_upsample_layers = int(np.log2(time_compression_ratio))\n\n            if time_compression_ratio == 4:\n                add_spatial_upsample = bool(i < num_spatial_upsample_layers)\n                add_time_upsample = bool(\n                    i >= len(block_out_channels) - 1 - num_time_upsample_layers\n                    and not is_final_block\n                )\n            else:\n                raise ValueError(\n                    f\"Unsupported time_compression_ratio: {time_compression_ratio}\"\n                )\n","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/vaes/hunyuanvae.py#L753-L789","documentation":"Mirroring the encoder check, the decoder loop in HunyuanVideoVAE.__init__ only accepts the literal up_block_type 'HunyuanVideoUpBlock3D'. Any other string in up_block_types raises this ValueError because no alternative upsampling block is implemented.","triggerScenarios":"Instantiating the VAE with a config whose up_block_types contains anything but \"HunyuanVideoUpBlock3D\" — e.g. diffusers-style names like 'UpBlock3D' or 'CrossAttnUpBlock3D'.","commonSituations":"Loading converted or community VAE checkpoints whose config.json retained block names from another library; typos or partial edits of up_block_types in a hand-written config.","solutions":["Set every entry of up_block_types in the config to \"HunyuanVideoUpBlock3D\"","Use an official checkpoint whose config matches this VAE implementation","Implement the extra block class and extend the branch if a new architecture is truly required"],"exampleFix":"// before\n\"up_block_types\": [\"UpBlock3D\", \"UpBlock3D\"]\n\n// after\n\"up_block_types\": [\"HunyuanVideoUpBlock3D\", \"HunyuanVideoUpBlock3D\"]","handlingStrategy":"validation","validationCode":"assert set(cfg[\"up_block_types\"]) == {\"HunyuanVideoUpBlock3D\"}, f'bad up_block_types: {cfg[\"up_block_types\"]}'","typeGuard":"def is_supported_up_blocks(types: list) -> bool:\n    return all(t == 'HunyuanVideoUpBlock3D' for t in types)","tryCatchPattern":null,"preventionTips":["Use official checkpoints; validate up_block_types matches the single supported name","Avoid hand-editing block type lists in VAE configs"],"tags":["python","value-error","model-config","hunyuan-vae","unsupported-block"],"backgroundTag":"unsupported-config-option","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}