Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal sync #21

Merged
merged 3 commits into from
Mar 10, 2022
Merged

Internal sync #21

merged 3 commits into from
Mar 10, 2022

Conversation

njhill
Copy link
Member

@njhill njhill commented Mar 10, 2022

This is really expected to be the final sync of IBM-internal fixes, future PRs will be made directly against this repo.

joerunde and others added 3 commits March 10, 2022 12:38
Signed-off-by: Joe Runde <[email protected]>

Co-authored-by: Nick Hill <[email protected]>
Co-authored-by: TRAVIS JOHNSON <[email protected]>
- grpc 1.45.0
- guava 31.1
- protobuf 3.19.4
- jackson-databind 2.13.2
- log4j 2.17.2

Signed-off-by: Nick Hill <[email protected]>
Motivation

We had hoped that the notorious cascading eviction bug was fixed recently but though still infrequent it was observed once again in the wild.

Upon close analysis of these latest occurrences in production logs it was possible to determine the source of the remaining race condition.

The problem basically comes down to the fact that we attempt to "immediately" adjust the unload buffer accounting at the point entries are evicted from the cache, but this was still not done atomically. So with the right confluence of events between different threads, it was possible for a model loading thread to incorrectly think there's sufficient space to proceed rather than waiting for other unloads to complete. This in turn results in the over-committed state that causes the eviction cascade.

Modifications

- Unify the cache's eviction lock with the separate UNLOAD_BUF lock, and move the eviction callbacks within the locked context.
- Eliminate the separate eviction thread and instead perform the eviction processing inline (including related cache accounting updates).
- Add unit tests to exercise eviction / unload buffer behaviour and to trigger an eviction cascade prior to this fix.

Result

Hopefully no more cascading evictions possible.

Signed-off-by: Nick Hill <[email protected]>
@njhill
Copy link
Member Author

njhill commented Mar 10, 2022

/hold

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: njhill, pvaneck

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@njhill njhill merged commit d763875 into main Mar 10, 2022
@njhill njhill deleted the internal-sync3 branch March 18, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants