Repository navigation
Remove superseded torch backends (#32) - #35
Merged
neuromechanist merged 2 commits intoJul 4, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
AMICATorchNG is now the sole PyTorch backend; AMICA wraps it directly. - Delete AMICATorch, AMICATorchV2, and their helper modules (mixture_models, optimizers, newton_optimizer, adaptive_pdf, fortran_output) plus the dead root-level dev scripts. - Drop the backend= selector and the basic-backend-only debug/output_dir fit args; save/load now raise NotImplementedError (#15). - Remove buggy save_pytorch_results (resolves #16); deleting the basic mixture M-step also makes #31 moot. - Repoint validate_implementations.py at NG via the AMICA wrapper. - Update docs (AGENTS, FEATURE_PARITY, PROGRESS_SUMMARY, ADR 0001). Tested: torch suite (23 passed) and non-slow suite (31 passed, 1 xfailed) green; harness smoke-fit ascends toward the Fortran LL.
4 tasks
- validate harness: warn on params.json keys the NG backend can't honor (was silently dropped), raise on num_comps != data_dim (NG has no PCA reduction), and pop seed/device from NG kwargs to avoid a future duplicate-keyword TypeError. - Restore a fast, deterministic per-source LL factorization-order guard for single-model NG (independent NumPy reference; no fit/Fortran), covering the historical issue-#11 bug class the deleted tests guarded. - save()/load() now reference issue #36 (NG persistence) instead of #15 (which is about test coverage of the removed backend). - Docs/comments: drop stale backend= selector refs (FEATURE_PARITY, PROGRESS_SUMMARY), fix the autodiff feature bullet, reflow the NG module docstring, note removed persistence in the example, correct the harness init comment (identity + small perturbation). Tested: torch suite 24 passed; non-slow suite 32 passed, 1 xfailed.
Member
Author
PR review (4 agents, Sonnet) + resolutionsRan code-review, silent-failure, test-coverage, and comment-accuracy reviewers. Findings and how each was handled (fixed in a196007): Addressed
Skipped (with rationale)
Tests after fixes: torch suite 24 passed; non-slow suite 32 passed, 1 xfailed (the unrelated NumPy-CLI #30). |
neuromechanist
deleted the
32-remove-parked-amicatorchv2-and-promote-backend=ng-to-default
branch
July 4, 2026 18:23
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
Now that
AMICATorchNG(the natural-gradient EM backend) reaches Fortran parity, this removes the superseded Adam/autograd backends.AMICATorchNGbecomes the sole PyTorch backend and the publicAMICAinterface wraps it directly.Per maintainer direction: retire (remove) the buggy/superseded paths outright rather than deprecate; NG covers the needed functionality.
Changes
amica_torch.py(AMICATorch),amica_torch_v2.py(AMICATorchV2), and their now-dead helpersmixture_models.py,optimizers.py,newton_optimizer.py,adaptive_pdf.py,fortran_output.py.AMICATorchNGimports only.utils, so nothing it needs was removed.test_torch_fixed.py,test_torch_amica.py,test_enhanced_amica.py; andtorch_tests/{test_torch_components,test_torch_vs_fortran,test_correctness_fixes}.py(all exercised the removed backends). NG/Fortran parity coverage remains intest_ng_backend.pyandtest_amica_ng_wrapper.py.AMICAinterface (amica.py): dropped thebackend=selector and the basic-backend-onlydebug/output_dirfit args; it now wrapsAMICATorchNG.save/loadraiseNotImplementedError(a persistence format is tracked in Test coverage gaps: AMICA.save/load and plot_components #15).utils.py: removed the buggysave_pytorch_results()(it called a non-existentAMICATorch.save) — resolves save_pytorch_results() calls non-existent AMICATorch.save #16.validate_implementations.py: repointed the PyTorch path at NG via theAMICAwrapper (mapssample_params.jsonto NG kwargs).examples/torch_example.py: rewritten to use theAMICA(NG) wrapper..context/plan.mdupdated.Related issues
save_pytorch_results).GaussianMixtureICA.fit_emM-step lived in the deletedmixture_models.py.Testing
23 passed.31 passed, 1 xfailed(the 1 xfail is the independent NumPy CLI save/load issue Legacy CLI save/load format mismatch (.npy vs Fortran binary) #30).ruff check+ruff formatclean.Net: +205 / -4908 lines across 26 files.