|
49 | 49 | # KV_BLOCK_SIZE unset (unset -> vLLM sizes the page; 128 under fp8) |
50 | 50 | # MAX_MODEL_LEN unset (unset -> vLLM derives K3's 1M context) |
51 | 51 | # SPEC_DECODE false (enabled by the _mtp DSpark wrapper) |
52 | | -# ENFORCE_EAGER false (enabled by the _mtp DSpark wrapper) |
| 52 | +# ENFORCE_EAGER false (reference; DSpark wrapper keeps it false) |
53 | 53 |
|
54 | 54 | source "$(dirname "$0")/../../benchmark_lib.sh" |
55 | 55 |
|
|
600 | 600 | # and hash sizes only align with prefix caching on -- an omission has been |
601 | 601 | # reported to trip "tokens_per_block not divisible by tokens_per_hash" at load. |
602 | 602 | # Set PREFIX_CACHING=true/false to force it either way. |
603 | | -# ON by default for EVERY arm. This trace is built around large shared |
| 603 | +# ON by default for non-DSpark arms. This trace is built around large shared |
604 | 604 | # prefixes -- theoretical prefix-cache hit is 98.1%, and a live kvnone cell |
605 | 605 | # measured 92.8% server-side -- so a run with reuse disabled is not measuring |
606 | 606 | # the workload. Reuse also costs essentially no KV (1,414,660 vs 1,420,824 |
|
620 | 620 | # |
621 | 621 | # Note vLLM resolves the flag's default to False for this model, so ON must be |
622 | 622 | # passed explicitly. PREFIX_CACHING=false forces it off for a deliberate A/B. |
623 | | -PREFIX_CACHE_ARGS=(--enable-prefix-caching) |
624 | | -if [ "${PREFIX_CACHING:-}" = "false" ]; then |
625 | | - PREFIX_CACHE_ARGS=(--no-enable-prefix-caching) |
626 | | -fi |
| 623 | +case "${PREFIX_CACHING:-true}" in |
| 624 | + true) |
| 625 | + PREFIX_CACHE_ARGS=(--enable-prefix-caching) |
| 626 | + ;; |
| 627 | + false) |
| 628 | + PREFIX_CACHE_ARGS=(--no-enable-prefix-caching) |
| 629 | + ;; |
| 630 | + auto) |
| 631 | + # Match the upstream AMD command by letting vLLM resolve its default. |
| 632 | + PREFIX_CACHE_ARGS=() |
| 633 | + ;; |
| 634 | + *) |
| 635 | + echo "Error: PREFIX_CACHING must be true, false, or auto." >&2 |
| 636 | + exit 1 |
| 637 | + ;; |
| 638 | +esac |
627 | 639 |
|
628 | 640 | # The upstream DSpark config pins "attention_backend": "FLASHINFER_MLA", which |
629 | 641 | # is CUDA-only and cannot be used verbatim on gfx950; SPEC_ATTN_BACKEND |
630 | | -# overrides it. AgentX throughput uses synthetic acceptance pinned to the |
631 | | -# committed golden curve. Eval-only runs use real block verification because |
632 | | -# synthetic acceptance bypasses correctness verification. |
| 642 | +# overrides it. Use real block rejection for both throughput and evaluation so |
| 643 | +# this path is the exact AMD reproducer and exercises target-model verification. |
633 | 644 | SPEC_ARGS=() |
634 | 645 | if [ "${SPEC_DECODE:-false}" = "true" ]; then |
635 | 646 | SPEC_DRAFT_MODEL="${SPEC_DRAFT_MODEL:-Inferact/Kimi-K3-DSpark}" |
636 | 647 | SPEC_NUM_TOKENS="${SPEC_NUM_TOKENS:-7}" |
637 | 648 | SPEC_ATTN_BACKEND="${SPEC_ATTN_BACKEND:-TRITON_MLA}" |
638 | | - SPEC_GOLDEN_AL="${SPEC_GOLDEN_AL:-3.84}" |
639 | | - SPEC_GOLDEN_AL_FILE="${SPEC_GOLDEN_AL_FILE:-golden_al_distribution/kimik3_dspark_probabilistic_sample_method_block_rejection_sample_method.yaml}" |
640 | | - FILE_GOLDEN_AL=$(awk -v k="$SPEC_NUM_TOKENS" ' |
641 | | - /^kimi-k3:/ { in_model = 1; next } |
642 | | - /^[^[:space:]#]/ { in_model = 0 } |
643 | | - in_model && /thinking_on:/ { in_thinking = 1; next } |
644 | | - in_thinking && $1 == k":" { print $2; exit } |
645 | | - ' "$SPEC_GOLDEN_AL_FILE" 2>/dev/null) |
646 | | - if [ "$FILE_GOLDEN_AL" != "$SPEC_GOLDEN_AL" ]; then |
647 | | - echo "Error: DSpark golden AL mismatch: $SPEC_GOLDEN_AL_FILE gives" >&2 |
648 | | - echo " '${FILE_GOLDEN_AL:-<unreadable>}' for k=$SPEC_NUM_TOKENS," >&2 |
649 | | - echo " but the recipe pins $SPEC_GOLDEN_AL." >&2 |
650 | | - exit 1 |
651 | | - fi |
652 | | - if [ "${EVAL_ONLY:-false}" = "true" ]; then |
653 | | - SPEC_REJECTION_CONFIG="\"rejection_sample_method\":\"block\"" |
654 | | - else |
655 | | - SPEC_REJECTION_CONFIG="\"rejection_sample_method\":\"synthetic\",\"synthetic_acceptance_length\":$SPEC_GOLDEN_AL" |
656 | | - fi |
657 | 649 | SPEC_ARGS=( |
658 | 650 | --speculative-config |
659 | | - "{\"model\":\"$SPEC_DRAFT_MODEL\",\"num_speculative_tokens\":$SPEC_NUM_TOKENS,\"method\":\"dspark\",\"attention_backend\":\"$SPEC_ATTN_BACKEND\",\"draft_sample_method\":\"probabilistic\",$SPEC_REJECTION_CONFIG}" |
| 651 | + "{\"model\":\"$SPEC_DRAFT_MODEL\",\"num_speculative_tokens\":$SPEC_NUM_TOKENS,\"method\":\"dspark\",\"attention_backend\":\"$SPEC_ATTN_BACKEND\",\"draft_sample_method\":\"probabilistic\",\"rejection_sample_method\":\"block\"}" |
660 | 652 | ) |
661 | 653 | fi |
662 | 654 |
|
|
0 commit comments