vllm.models.deepseek_v41.amd.mono.common.plan
¶
Plain-Python planning of the mono kernels: the execution model (one CTA a CU, all resident), mailbox layouts, arithmetic that runs on ints and traced values alike, TP shards, and build keys (every build parameter, and this package's sources, in FlyDSL's JIT cache key).
Classes:
-
Shard– -
ShardError–A width the TP size does not divide, or a TP size the model refuses.
Functions:
-
cdiv–ceil(a / b) for a >= 0, b > 0.
-
first_task–CTA
bid's first task of a stage placed from CTAbase(any count of -
i32–x, asserted inside the device's Int32 range when it is a Python int. -
key_tuple–key's (field name, value) pairs, every value a scalar, then -
pair_layout–items(name, pairs) laid out in order: name -> (byte offset, bytes), -
sel–A if pred else b: a conditional on Python values,
selecton traced -
source_digest–sha256 of every
.pyfile underpaths(files or directories,
Shard
dataclass
¶
Methods:
-
split–full/ tp, refusing a remainder: a rank's share ofwhat.
Source code in vllm/models/deepseek_v41/amd/mono/common/plan.py
split(full, what)
¶
full / tp, refusing a remainder: a rank's share of what.
Source code in vllm/models/deepseek_v41/amd/mono/common/plan.py
ShardError
¶
Bases: ValueError
A width the TP size does not divide, or a TP size the model refuses.
cdiv(a, b)
¶
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/deepseek_v41/amd/mono/common/plan.py
i32(x)
¶
x, asserted inside the device's Int32 range when it is a Python int.
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/deepseek_v41/amd/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/deepseek_v41/amd/mono/common/plan.py
sel(pred, a, b)
¶
A if pred else b: a conditional on Python values, select on traced
ones (rewrapped in the traced operand's type).
Source code in vllm/models/deepseek_v41/amd/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.