Skip to content

Commit

Permalink
excluding remote models from max node per node setting (opensearch-pr…
Browse files Browse the repository at this point in the history
…oject#2732) (opensearch-project#2738)

Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit 9ea79d0)

Co-authored-by: Dhrubo Saha <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and dhrubo-os authored Jul 24, 2024
1 parent ce6b36c commit ab60081
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ public void deployModel(
mlStats.createModelCounterStatIfAbsent(modelId, ActionName.DEPLOY, ML_ACTION_REQUEST_COUNT).increment();
List<String> workerNodes = mlTask.getWorkerNodes();
if (modelCacheHelper.isModelDeployed(modelId)) {
if (!autoDeployModel && workerNodes != null && workerNodes.size() > 0) {
if (!autoDeployModel && workerNodes != null && !workerNodes.isEmpty()) {
log.info("Set new target node ids {} for model {}", Arrays.toString(workerNodes.toArray(new String[0])), modelId);
modelCacheHelper.setDeployToAllNodes(modelId, deployToAllNodes);
modelCacheHelper.setTargetWorkerNodes(modelId, workerNodes);
Expand All @@ -999,7 +999,7 @@ public void deployModel(
listener.onResponse("successful");
return;
}
if (modelCacheHelper.getLocalDeployedModels().length >= maxModelPerNode) {
if (functionName != FunctionName.REMOTE && modelCacheHelper.getLocalDeployedModels().length >= maxModelPerNode) {
listener.onFailure(new IllegalArgumentException("Exceed max local model per node limit"));
return;
}
Expand Down

0 comments on commit ab60081

Please sign in to comment.