-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Clean up deployment suffixes between pipeline build() calls #23984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiaodong it seems to me that the DeploymentNameGenerator
should only be relevant for a single DAG traversal, right? Shouldn't it just be scoped to that traversal instead of globally scoped? Then we don't need to worry about resetting at all.
That's indeed simpler. I was trying to avoid collision if user re-uses the same class multiple invocations within the same serve instance so it should generate new suffix, but i think in current |
Failed tests are related to tensorflow, |
@jiaodong please update PR description. |
Discussed offline. One solution could be just don't make DeploymentName generator a global singleton, rather just passed it into the transform_ray_dag as an instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think we can further simplify by removing the locking logic now that it isn't a global singleton :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why are these changes needed?
We generate new suffix to differentiate multiple instantiation of the same name with _1 _2 -- within same serve instance. For CLI it uses new serve instance upon every call so there's no issue, but for jupyter notebook equivalent this could be a bit annoying since our deployment name generator is at class level.
This PR makes name generation at instance level, and adds a simple cleanup / reset upon calling
build()
so we start with clean state for dag traversal when it's used in context manager.Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.