Repository navigation
Integration checks for the error patterns that break models on accelerators and low precision (CPU-only); fixes for what they catch - #1253
Merged
bruAristimunha merged 16 commits intoOct 9, 2026
Conversation
…MSNet/FBLightConvNet in float16)
…copies after training)
…CodeBrain, TCFormer, LUNA, MVPFormer, BrainOmni/BrainTokenizer, ZUNA, EEGDINO, DIVER1)
…t syncs, accelerator/low-precision op gaps, device and dtype follow, inference_mode then training, deepcopy/pickle, channel-layer round trip
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1253 +/- ##
==========================================
+ Coverage 89.23% 89.25% +0.02%
==========================================
Files 158 158
Lines 19604 19627 +23
==========================================
+ Hits 17493 17518 +25
+ Misses 2111 2109 -2 🚀 New features to boost your workflow:
|
…, drop unused sync hook and dead branch
# Conflicts: # braindecode/models/neurorvq_tokenizer.py
bruAristimunha
added a commit
to lindicaphxag-tech/braindecode
that referenced
this pull request
Oct 9, 2026
…raindecode#1253) into EEG-CLIP; EEGCLIP text side in _UNUSED_IN_FORWARD
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.
CPU-only integration checks, run on every model in
models_dict, for the error patterns that broke models on accelerators (Intel Gaudi) and in low precision. No accelerator is needed: the forward and backward ops are recorded on CPU and checked.Checks (each guards a bug class we already hit):
braindecode.functional.spectral_input(Gaudi has no complex dtype)..item(),bool(tensor)) or data-dependent shape (nonzero, boolean-mask indexing) inforward, except listed init-time cases with a reason (they break lazy graphs).avg_pool3din bf16/fp16, low-precisioncdist, ELU/SELU backward withscale != 1,rollon a non-contiguous input, an LSTM fed by a permuted Conv1d output.metadevice touches no CPU tensor, and aftermodel.to(torch.float64)every floating tensor created inforwardis float64.torch.inference_mode();deepcopyandpickle; strictstate_dictround trip.model(x)andmodel.forward(x)agree under a channel strategy and the config keeps the input montage.Model fixes (root cause → equivalent op):
nn.SELUbackward has no Gaudi kernel (ELUscale != 1) →scale * x/F.elu(x, alpha * scale).avg_pool3dhas no CPU bf16/fp16 kernel →avg_pool2dover the time axis.StatLayer): clamp at 1e6 overflows float16 → clamp and log in at least float32.GeneralizedGaussianFilter): a non-persistentfiltersbuffer built with grad and overwritten inforwardbrokedeepcopyafter training → local tensor..to) → dropped.MLP(Labram, NeuroRVQ): stored a lambda, so the models did not pickle → no lambda.channel_strategylikeSignalJEPA.forwardwithout the input's dtype/device → follow the input; EEGDINO: host-sideone_hot→ on device.Float32 CPU outputs, gradients and state dicts are bit-identical to master for every touched model. With the #1249 fixes reverted, the new checks fail on exactly those models (EEGSym, BrainOmni/BrainTokenizer, EMG2QwertyNet, MetaNeuromotorHand, AttnSleep, EEGDINO and the dtype-follow models).