Skip to content

fix(core): handle DataParallel, device mismatch, and embedding perturbation#91

Merged
johnmarktaylor91 merged 1 commit intomainfrom
fix/failing-tests
Mar 3, 2026
Merged

fix(core): handle DataParallel, device mismatch, and embedding perturbation#91
johnmarktaylor91 merged 1 commit intomainfrom
fix/failing-tests

Conversation

@johnmarktaylor91
Copy link
Copy Markdown
Owner

Summary

  • Unwrap nn.DataParallel at entry points (log_forward_pass, show_model_graph, validate_saved_activations) — fixes CORnet models
  • Auto-move inputs to model device with recursive _move_tensors_to_device supporting dict/UserDict/BatchEncoding — fixes sentence_transformer CUDA mismatch
  • Exempt embedding index arg from perturbation (STRUCTURAL_ARG_POSITIONS) — prevents CUDA OOB from random indices during validation

Also 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 unwrap
  • test_sentence_transformer — device migration + embedding exemption
  • test_dimenet — PyG upgrade (numpy.math removal)
  • test_qml — pennylane/autograd upgrade (numpy.msort removal)
  • test_vit, test_fcos_resnet50_eval — PyTorch downgrade

Test plan

  • All 9 previously failing tests pass (9/9 passed, 180s)
  • Full suite regression check

…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>
@johnmarktaylor91 johnmarktaylor91 merged commit 249f25f into main Mar 3, 2026
1 check passed
@johnmarktaylor91 johnmarktaylor91 deleted the fix/failing-tests branch March 3, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant