Skip to content

Commit d2aa214

Browse files
committed
clean up
# Conflicts: # x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentRebalancer.java # x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java # x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/ZoneAwareAssignmentPlanner.java
1 parent 0221a2b commit d2aa214

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentRebalancer.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ private static AssignmentPlan mergePlans(
132132

133133
/**
134134
* Transfers assignments from the source AssignmentPlan to the destination AssignmentPlan.Builder.
135-
*
136-
* @param source
137-
* @param dest
138-
* @param originalNodeById
139135
*/
140136
private static void copyAssignments(
141137
AssignmentPlan source,
@@ -147,13 +143,6 @@ private static void copyAssignments(
147143
for (Map.Entry<AssignmentPlan.Node, Integer> sourceAssignment : sourceNodeAssignments.entrySet()) {
148144
AssignmentPlan.Node node = originalNodeById.get(sourceAssignment.getKey().id());
149145
dest.assignModelToNode(deployment, node, sourceAssignment.getValue());
150-
// if (deployment.currentAllocationsByNodeId().containsKey(node.id())) {
151-
// // TODO (#101612) requiredMemory should be calculated by the AssignmentPlan.Builder
152-
// // As the node has all its available memory we need to manually account memory of models with
153-
// // current allocations.
154-
// long requiredMemory = deployment.estimateMemoryUsageBytes(deployment.currentAllocationsByNodeId().get(node.id()));
155-
// dest.accountMemory(deployment, node, requiredMemory);
156-
// }
157146
}
158147
}
159148
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -461,21 +461,9 @@ public Builder assignModelToNode(Deployment deployment, Node node, int allocatio
461461
}
462462

463463
private int getAssignedAllocations(Deployment deployment, Node node) {
464-
// int currentAllocations = getCurrentAllocations(deployment, node);
465464
return assignments.get(deployment).get(node);
466-
// return currentAllocations + assignmentAllocations;
467465
}
468466

469-
// private static int getCurrentAllocations(Deployment m, Node n) {
470-
// return m.currentAllocationsByNodeId.containsKey(n.id()) ? m.currentAllocationsByNodeId.get(n.id()) : 0;
471-
// }
472-
473-
// public void accountMemory(Deployment m, Node n) {
474-
// // TODO (#101612) remove or refactor unused method
475-
// long requiredMemory = getDeploymentMemoryRequirement(m, n, getCurrentAllocations(m, n));
476-
// accountMemory(m, n, requiredMemory);
477-
// }
478-
479467
public void accountMemory(Deployment m, Node n, long requiredMemory) {
480468
// TODO (#101612) computation of required memory should be done internally
481469
remainingNodeMemory.computeIfPresent(n, (k, v) -> v - requiredMemory);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/ZoneAwareAssignmentPlanner.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,6 @@ private AssignmentPlan swapOriginalDeploymentsInPlan(
212212
for (Map.Entry<Node, Integer> assignment : nodeAssignments.entrySet()) {
213213
Node originalNode = originalNodeById.get(assignment.getKey().id());
214214
finalPlanBuilder.assignModelToNode(originalDeployment, originalNode, assignment.getValue());
215-
// if (originalDeployment.currentAllocationsByNodeId().containsKey(originalNode.id())) {
216-
// // TODO (#101612) requiredMemory should be calculated by the AssignmentPlan.Builder
217-
// // As the node has all its available memory we need to manually account memory of models with
218-
// // current allocations.
219-
// long requiredMemory = originalDeployment.estimateMemoryUsageBytes(
220-
// originalDeployment.currentAllocationsByNodeId().get(originalNode.id())
221-
// );
222-
// finalPlanBuilder.accountMemory(planDeployment, originalNode, requiredMemory);
223-
// }
224215
}
225216
}
226217
return finalPlanBuilder.build();

0 commit comments

Comments
 (0)