vllm.models.muse_spark.amd.mono.drafter
¶
Muse Spark's DSpark draft layers as one FlyDSL launch a step (--monokernel).
A draft step of 1 or 2 requests (7 query rows each) runs the 5 layers and the final
norm of MuseSparkDSparkModel as one launch of kernels/draft.py (builds
S = 8 / 16); any other step runs the stock layers. The contract is the target
monokernel's (README.md): the weights are read in place (fp32 copies of the norm
multipliers only), one IPC peer buffer a rank and build allocated at load time, fixed
launch arguments (FULL CUDA graphs capture the launch), the draft KV cache group's
block_table / seq_lens / slot_mapping and the layers' bf16 LBHNC caches
through one descriptor table a step shape (keyed by its contents), and health words
that the target's compute_logits checks. Every rank takes the same path: the
decision reads only the static deployment and the step's shape and attention metadata
counts.
Classes:
-
DSparkDrafter–Runs the draft layers of eligible DSpark draft steps as kernels/draft.py.
Functions:
-
maybe_attach_drafter–Attach the draft kernels to
lm(MuseSparkDSparkForCausalLM) after loading.
DSparkDrafter
¶
Runs the draft layers of eligible DSpark draft steps as kernels/draft.py.
Methods:
-
poll_health–Raise if a draft launch timed out waiting for a peer rank (an asynchronous
-
try_forward–The draft step's final hidden states (bf16 [rows, hidden]); None = stock.
Source code in vllm/models/muse_spark/amd/mono/drafter.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | |
_slot_table(ptrs)
¶
The layers' slot_mapping pointers as a device table (int64 [layers]), keyed by its contents and written once (as _FusedAttention.table).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
_step_refusal(positions, inputs_embeds)
¶
Why this draft step runs stock (rank-invariant data only); None = mono.
Source code in vllm/models/muse_spark/amd/mono/drafter.py
_weight_table(model, device)
¶
The launch table rows of kernels/draft.py (weights as views of the parameters; the norm multipliers as fp32 copies, kept alive here).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
poll_health()
¶
Raise if a draft launch timed out waiting for a peer rank (an asynchronous copy every HEALTH_POLL_INTERVAL calls, checked one interval later).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
try_forward(model, input_ids, positions, inputs_embeds=None)
¶
The draft step's final hidden states (bf16 [rows, hidden]); None = stock.
Source code in vllm/models/muse_spark/amd/mono/drafter.py
_DraftBuild
¶
The launcher and persistent buffers of one draft build (S rows).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
draft_dims(config, world_size)
¶
Per-rank sizes of the draft layers (the MoE fields unused).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
draft_layer_refusals(model, dims)
¶
Module and tensor guards of the draft layers (MuseSparkDSparkModel).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
effective_norm_weight_fp32(norm)
¶
The fp32 multiplier of a norm: weight (+ gain_center), as the stock norms.
Source code in vllm/models/muse_spark/amd/mono/drafter.py
maybe_attach_drafter(lm)
¶
Attach the draft kernels to lm (MuseSparkDSparkForCausalLM) after loading.
Collective over the TP group: every rank calls it. A deployment that any rank cannot run keeps the stock draft layers on every rank (logged).
Source code in vllm/models/muse_spark/amd/mono/drafter.py
static_refusals(lm, tp_size)
¶
Every reason this deployment cannot run the draft kernels; empty = supported.