perf(eagle3): gate the drafter quality diagnostics on the log level - #68
Conversation
compute_loss collected per-step quality stats unconditionally. Each step ran valid_position.any() and three .item() calls to build quality_step_stats, then the summary line fired at WARNING with six more .item() calls. Every one of them is a device sync, they run on every microbatch, and the numbers are log-only: nothing in the returned loss dict reads them. The EAGLE-1/2 backend already guards the same diagnostics with logger.isEnabledFor(logging.DEBUG). Do the same here, extend it to the non-finite-position and sparse-restricted-CE logs, and move the summary line from WARNING to DEBUG so routine per-step training metrics stop being reported as warnings. Behaviour at DEBUG is unchanged. Signed-off-by: khazic <khazzz1c@gmail.com>
caplog.at_level raises the logger to DEBUG, which is the exact condition under test, so the above-DEBUG case could never be observed through it. Signed-off-by: khazic <khazzz1c@gmail.com>
|
The
#68 and #70 are the clearest: neither touches the dspark or the dflash code path, yet those are the jobs that failed. Within a single run the three example jobs are serialized (on #63 they ran 11:25:05 to 11:42:21, 11:42:46 to 12:01:01, 12:01:27 to 12:19:55), so the contention comes from runs of different PRs overlapping. The failures cluster in the window where three PRs had example jobs in flight at once, and every job that started after that queue drained passed. The failed jobs also died in about 12 minutes against roughly 17 for a successful one, consistent with dying at engine init rather than during real work.
Could a maintainer re-run the failed job? I do not have the permission to ( |
Problem
Eagle3TrainerBackend.compute_losscollects per-step quality statistics unconditionally:Every one of those runs on every microbatch, and the numbers are log-only: nothing in the returned loss dict reads
quality_top1_correct,quality_topk_correct,quality_tokensorquality_step_stats. The non-finite-position check and the sparse-restricted-CE summary have the same shape.The summary line is also at
WARNING, so a normal training run emits one warning per step reporting routine metrics.The EAGLE-1/2 backend already guards the identical diagnostics:
Fix
Compute
diagnostics_enabled = logger.isEnabledFor(logging.DEBUG)once before the TTT loop and gate the quality block, the non-finite-position log and the sparse-restricted-CE log on it, then move the summary line fromWARNINGtoDEBUG.Behaviour at
DEBUGis unchanged.Validation
Ran a before/after repro on both
mainand this branch. It drivescompute_losswith a stub draft atINFOand atDEBUG, countingTensor.item()calls and recording what level the summary is emitted at.Before/after repro output
ttt_length=2here; the per-step part of that count grows withttt_length.Tests
New file
tests/integration/test_eagle3_diagnostics_gating_contract.py:test_quality_diagnostics_are_silent_above_debugtest_quality_diagnostics_are_emitted_at_debug, which also pins the level atDEBUGtest_quality_diagnostics_do_not_sync_above_debug, which countsTensor.item()callsThe tests attach a handler to the backend logger directly rather than using
caplog.at_level, because that helper raises the logger toDEBUGand would mask the exact condition under test.Full CPU suite (
tests/integration tests/compat tests/config tests/examples) run on both sides:Test suite before/after
The same 9 tests fail on
mainand on this branch. They need optional dependencies (VeOmni, the NPU vLLM stack) that are absent in this environment, so they are pre-existing and unrelated. The+3on this branch are the new tests above.