[BUGFIX] Make ContainerModel::SetSlimmableSize thread-safe#260
Merged
sdatkinson merged 4 commits intomainfrom Apr 28, 2026
Merged
[BUGFIX] Make ContainerModel::SetSlimmableSize thread-safe#260sdatkinson merged 4 commits intomainfrom
sdatkinson merged 4 commits intomainfrom
Conversation
…Size doesn't change which model is active.
Added calls to ResetAndPrewarm in test_container_default_is_max_size to guarantee that both predictions start from the same model state, enhancing test reliability.
Use atomic active-index loads/stores and a mutex-protected activation path so concurrent SetSlimmableSize calls cannot race with RT processing. Made-with: Cursor
…Core into container-fix
synchu
pushed a commit
to synchu/NeuralAmpModelerCore
that referenced
this pull request
Apr 29, 2026
…n#260) * [BUGFIX] Avoid prewarming container slimmable model when SetSlimmableSize doesn't change which model is active. * [TEST] Ensure consistent model state before processing in test_container Added calls to ResetAndPrewarm in test_container_default_is_max_size to guarantee that both predictions start from the same model state, enhancing test reliability. * [BUGFIX] Make container model activation thread-safe. Use atomic active-index loads/stores and a mutex-protected activation path so concurrent SetSlimmableSize calls cannot race with RT processing. Made-with: Cursor
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.
Bug discovered from multiple threads calling
SetSlimmableSize()(UI and processor threads). Both would end up callingResetand cause massive issues with internal state as prewarming was attempted.Fix with a mutex to make it thread-safe.