Add forward/backward integration tests#550
Conversation
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. 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:
WalkthroughThis PR adds comprehensive CUDA-gated integration tests for three draft model architectures (Eagle3, DFlash, PEagle). It establishes shared test infrastructure—tiny model configs, factories, and synthetic data generators—then provides training-mode validation, multi-batch statefulness tests, and vocab boundary coverage for each model independently. ChangesDraft Model Integration Tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/integration/models/test_dflash_forward.py`:
- Around line 159-165: The test_boundary_tokens in
tests/integration/models/test_dflash_forward.py currently never asserts that
draft_tokens respect the restricted vocab range; update the test to verify that
the generated draft_tokens from dflash_draft_vocab_model are all within the
provided boundary_token_ids range (0..31) after calling
dflash_draft_vocab_model(**batch). Locate the test_boundary_tokens function and
add an assertion that every value in draft_tokens (or
draft_tokens.detach().cpu().numpy() if tensors) is >= 0 and <= 31 (or uses the
boundary_token_ids variable) so regressions in the vocab mapping will fail the
test.
In `@tests/integration/models/test_peagle_forward.py`:
- Around line 158-164: The test_boundary_tokens should also assert that produced
draft_tokens respect the restricted vocab bounds; update the test (function
test_boundary_tokens) to check draft_tokens values are within the inclusive
range given by boundary_token_ids (e.g., min >= 0 and max <= 31) after calling
peagle_draft_vocab_model(**batch), using the draft_tokens tensor/array returned
to compute min/max and fail the test if any token falls outside [0,31]; keep
existing loss/gradient checks intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6424fe24-2ed7-4cc1-becc-e8b677da30f5
📒 Files selected for processing (4)
tests/integration/conftest.pytests/integration/models/test_dflash_forward.pytests/integration/models/test_eagle3_forward.pytests/integration/models/test_peagle_forward.py
c25d274 to
3c8ac6a
Compare
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
3c8ac6a to
ae553cf
Compare
shanjiaz
left a comment
There was a problem hiding this comment.
Actually could this be merged to one file, seem to overlap a lot. Thanks!
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
64029de to
63c153a
Compare
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
More integration tests calling the model's forward and backwards and testing edge cases.
Tests
Added by this pr.
I have filled in: