Repository navigation
TST: pretrained-compat contract covers every model with released weights - #1252
Merged
bruAristimunha merged 3 commits intoOct 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in the test changes or documentation corrections.
0 open findings
What changed in this PR
Expands pretrained-model compatibility tests while leaving model execution unchanged.
Changes:
- Adds seven model classes and a coverage-completeness check.
- Runs REVE cases offline and tightens expected errors and warning filters.
- Corrects patch-count documentation for padded inputs.
| File | Description |
|---|---|
| test/unit_tests/models/test_pretrained_compat.py | Expands coverage, adds completeness checks, and enables offline REVE tests. |
| docs/whats_new.rst | Records compatibility-test improvements. |
| braindecode/models/luna.py | Corrects the documented padded patch count. |
| braindecode/models/labram.py | Clarifies documented patch shapes and counts. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1252 +/- ##
==========================================
+ Coverage 88.71% 89.05% +0.33%
==========================================
Files 157 157
Lines 19654 19654
==========================================
+ Hits 17437 17503 +66
+ Misses 2217 2151 -66 🚀 New features to boost your workflow:
|
lindicaphxag-tech
added a commit
to lindicaphxag-tech/braindecode
that referenced
this pull request
Oct 8, 2026
…erving EEG-CLIP entry
lindicaphxag-tech
added a commit
to lindicaphxag-tech/braindecode
that referenced
this pull request
Oct 8, 2026
…ouching pretrained contracts
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Oct 8, 2026
…nto fix/model-dtypes
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Oct 8, 2026
…aindecode#1250, braindecode#1252) into fix/hpu-models
bruAristimunha
added a commit
to lindicaphxag-tech/braindecode
that referenced
this pull request
Oct 8, 2026
bfloat16 and HPU inputs now get their spectrogram in float32 on the CPU. The model ships released weights, so the braindecode#1252 coverage test needs a COMPAT entry (channel-agnostic, 200 Hz).
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.
test_pretrained_compat.pyis meant to cover every model class with released weights. On master it covers 21 classes and misses 7: NeuroRVQ, MAPA, BrainOmni, BrainTokenizer, SignalJEPA_Contextual, SignalJEPA_PostLocal, SignalJEPA_PreLocal. Nothing checked that the list was complete.Changes, all in
test/unit_tests/models/test_pretrained_compat.pyunless noted:contact_labelsstrategy: a name without a trailing contact number (Fz) raises.test_compat_covers_every_pretrained_model: every class inmodels_dictwhose source mentionshf_hub_download,from_pretrained(,huggingface.co/orHugging Face Hubmust be in COMPAT or inEXCLUDED(NeuroPose and VEMG2Pose, sEMG). Appended to the master version of this file, it fails and lists the 7 classes above.--run-network, becausetest/conftest.pymarks the literal param"REVE"as network. The entry is now keyedREVE-local-bank, and an autouse fixture writesreve_positions.json(10-05 positions plus E1..E128) and pointsREVE_POSITIONS_PATHat it. The 9 REVE cases now run in default CI. The released bank (543 names) contains all names used by the grid; the master REVE cases also pass against it with--run-network(9 passed).match=(e.g.n_times|window,n_channel_embeddings,locations|positions,channel name,divisible,trailing number) instead of accepting anyValueError/RuntimeError.warnings.simplefilter("ignore")in the geometry test is replaced by a modulefilterwarningslist of 5 known messages (padding notice, MNE montage rename, STFT window, nested tensor,weight_norm), so other warnings show up.NO_STRATEGY= {NeuroRVQ, MAPA, BrainOmni, BrainTokenizer}: these take nochannel_strategyargument, so they are left out oftest_native_checkpoint_loads_under_a_strategy._SegmentPatch.forward(Labram) and_PatchEmbedNetwork.forward(LUNA) saidn_times // patch_sizepatches; with the default padding the count isceil(n_times / patch_size).Checks (CPU, torch 2.14.1, mne 1.13.2):
test_pretrained_compat.py: 240 passed, 0 skipped (master: 187 cases, of which the 9 REVE cases are skipped without--run-network).n_times800/837 and 512/549: outputs and state-dict keys identical to master, max abs diff 0.0.