Warn on RF-DETR head reinit and fix distill-config and quant-docs drift - #628
Merged
Merged
Conversation
…ll config, cast docs - Warn loudly when RF-DETR training reinitializes the detection head on a class-count change: the pretrained head is discarded, so short fine-tunes underperform until the new head converges (measured ~9 mAP points at a 5-epoch budget even in fp32). - Route family="rfdetr" through the distillation config helper: the model class has had get_distill_config() support while the helper still rejected it, and the unsupported-family test had fossilized that drift (now uses picodet as the unknown family). - Quantization docs: fp16 and bf16 casts both execute natively; the execution-tier wording claimed fp16 only. Claude-Session: https://claude.ai/code/session_018Bkjq2cuWtXkEB6xHcLoRH
|
| Filename | Overview |
|---|---|
| libreyolo/distillation/configs.py | Adds RF-DETR support to the distillation helper using the no-weights model sentinel. |
| libreyolo/models/rfdetr/trainer.py | Limits the head-reinitialization warning to the main process while keeping model updates on all processes. |
| docs/quantization.md | Updates the native cast wording to include bf16 with fp16. |
| tests/unit/test_distillation.py | Updates the unsupported-family test now that RF-DETR is supported. |
Reviews (2): Last reviewed commit: "Address review: offline-safe rfdetr dist..." | Re-trigger Greptile
… warning - The rfdetr branch of get_distill_config now builds with the empty-dict no-weights sentinel: model_path=None resolves and downloads the default pretrained checkpoint, which broke the helper's lightweight offline contract. The shape probe only needs the architecture; the returned config is identical (verified under HF_HUB_OFFLINE=1). - The head-reinit warning is gated on is_main_process() so a DDP run logs it once instead of once per rank, matching the file's existing idiom. - Docstring notes that helper sizes are validated against the detect task; other tasks should call model.get_distill_config() directly. Claude-Session: https://claude.ai/code/session_018Bkjq2cuWtXkEB6xHcLoRH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small fixes from the 2026-07-19 quantization viability campaign:
Tests: tests/unit/test_distillation*.py and test_rfdetr_lr_contract.py, 79 passed.
Code provenance
All changes in this PR are original, written for this PR against the existing LibreYOLO codebase. No code was ported, adapted, or derived from any third-party source.