vllm.models.kimi_k3.amd.specialized_decode.mono.common.plan
¶
A kernel build's parameters, all of them in FlyDSL's JIT cache key.
FlyDSL keys a compiled kernel by the scalar values (int, float, bool, str, enum,
tuple) its launcher's closures capture; an object in a closure is not keyed, and
a parameter used only by build-time Python (a placement table, a layout) is in no
closure at all. Two builds differing only there would share one binary -- every
TP rank ran rank 3's kernel once that way. So a build's parameters are one frozen
dataclass of scalars, key_tuple turns it into one (name, value) tuple, and the
launcher references that tuple: every field is keyed, whatever the body uses.
The tuple also carries the model's kernel sources (source_digest): FlyDSL
keys a helper's source only when its walk reaches it, and it does not reach a
helper called inside a traced function's dynamic loop or branch (the rewriter
moves those bodies into nested functions it does not scan) nor one outside the
kernel's directory -- an edit there kept the old binary.
Classes:
Functions:
-
first_task–CTA
bid's first task of a stage placed from CTAbase(any count of -
key_tuple–key's (field name, value) pairs, every value a scalar, then -
note_unnamed–A put / poll on a raw address: the check reports it (every mailbox access of
-
pair_layout–items(name, pairs) laid out in order: name -> (byte offset, bytes), -
recording–Record the accesses of kernels traced inside this block.
-
source_digest–sha256 of every
.pyfile underpaths(files or directories, -
symbol_params–The fields that name the kernel symbol (
metadata={"sym": short name}),
KernelAbi
dataclass
¶
Methods:
-
check–The kernel takes exactly
names; the launcher too, thenstream. -
pack–values(every name, nothing else) in ABI order. -
zeros–Every argument 0: what a compile-only call passes.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
check(kernel, launcher)
¶
The kernel takes exactly names; the launcher too, then stream.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
pack(values)
¶
values (every name, nothing else) in ABI order.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
_python_params(fn)
¶
Parameter names of a @flyc.kernel / @flyc.jit object's Python
function (FlyDSL keeps it as _func / func).
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
first_task(bid, base)
¶
CTA bid's first task of a stage placed from CTA base (any count of
CTAs past 0: placements that add task counts run past the grid), then every
BLOCKS-th.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
key_tuple(key, sources)
¶
key's (field name, value) pairs, every value a scalar, then
("sources", sources): the model's source_digest.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
note_unnamed(kind)
¶
A put / poll on a raw address: the check reports it (every mailbox access of a checked kernel names its region).
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
pair_layout(items, align=PAIR_BYTES, start=0)
¶
items (name, pairs) laid out in order: name -> (byte offset, bytes),
each region from an align-byte boundary at or past start.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
recording()
¶
Record the accesses of kernels traced inside this block.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
source_digest(*paths)
cached
¶
sha256 of every .py file under paths (files or directories,
relative to the mono package), each file's path and contents: one model's
kernel sources, so an edit to another model's rebuilds none of these.
Source code in vllm/models/kimi_k3/amd/specialized_decode/mono/common/plan.py
symbol_params(key)
¶
The fields that name the kernel symbol (metadata={"sym": short name}),
short name -> value, in field order.