Skip to content

fix(compiler): default cluster_dims=(1,1,1) for backends that omit it - #1020

Open
tengqm wants to merge 1 commit into
flagos-ai:mainfrom
tengqm:fix/cluster-dims-default
Open

fix(compiler): default cluster_dims=(1,1,1) for backends that omit it#1020
tengqm wants to merge 1 commit into
flagos-ai:mainfrom
tengqm:fix/cluster-dims-default

Conversation

@tengqm

@tengqm tengqm commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

CompiledKernel.__init__ builds the KernelMetadata namedtuple from the metadata dict emitted by the backend. Backends without cluster-launch support (hcu, mthreads) omit cluster_dims, so the field is missing from the namedtuple. torch._inductor reads kernel.metadata.cluster_dims unconditionally when a kernel carries metadata, raising AttributeError during KV-cache warmup — reproduced with vllm 0.24.0 on the Hygon DTK 26.04 runtime (flagtree 0.6.1+hcu3.6).

Default cluster_dims to (1,1,1) before building the namedtuple, the same value vendor triton and the iluvatar overlay already use. Backends that do emit the field are unaffected.

Fixing it at the source also lets the MUSA adapter in vllm-plugin-FL drop its patch_inductor_triton_for_musa monkey-patch (its comment marks it TODO remove once flagtree adds cluster_dims).

Applying the same one-line change in the container lets the vllm 0.24.0 F-path serve proceed past the AttributeError and reach application startup.

This PR was written in part with the assistance of generative AI.

hcu and mthreads backends do not support cluster launch, so their
compiled kernel metadata omits cluster_dims. The KernelMetadata
namedtuple is then built without that key, and torch 2.9.0's
make_launcher reads kernel.metadata.cluster_dims unconditionally,
raising AttributeError during KV-cache profiling warmup.

Default the key to (1,1,1) before building the namedtuple, matching
what the vendor triton 3.5.1 compiler and the iluvatar overlay already
use — instead of patching torch/inductor per backend in each vendor
adapter.
@tengqm
tengqm force-pushed the fix/cluster-dims-default branch from b3b75cf to 0d59efa Compare August 20, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant