Skip to content

[ML] Correctly handle empty inputs in chunkedInfer() - #138632

Merged
jimczi merged 6 commits into
elastic:mainfrom
DonalEvans:handle-empty-chunked-infer-input
Nov 28, 2025
Merged

jimczi merged 6 commits into
elastic:mainfrom
DonalEvans:handle-empty-chunked-infer-input

Conversation

@DonalEvans

Copy link
Copy Markdown
Contributor
  • Add method to allow services that implement SenderService to indicate whether they support chunked inference
  • Return immediately if the input list is empty for services that support chunked inference
  • Throw exception if the input list is empty for services that do not support chunked inference, to maintain existing behaviour
  • Add tests for all services that implement doChunkedInfer()
  • Update DeepSeekServiceTests for new error message

- Add method to allow services that implement SenderService to indicate
  whether they support chunked inference
- Return immediately if the input list is empty for services that
  support chunked inference
- Throw exception if the input list is empty for services that do not
  support chunked inference, to maintain existing behaviour
- Add tests for all services that implement doChunkedInfer()
- Update DeepSeekServiceTests for new error message
@DonalEvans DonalEvans added >bug :ml Machine learning Team:ML Meta label for the ML team v9.3.0 labels Nov 26, 2025
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @DonalEvans, I've created a changelog YAML for you.

@mromaios mromaios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@dan-rubinstein dan-rubinstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jimczi
jimczi merged commit f70dbb8 into elastic:main Nov 28, 2025
34 checks passed
wwang500 pushed a commit that referenced this pull request Nov 28, 2025
- Add method to allow services that implement SenderService to indicate
  whether they support chunked inference
- Return immediately if the input list is empty for services that
  support chunked inference
- Throw exception if the input list is empty for services that do not
  support chunked inference, to maintain existing behaviour
- Add tests for all services that implement doChunkedInfer()
- Update DeepSeekServiceTests for new error message

(cherry picked from commit f70dbb8)
wwang500 added a commit that referenced this pull request Nov 28, 2025
* [ML] Correctly handle empty inputs in chunkedInfer() (#138632)

- Add method to allow services that implement SenderService to indicate
  whether they support chunked inference
- Return immediately if the input list is empty for services that
  support chunked inference
- Throw exception if the input list is empty for services that do not
  support chunked inference, to maintain existing behaviour
- Add tests for all services that implement doChunkedInfer()
- Update DeepSeekServiceTests for new error message

(cherry picked from commit f70dbb8)

* fix JinaAI tests due to the conflict

---------

Co-authored-by: Donal Evans <donal.evans@elastic.co>
DonalEvans added a commit to DonalEvans/elasticsearch that referenced this pull request Dec 1, 2025
- Add method to allow services that implement SenderService to indicate
  whether they support chunked inference
- Return immediately if the input list is empty for services that
  support chunked inference
- Throw exception if the input list is empty for services that do not
  support chunked inference, to maintain existing behaviour
- Add tests for all services that implement doChunkedInfer()
- Update DeepSeekServiceTests for new error message

(cherry picked from commit f70dbb8)

# Conflicts:
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/jinaai/JinaAIServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/openshiftai/OpenShiftAiServiceTests.java
@DonalEvans

Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
✅ 9.2
✅ 9.1

Questions ?

Please refer to the Backport tool documentation

DonalEvans added a commit to DonalEvans/elasticsearch that referenced this pull request Dec 1, 2025
- Add method to allow services that implement SenderService to indicate
  whether they support chunked inference
- Return immediately if the input list is empty for services that
  support chunked inference
- Throw exception if the input list is empty for services that do not
  support chunked inference, to maintain existing behaviour
- Add tests for all services that implement doChunkedInfer()
- Update DeepSeekServiceTests for new error message

(cherry picked from commit f70dbb8)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/SenderService.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ai21/Ai21Service.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/contextualai/ContextualAiService.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/deepseek/DeepSeekServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/jinaai/JinaAIServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/llama/LlamaServiceTests.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/openshiftai/OpenShiftAiServiceTests.java
@DonalEvans

Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
✅ 8.19

Questions ?

Please refer to the Backport tool documentation

@DonalEvans
DonalEvans deleted the handle-empty-chunked-infer-input branch December 2, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :ml Machine learning Team:ML Meta label for the ML team v8.19.9 v9.1.9 v9.2.3 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants