{"record":{"id":"0da9806921bca928","repo":"sgl-project/sglang","slug":"transformer-cls-name-is-not-officially-supported","errorCode":null,"errorMessage":"{transformer_cls_name} is not officially supported by cache-dit. Supported cache-dit DiT families include Flux, QwenImage, HunyuanDiT, HunyuanVideo, Wan, CogVideoX, Mochi, and others. Please ensure your transformer belongs to one of these families or define a custom BlockAdapter.","messagePattern":"(.+?) is not officially supported by cache-dit\\. Supported cache-dit DiT families include Flux, QwenImage, HunyuanDiT, HunyuanVideo, Wan, CogVideoX, Mochi, and others\\. Please ensure your transformer belongs to one of these families or define a custom BlockAdapter\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py","lineNumber":434,"sourceCode":"        return transformer\n\n    if config.num_inference_steps is None:\n        raise ValueError(\n            \"num_inference_steps is required for transformer-only mode. \"\n            \"Please provide it in CacheDitConfig.\"\n        )\n\n    # Prefer the standard path (transformer pre-registered in cache-dit). For\n    # models absent from the registry, fall back to a manual BlockAdapter (see\n    # _build_custom_block_adapter).\n    custom_adapter = None\n    if not BlockAdapterRegister.is_supported(transformer):\n        custom_adapter = _build_custom_block_adapter(\n            transformer, has_separate_cfg=has_separate_cfg\n        )\n        if custom_adapter is None:\n            transformer_cls_name = transformer.__class__.__name__\n            raise ValueError(\n                f\"{transformer_cls_name} is not officially supported by cache-dit. \"\n                \"Supported cache-dit DiT families include Flux, QwenImage, HunyuanDiT, \"\n                \"HunyuanVideo, Wan, CogVideoX, Mochi, and others. \"\n                \"Please ensure your transformer belongs to one of these families or \"\n                \"define a custom BlockAdapter.\"\n            )\n\n    # Build cache config (including SCM fields if provided)\n    cache_config = DBCacheConfig(\n        num_inference_steps=config.num_inference_steps,\n        Fn_compute_blocks=config.Fn_compute_blocks,\n        Bn_compute_blocks=config.Bn_compute_blocks,\n        max_warmup_steps=config.max_warmup_steps,\n        residual_diff_threshold=config.residual_diff_threshold,\n        max_continuous_cached_steps=config.max_continuous_cached_steps,\n        # SCM fields\n        steps_computation_mask=config.steps_computation_mask,\n        steps_computation_policy=config.steps_computation_policy,","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py#L416-L452","documentation":"Raised by enable_cache_on_transformer when the given DiT transformer class is not recognized by cache-dit's BlockAdapterRegister and no custom BlockAdapter could be auto-built for it. cache-dit accelerates inference by caching intermediate block outputs, which requires knowing the model's block structure via an adapter; unsupported architectures cannot be cached safely. The error lists the officially supported families (Flux, QwenImage, HunyuanDiT, HunyuanVideo, Wan, CogVideoX, Mochi, etc.).","triggerScenarios":"Calling enable_cache_on_transformer(transformer, ...) (usually via the runtime's _maybe_enable_cache_dit when cache-dit is enabled in CacheDitConfig) with a custom or newer transformer class whose family is not in BlockAdapterRegister and for which _build_custom_block_adapter returns None (no detectable blocks attribute / heuristics fail).","commonSituations":"Loading a custom fine-tuned DiT variant, a brand-new model release before adapter support lands, renaming/wrapping the transformer so class-name detection fails, or upgrading cache-dit where supported-family registration changed.","solutions":["Disable cache-dit for this model (set enabled=False in CacheDitConfig) so the transformer runs uncached","Register a custom BlockAdapter for your transformer class via cache-dit's BlockAdapterRegister before calling enable_cache_on_transformer","Ensure the transformer is loaded from a supported family checkpoint (e.g. a Flux/QwenImage/Wan class) and that wrappers do not obscure the underlying class","Upgrade sglang and cache-dit to a version that adds adapter support for your model family"],"exampleFix":"# before\nconfig = CacheDitConfig(enabled=True)\ntransformer, _ = enable_cache_on_transformer(transformer, config)  # ValueError\n\n# after\nconfig = CacheDitConfig(enabled=False)  # run without cache-dit\ntransformer, _ = enable_cache_on_transformer(transformer, config)\n\n# or: define and register a custom adapter\nclass MyDiTAdapter(cache_dit.BlockAdapter):\n    ...\ncache_dit.BlockAdapterRegister.add_adapter(MyTransformer, MyDiTAdapter)","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.cache.cache_dit_integration import BlockAdapterRegister, _build_custom_block_adapter\n\ndef can_cache(transformer) -> bool:\n    return BlockAdapterRegister.is_supported(transformer) or \\\n           _build_custom_block_adapter(transformer, has_separate_cfg=False) is not None\n\nif not can_cache(transformer):\n    config = CacheDitConfig(enabled=False)","typeGuard":null,"tryCatchPattern":"try:\n    transformer, _ = enable_cache_on_transformer(transformer, config)\nexcept ValueError as e:\n    if \"not officially supported by cache-dit\" in str(e):\n        logger.warning(\"cache-dit disabled: %s\", e)\n        config = CacheDitConfig(enabled=False)  # fall back to uncached\n    else:\n        raise","preventionTips":["Check BlockAdapterRegister.is_supported(transformer) before enabling cache-dit","Pin model and sglang versions where the adapter support matrix is verified","Keep a whitelist of cache-dit-enabled models in your serving config"],"tags":["cache-dit","dit","block-adapter","unsupported-model","valueerror"],"backgroundTag":"unsupported-model-architecture","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}