Skip to content

Add max_anchors random chain sampling to P-EAGLE - #2

Closed
orestis-z wants to merge 1 commit into
peagle-streamingfrom
peagle-max-anchors
Closed

Add max_anchors random chain sampling to P-EAGLE#2
orestis-z wants to merge 1 commit into
peagle-streamingfrom
peagle-max-anchors

Conversation

@orestis-z

Copy link
Copy Markdown
Owner

Stacked on vllm-project#683 — merge that first, then retarget this PR to upstream main.

Summary

  • Adds max_anchors parameter to P-EAGLE's COD sampling to randomly subsample chain starting points at depth 1+
  • Depth 0 always retains the full sequence (no contiguity issues)
  • Combined with streaming attention (Add StreamingLLM attention to P-EAGLE vllm-project/speculators#683), this reduces both attention cost and token count for long sequences
  • DFlash fallback default preserved at 3072

Changes

  • data.py: random subsampling of all_valid_indices when max_anchors is set, with .sort()[0] to maintain causal order
  • config.py: new max_anchors: int | None field
  • core.py: wire max_anchors through forward and from_training_args
  • train.py: --max-anchors default changed from 256 to None
  • dflash/core.py: handle None default with or 3072 fallback

Test plan

  • Unit tests for generate_cod_sample_indices with max_anchors (tests/unit/models/test_peagle_data.py)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Link Check Results (REPO)

All links are now valid - this issue has been resolved.


Marked as resolved: 656960f

Randomly subsamples COD chain starting points when max_anchors is set,
reducing depth-1+ token count while keeping depth-0 as the full
sequence. Combined with streaming attention, this gives ~24x attention
reduction for long sequences.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
@orestis-z

Copy link
Copy Markdown
Owner Author

Superseded by vllm-project#687 (standalone max_anchors) and vllm-project#683 (streaming).

@orestis-z orestis-z closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant