Add max_anchors random chain sampling to P-EAGLE - #682
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds streaming attention support to P-EAGLE's FlexAttention mask, enabling O(seq_len × W) depth-0 attention cost instead of O(seq_len²). Two new config fields (sink_size, max_context_window) control the attention pattern per document in packed sequences. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
Adds a `max_anchors` parameter that randomly subsamples COD chain starting points at depth 1+ while keeping depth-0 as the full sequence. Combined with StreamingLLM attention (sliding window + sink), this enables long-context P-EAGLE training without the context blindness that affected the contiguous-window approach. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Orestis Zambounis <orestis.zambounis@gmail.com>
551d857 to
cc7940d
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
|
Moved to orestis-z#2 — stacked on #683, will retarget to upstream after streaming PR merges. |
Summary
max_anchorsparameter to P-EAGLE's COD sampling to randomly subsample chain starting points at depth 1+Changes
data.py: random subsampling ofall_valid_indiceswhenmax_anchorsis set, with.sort()[0]to maintain causal orderconfig.py: newmax_anchors: int | Nonefieldcore.py: wiremax_anchorsthrough forward andfrom_training_argstrain.py:--max-anchorsdefault changed from 256 to Nonedflash/core.py: handle None default withor 3072fallbackTest plan
generate_cod_sample_indiceswith max_anchors (tests/unit/models/test_peagle_data.py)🤖 Generated with Claude Code