fix(core): handle DataParallel, device mismatch, and embedding perturbation#91
Merged
johnmarktaylor91 merged 1 commit intomainfrom Mar 3, 2026
Merged
fix(core): handle DataParallel, device mismatch, and embedding perturbation#91johnmarktaylor91 merged 1 commit intomainfrom
johnmarktaylor91 merged 1 commit intomainfrom
Conversation
…bation (#91) - Unwrap nn.DataParallel in log_forward_pass, show_model_graph, validate_saved_activations - Auto-move inputs to model device (supports dict, UserDict, BatchEncoding) - Exempt embedding index arg from perturbation (prevents CUDA OOB) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
nn.DataParallelat entry points (log_forward_pass,show_model_graph,validate_saved_activations) — fixes CORnet models_move_tensors_to_devicesupporting dict/UserDict/BatchEncoding — fixes sentence_transformer CUDA mismatchembeddingindex arg from perturbation (STRUCTURAL_ARG_POSITIONS) — prevents CUDA OOB from random indices during validationAlso required env upgrades (not in diff): PyTorch 2.10→2.8, PyG 2.4→2.7, pennylane 0.36→0.44, h5py/matplotlib for numpy 2.x compat.
Tests fixed (9)
test_cornet_z,test_cornet_s,test_cornet_r,test_cornet_rt— DataParallel unwraptest_sentence_transformer— device migration + embedding exemptiontest_dimenet— PyG upgrade (numpy.math removal)test_qml— pennylane/autograd upgrade (numpy.msort removal)test_vit,test_fcos_resnet50_eval— PyTorch downgradeTest plan