Fix: improved unsafe pickle strategy#1545
Merged
jmartin-tech merged 9 commits intoNVIDIA:mainfrom Jan 14, 2026
Merged
Conversation
GoogleTranslator stores a live Google Cloud translation client on the instance, which cannot be pickled when parallel_attempts > 1 and causes PicklingError during multiprocessing startup. This change prevents the client from being pickled and allows it to be recreated per worker process, following the same pattern used by RivaTranslator.# On branch fix-googletranslator-pickling Signed-off-by: Harsh Motla <[email protected]>
Signed-off-by: Jeffrey Martin <[email protected]>
Signed-off-by: Jeffrey Martin <[email protected]>
Signed-off-by: Jeffrey Martin <[email protected]>
This better reflects the expected outcome of the method Signed-off-by: Jeffrey Martin <[email protected]>
Moves fileformats.FileIsExecutable to the new `_load_deps` deferred loading pattern Signed-off-by: Jeffrey Martin <[email protected]>
Signed-off-by: Jeffrey Martin <[email protected]>
jmartin-tech
commented
Jan 9, 2026
All "plugins" are of class `Configurable`, since serialization is also coupled to the naming conventions defined in `_load_deps()`, consolidate the method in the common class. Signed-off-by: Jeffrey Martin <[email protected]>
Signed-off-by: Jeffrey Martin <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Inspired by #1543, and address the required review comments in that PR.
Fixes #1471
This revises custom
picklecode for all class implementingConfigurableto suppress volatile attributes that cannot be pickled without changes to the original instance.This pattern use the following aspects:
_unsafe_attributesis aList[str]of attributes defined in the class as needing to be suppressedself.dictin the original instanceunsafeentriesextra_dependency_namesentries_load_depsto restore any modules references_load_unsafeto restore any registered volatile attributesThe above patten avoids modification of the original instance ensuring multi-processing will not impact state, and removes the need for
_clear_clientby simplifying the registration of volatile attributes.Testing showed that
promptinjectprobes were holding a local module reference that could also impactpicklesupport and has a been refactored to allow all plugins to pass testing.Verification
List the steps needed to make sure this thing works
picklesupportparallel_attemptandparallel_requestruns using a compatible generatorparallel_attemptandparallel_requestruns using a compatible generator and translation using Google Cloud Translate