-
Notifications
You must be signed in to change notification settings - Fork 13
Refactor deployments #196
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
Merged
Merged
Refactor deployments #196
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
44f8691
Refactor to remove deployments. Just use actors.
JadenFiotto-Kaufman 5263efc
Merge branch 'dev' into refactor-deployments
JadenFiotto-Kaufman 9101b20
Merge
JadenFiotto-Kaufman 310fbf8
only delete cache evictions duting state application
JadenFiotto-Kaufman 06f7c56
review changes
MichaelRipa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,6 @@ def __init__( | |
| self.minimum_deployment_time_seconds = minimum_deployment_time_seconds | ||
| self.model_cache_percentage = model_cache_percentage | ||
|
|
||
| self.update_nodes() | ||
|
|
||
| @property | ||
| def state(self): | ||
|
|
@@ -105,7 +104,7 @@ def update_nodes(self): | |
| gpu_memory_bytes=gpu_memory_bytes, | ||
| cpu_memory_bytes=cpu_memory_bytes, | ||
| available_cpu_memory_bytes=cpu_memory_bytes, | ||
| available_gpus=total_gpus, | ||
| available_gpus=list(range(int(total_gpus))), | ||
| ), | ||
| minimum_deployment_time_seconds=self.minimum_deployment_time_seconds, | ||
| ) | ||
|
|
@@ -114,12 +113,15 @@ def update_nodes(self): | |
| f"=> Node {name} updated with resources: {self.nodes[id].resources}" | ||
| ) | ||
|
|
||
| for node in self.nodes.keys(): | ||
| if node not in current_nodes: | ||
| for node_id in self.nodes.keys(): | ||
| if node_id not in current_nodes: | ||
|
|
||
| del self.nodes[node] | ||
| node = self.nodes.pop(node_id) | ||
| node.purge() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to what I commented regarding |
||
|
|
||
| logger.info(f"=> Node {node_id} removed from cluster") | ||
|
|
||
|
|
||
| logger.info(f"=> Node {node} removed from cluster") | ||
|
|
||
| def deploy(self, model_keys: List[MODEL_KEY], dedicated: Optional[bool] = False): | ||
| """ | ||
|
|
@@ -161,8 +163,6 @@ def deploy(self, model_keys: List[MODEL_KEY], dedicated: Optional[bool] = False) | |
|
|
||
| logger.info("=> Checking to evict deprecated dedicated deployments...") | ||
|
|
||
| cache_futures = [] | ||
|
|
||
| for node in self.nodes.values(): | ||
|
|
||
| for model_key, deployment in list(node.deployments.items()): | ||
|
|
@@ -175,16 +175,10 @@ def deploy(self, model_keys: List[MODEL_KEY], dedicated: Optional[bool] = False) | |
|
|
||
| results['evictions'].add(model_key) | ||
|
|
||
| if node.evict(model_key, exclude=set(model_keys)): | ||
| cache_future = deployment.cache() | ||
| node.evict(model_key, exclude=set(model_keys)) | ||
|
|
||
| if cache_future is not None: | ||
| cache_futures.append(cache_future) | ||
|
|
||
| change = True | ||
|
|
||
| ray.get(cache_futures) | ||
|
|
||
| # Sort models by size in descending order (deploy biggest ones first) | ||
| sorted_models = sorted( | ||
| model_sizes_in_bytes.items(), key=lambda x: x[1], reverse=True | ||
|
|
@@ -262,7 +256,7 @@ def deploy(self, model_keys: List[MODEL_KEY], dedicated: Optional[bool] = False) | |
| logger.info( | ||
| f"=> Deploying {model_key} with size {size_in_bytes} on {self.nodes[node_id].name} because {candidate_level.name}. Requiring evictions: {candidate.evictions}" | ||
| ) | ||
|
|
||
| self.nodes[node_id].deploy( | ||
| model_key, candidate, size_in_bytes, dedicated=dedicated, exclude=set(model_keys) | ||
| ) | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.