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

fix no worker node exception for remote embedding model #1482

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,16 @@ private void executePredict(
String requestId = mlPredictionTaskRequest.getRequestID();
log.debug("receive predict request " + requestId + " for model " + mlPredictionTaskRequest.getModelId());
long startTime = System.nanoTime();
// For remote text embedding model, neural search will set mlPredictionTaskRequest.getMlInput().getAlgorithm() as
// TEXT_EMBEDDING. In ml-commons we should always use the real function name of model: REMOTE. So we try to get
// from model cache first.
FunctionName functionName = modelCacheHelper
.getOptionalFunctionName(modelId)
.orElse(mlPredictionTaskRequest.getMlInput().getAlgorithm());
mlPredictTaskRunner
.run(
mlPredictionTaskRequest.getMlInput().getAlgorithm(),
// This is by design to NOT use mlPredictionTaskRequest.getMlInput().getAlgorithm() here
functionName,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fine-tune this part either in neural search side or in ml-commons side, more and more twisted code could cause more and more issues.

mlPredictionTaskRequest,
transportService,
ActionListener.runAfter(wrappedListener, () -> {
Expand Down
Loading