Skip to content

Fix Sequential model serialization format - #699

Merged
sdatkinson merged 3 commits into
mainfrom
fix-sequential-model-format
Aug 23, 2026
Merged

sdatkinson merged 3 commits into
mainfrom
fix-sequential-model-format

Conversation

@sdatkinson

Copy link
Copy Markdown
Owner

Summary

  • serialize Sequential as a true container whose config.models entries are complete child NAM objects
  • keep the wrapper's top-level weights empty so each child owns its architecture, configuration, weights, and sample rate
  • add recursive import support for canonical and nested Sequential models
  • require the case-sensitive architecture name "Sequential"
  • reject non-empty wrapper weights and the unrecoverable legacy bare-child-config representation
  • document the intentional compatibility break without changing the .nam file version

This aligns trainer exports with the Sequential support merged in NeuralAmpModelerCore#323 and supersedes the experimental serialization introduced in #596.

The branch is based on the current main, including the Linear tap-order fix from #697. Its chronological-tap test now verifies the weights inside each exported child rather than the removed flattened wrapper weights.

Tests

  • python -m pytest -q tests/test_nam/test_models/test_sequential.py tests/test_nam/test_models/test_from_nam.py tests/test_nam/test_models/test_factory.py — 48 passed, 1 skipped
  • python -m pytest -q --ignore=tests/test_graceful_shutdown.py --ignore=tests/test_bin — 382 passed, 21 skipped
  • python -m black --check nam/models/_from_nam.py nam/models/sequential.py tests/test_nam/test_models/test_sequential.py
  • python -m sphinx -W -b html docs/source build/docs-html

Compatibility note

Earlier experimental Sequential files stored bare child configs plus flattened top-level weights. Those files cannot be reconstructed reliably because they omit child architectures and weight boundaries, so this PR intentionally rejects them while retaining file version 0.7.0.

@sdatkinson
sdatkinson merged commit 0072676 into main Aug 23, 2026
6 checks passed
@sdatkinson
sdatkinson deleted the fix-sequential-model-format branch August 23, 2026 01:38
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