Repository navigation
[CPU] Fix truncated KV prefix in intel_amx spec verify - #36430
Conversation
|
/tag-run-ci-label |
4615134 to
579965f
Compare
|
/rerun-failed-ci |
|
check ci again. |
|
…PU parity sgl-project#36430 removed the two `seq_lens = forward_batch.seq_lens` re-reads that sgl-project#24013 had introduced, but it shipped no test, and the EAGLE3 CPU parity test the bug had forced off is still skipped. Pin the resolved lengths that reach both kernels: `forward_batch.seq_lens + draft_token_num` in TARGET_VERIFY, the expanded `batch_size * topk` tensor in multi-step draft decode, and the plain batch lengths on the two non-speculative paths. Drop the `disabled` marker from test_spec_eagle_parity_cpu now that the cause is fixed.
|
Follow-up in #35881 for two potential gaps left behind: a regression test The test is verified in both directions on a Xeon: @mingfeima @htzo would either of you be willing to add the |
Motivation
Speculative decoding on CPU with the
intel_amxattention backend produces output the target model would never have generated, causing the accuracy to be significantly worsened.Fixes regression caused by #24013
Modifications
forward_extendandforward_decodeboth resolvedseq_lensfrom the per-forwardmetadata, then overwrote it:
In
TARGET_VERIFYmode_build_extend_metadatasetsseq_lens = forward_batch.seq_lens + num_draft_tokens, becauseextend_attention_cpuderives the committed prefix by subtraction (
seq_len_prefix = seq_lens - extend_seq_lens).Overwritten, the kernel saw a prefix short by
num_draft_tokens: the target scored everydraft token against a hole in its own context, and greedy verify accepted tokens its own
argmax would not have produced.
forward_decodelikewise discarded the expandedper-candidate lengths used when
speculative_num_steps > 1.This deletes the two re-reads and keeps the int64 cast. Non-speculative extend is unaffected: there
forward_batch.seq_lensalready equals prefix + extend.Accuracy Tests
GSM8K with greedy sampling:
Speed Tests and Profiling
Not measured - it's a correctness change
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #32925792115
Latest PR Test (Extra): ✅ Run #32937057026
Latest PR Test (AMD ROCm 7.2): ❌ Run #32925792202