Skip to content

[ML] update inference configuration options for storage and inference #1600

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 8 commits into from
Apr 19, 2022

Conversation

benwtrent
Copy link
Member

This updates the inference configuration options for:

  • classification
  • regression
  • nlp tasks

All configurations have a stored type and an update type. It may or may not be the case that the update version contains a smaller number of allowable fields.

text_embedding?: TextEmbeddingInferenceUpdateOptions
}

export class PipelineAggInferenceConfigUpdateContainer {
Copy link
Member Author

Choose a reason for hiding this comment

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

Pipeline aggregation only allows regression and classification currently.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

The changes look good, but there are a few type renames, which might be a problem for some clients.
Please @elastic/es-clients take a look.

@stevejgordon
Copy link
Contributor

@delvedor For the .NET client, the renames are fine as we're in alpha and haven't yet generated the ML APIs.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks for this!

It looks like you've got <ModelType>Options classes and <ModelType>UpdateOptions classes which mostly match. Instead you should switch these to use the @overloadOf behavior & convention where the classes that are used for requests can be named <ModelType>Options and the classes for responses are named: <ModelType>OptionsRead. Does this construction work for the case we're covering here?

Also going to tag @swallez since this likely will mean breaks in Java due to renaming, wanted your thoughts as well.

text_embedding?: TextEmbeddingInferenceUpdateOptions
}

export class PipelineAggInferenceConfigUpdateContainer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a /** @variants container */ decorator here too

text_embedding?: TextEmbeddingInferenceUpdateOptions
}

export class PipelineAggInferenceConfigUpdateContainer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a /** @variants container */ decorator here too

@benwtrent
Copy link
Member Author

@swallez @sethmlarson I can adjust the naming back, but its "non-optimal" IMO as its not descriptive of what the type means.

IDK how ts file location adjusts the generated types, but it would be good to have all the inference objects in the same place (logically).

@benwtrent
Copy link
Member Author

Does this construction work for the case we're covering here?

From what I can tell, Overload requires the all the properties to be satisfied. For all the NLP update cases, its actually a subset of the fields. So, it doesn't really fit here.

@@ -157,41 +161,14 @@ export class InferenceAggregation extends PipelineAggregationBase {
inference_config?: InferenceConfigContainer
}

export class InferenceConfigContainer {
/** @variants container */
class InferenceConfigContainer {
Copy link
Contributor

@sethmlarson sethmlarson Apr 18, 2022

Choose a reason for hiding this comment

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

Not a review comment, but this name is unfortunate as it's in the global namespace, would've been better as InferenceAggregationInferenceConfigContainer which would be a breaking change but allows using InferenceConfigContainer within ml/_types/inference.

Copy link
Member

@swallez swallez left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, it's very nice to see contributions to the spec from the server dev team!

I'm not overly concerned by the renaming even if it causes a breaking change as there are a lot of data structure refinements that would require some code changes anyway. Also I may be mistaken but I haven't heard yet of Java client users going deep in ML APIs, so the impact should be fairly limited.

So LGTM from me once the other issues reported have been resolved.

@benwtrent benwtrent requested a review from sethmlarson April 19, 2022 12:17
Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@benwtrent benwtrent merged commit 498e050 into elastic:main Apr 19, 2022
@benwtrent benwtrent deleted the feature/ml-nlp-specification-fixes branch April 19, 2022 14:37
sethmlarson pushed a commit that referenced this pull request Apr 19, 2022
…#1600)

This updates the inference configuration options for:

 - classification
 - regression
 - nlp tasks

All configurations have a stored type and an update type. It may or may not be the case that the update version contains a smaller number of allowable fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants