feat: hot-reload mechanism for geaflow-infer module.#786
Open
aotenjou wants to merge 6 commits intoapache:masterfrom
Open
feat: hot-reload mechanism for geaflow-infer module.#786aotenjou wants to merge 6 commits intoapache:masterfrom
aotenjou wants to merge 6 commits intoapache:masterfrom
Conversation
…time Implement blue-green hot swap in TorchInferSession with throttled version polling, async single-flight loading, warmup-before-switch, and rollback with backoff so workers can safely adopt newly published models without request interruption.
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.
What changes were proposed in this pull request?
How was this PR tested?
This pull request introduces a comprehensive hot-reload mechanism for model inference in the Geaflow system. The changes add new configuration keys, extend the Java inference context and data exchange logic, and implement a robust hot-reload workflow in the Python inference session. These improvements allow for dynamic model updates with configurable polling intervals, backoff strategies, and optional warmup, increasing the flexibility and reliability of model deployment.
Hot-reload configuration and integration:
FrameworkConfigKeysto control model hot-reload behavior, including model path, version file, polling interval, backoff, warmup, and enable flags.InferContextto read and pass these hot-reload settings as parameters to the inference process, integrating them into the command invocation.InferEnvironmentContextto generate the appropriate command-line arguments for the new hot-reload parameters.Resource management improvements:
DataExchangeContextandDataExchangeQueueto use instance-levelAtomicBooleanflags for safe resource cleanup, and improved shutdown hook handling to ensure native memory is released exactly once.Python inference session hot-reload logic:
inferSession.pyusing a background thread to monitor the model version manifest, reload models as needed, handle failures with backoff, and optionally perform warmup. This design supports atomic model swaps and robust error handling.These changes collectively enable dynamic, reliable, and configurable hot-reloading of inference models in Geaflow.