Replace debug flag with per-topic env vars in ContrastiveModel - #26
Merged
Conversation
…eModel Debug logging was gated by a single constructor arg that toggled five unrelated log statements together. Split into SCCONCEPT_DEBUG_BATCH_VALUES, SCCONCEPT_DEBUG_SEQLEN_CORR, SCCONCEPT_DEBUG_ARGMAX_MATCH, SCCONCEPT_DEBUG_PANELS, and SCCONCEPT_DEBUG_PREDICT_BATCH so each debug topic can be enabled independently at runtime without touching model construction code. Co-Authored-By: Claude <[email protected]>
Adds SCCONCEPT_DEBUG_SAMPLE_STATS so per-step sample_stats can be inspected via logger.debug without enabling any of the other debug topics. Co-Authored-By: Claude <[email protected]>
Adds SCCONCEPT_DEBUG_PRECOMP_EMBS to log whether precomputed embeddings are used at each training/validation step, independent of the other debug topics. Co-Authored-By: Claude <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 66.92% 66.99% +0.07%
==========================================
Files 22 22
Lines 2990 3003 +13
==========================================
+ Hits 2001 2012 +11
- Misses 989 991 +2
🚀 New features to boost your workflow:
|
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.
Summary
debug: bool = Falseconstructor argument fromContrastiveModeland replaces it with five independent environment-variable flags, one per debug topic:SCCONCEPT_DEBUG_BATCH_VALUES— raw batch values for the first few train batchesSCCONCEPT_DEBUG_SEQLEN_CORR— correlation between logits and sequence lengthSCCONCEPT_DEBUG_ARGMAX_MATCH— periodic argmax/match diagnostics during trainingSCCONCEPT_DEBUG_PANELS— panel consistency validation during validationSCCONCEPT_DEBUG_PREDICT_BATCH— batch tokens/values duringpredict_stepSCCONCEPT_DEBUG_PANELS=1) without changing model construction code.debug=explicitly, so this is backward compatible.Test plan
python -m py_compile src/concept/model.py/ AST parse succeedsdebug=toContrastiveModel🤖 Generated with Claude Code