{"record":{"id":"9cecab9c2bd064b5","repo":"sgl-project/sglang","slug":"unsupported-mc-algo-mc-algo-available-list-su","errorCode":null,"errorMessage":"Unsupported mc_algo {mc_algo}, available: {list(SurfaceExtractors.keys())}","messagePattern":"Unsupported mc_algo (.+?), available: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/vaes/hunyuan3d_vae.py","lineNumber":1137,"sourceCode":"        grid_logits = self.volume_decoder(latents, self.geo_decoder, **kwargs)\n        outputs = self.surface_extractor(grid_logits, **kwargs)\n        return outputs\n\n    def enable_flashvdm_decoder(\n        self,\n        enabled: bool = True,\n        adaptive_kv_selection=True,\n        topk_mode=\"mean\",\n        mc_algo=\"dmc\",\n    ):\n        \"\"\"Enable or disable FlashVDM decoder for faster inference.\"\"\"\n        if enabled:\n            if adaptive_kv_selection:\n                self.volume_decoder = FlashVDMVolumeDecoding(topk_mode)\n            else:\n                self.volume_decoder = HierarchicalVolumeDecoding()\n            if mc_algo not in SurfaceExtractors:\n                raise ValueError(\n                    f\"Unsupported mc_algo {mc_algo}, available: {list(SurfaceExtractors.keys())}\"\n                )\n            self.surface_extractor = SurfaceExtractors[mc_algo]()\n        else:\n            self.volume_decoder = VanillaVolumeDecoder()\n            self.surface_extractor = MCSurfaceExtractor()\n\n\nclass ShapeVAE(VectsetVAE):\n    \"\"\"Shape VAE for 3D mesh generation from latent codes.\"\"\"\n\n    _aliases = [\"hy3dgen.shapegen.models.ShapeVAE\"]\n\n    def __init__(\n        self,\n        *,\n        num_latents: int,\n        embed_dim: int,","sourceCodeStart":1119,"sourceCodeEnd":1155,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/vaes/hunyuan3d_vae.py#L1119-L1155","documentation":"enable_flashvdm_decoder validates the mc_algo argument against the SurfaceExtractors registry dict before constructing the surface extractor. Any mc_algo string not present as a key (typically 'mc' and 'dmc') raises this ValueError listing the valid options.","triggerScenarios":"Calling enable_flashvdm_decoder(enabled=True, mc_algo=...) with a typo'd or unsupported algorithm name, e.g. 'marching_cubes', 'DMC', or 'cuda_dmc'. The check only runs when enabled=True and adaptive_kv_selection path is configured.","commonSituations":"Copying an mc_algo value from a different codebase or model card; case mismatch ('DMC' vs 'dmc'); custom forks that register an extractor under a new name but forget to add it to SurfaceExtractors.","solutions":["Use one of the keys printed in the error message — normally 'mc' (scikit-image marching cubes) or 'dmc' (diso DiffDMC)","Check the SurfaceExtractors dict in hunyuan3d_vae.py for the exact registered keys in your version","If adding a custom extractor, register it: SurfaceExtractors['my_algo'] = MyExtractor before calling enable_flashvdm_decoder"],"exampleFix":"// before\nmodel.enable_flashvdm_decoder(enabled=True, mc_algo='marching_cubes')\n\n// after\nmodel.enable_flashvdm_decoder(enabled=True, mc_algo='mc')","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.models.vaes.hunyuan3d_vae import SurfaceExtractors\nmc_algo = 'mc'  # or 'dmc'\nassert mc_algo in SurfaceExtractors, f'mc_algo must be one of {list(SurfaceExtractors)}'\nmodel.enable_flashvdm_decoder(enabled=True, mc_algo=mc_algo)","typeGuard":"def is_valid_mc_algo(name: str) -> bool:\n    from sglang.multimodal_gen.runtime.models.vaes.hunyuan3d_vae import SurfaceExtractors\n    return isinstance(name, str) and name in SurfaceExtractors","tryCatchPattern":"try:\n    model.enable_flashvdm_decoder(enabled=True, mc_algo=mc_algo)\nexcept ValueError as e:\n    raise ValueError(f'bad mc_algo {mc_algo!r}; choose from mc/dmc') from e","preventionTips":["Derive mc_algo from the SurfaceExtractors registry keys, not from docs memory","Watch for case: keys are lowercase ('dmc', not 'DMC')","Register custom extractors in SurfaceExtractors before use"],"tags":["python","value-error","invalid-argument","mc-algo","hunyuan3d","flashvdm"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}