Add retry mechanism and dynamic model loading to SONIC framework#26
Closed
kakwok wants to merge 1 commit into
Closed
Add retry mechanism and dynamic model loading to SONIC framework#26kakwok wants to merge 1 commit into
kakwok wants to merge 1 commit into
Conversation
Co-authored-by: Trevin Lee <trevin-lee@users.noreply.github.com>
409afe2 to
e23f6fb
Compare
Author
|
superseded by #27 |
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.
PR description:
Introduces a pluggable retry mechanism for SONIC inference clients and dynamic
model loading/unloading on the Triton fallback server. This enables automatic
recovery when a remote Triton server becomes unavailable during event processing.
Retry mechanism (
SonicCore)RetryActionBase: Plugin factory base class for retry strategies, withretry(),start(),finish()interfaceRetrySameServerAction: Retries inference on the same server (configurableallowedTries)SonicClientBase::finish(): Drives retry loop — on retryable failure(
finish(false)), iterates through registered retry actions; on non-retryablefailure (
finish(false, eptr)), propagates exception directlyRetry with server failover (
SonicTriton)RetryActionDiffServer: On failure, queriesTritonService::getBestServer()for an alternative healthy remote server, calls
updateServer()+eval()toretry on the new server
RetryFallbackServerAction: Last-resort action — when all other retries areexhausted, lazily starts the fallback server (idempotent), dynamically loads the
model to the fallback server via
TritonClient::switchToFallback(), and retries locally. Fires at mostonce per inference call.
TritonServicemaintains per-server health stats(liveness, readiness, failure count, queue time) via
updateServerHealth(),used by
getBestServer()to select the best candidateresolveServerName()prefers remote (non-fallback)servers when multiple servers provide the same model;
getBestServer()excludesfallback servers from candidate pool
Async retry redesign (holder-based)
evaluate()(Async mode) creates an innerWaitingTaskWithArenaHolderperinference attempt — the gRPC callback calls
doneWaiting()and returnsimmediately;
finish()/retry()/updateServer()are scheduled as TBB tasksDynamic model loading (
TritonService)loadModel()/unloadModel()with reference counting for the fallback serverstartFallbackServer()is idempotent; only started atpreBeginJobforunassigned models (no remote server available)
serversHealth_Configuration
RetryVPSet in client config(
retryType,allowedTries)customize.pyupdated with retry options, defaulted to addRetryFallbackServerActionas the last action.PR validation:
retry_diffServer_fallback.log