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

[ML] adding new defer_definition_decompression parameter to put trained model API #77189

Merged

Conversation

benwtrent
Copy link
Member

This new parameter is a boolean parameter that allows
users to put in a compressed model without it having
to be inflated on the master node during the put
request

This is useful for system/module set up and then later
having the model validated and fully parsed when it
is being loaded on a node for usage

closes #77132

…ed model API

This new parameter is a boolean parameter that allows
users to put in a compressed model without it having
to be inflated on the master node during the put
request

This is useful for system/module set up and then later
having the model validated and fully parsed when it
is being loaded on a node for usage
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Sep 2, 2021
@elasticmachine
Copy link
Collaborator

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

@sethmlarson sethmlarson added the Team:Clients Meta label for clients team label Sep 2, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/clients-team (Team:Clients)

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.

Some feedback on the API spec:

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.

LGTM from a spec perspective!

@benwtrent
Copy link
Member Author

run elasticsearch-ci/packaging-tests-windows-sample

@benwtrent
Copy link
Member Author

@elasticmachine update branch

Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

Added some minor suggestions, otherwise docs LGTM


`defer_definition_decompression`::
(Optional, boolean)
Should the request defer definition decompression and skip relevant
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Should the request defer definition decompression and skip relevant
If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant

`defer_definition_decompression`::
(Optional, boolean)
Should the request defer definition decompression and skip relevant
validations when a `compressed_definition` is provided.
Copy link
Contributor

Choose a reason for hiding this comment

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

If my first suggestion is accepted, this is the second half:

Suggested change
validations when a `compressed_definition` is provided.
validations.

(Optional, boolean)
Should the request defer definition decompression and skip relevant
validations when a `compressed_definition` is provided.
This would be useful for systems or users that know a good JVM heap size estimate for their
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This would be useful for systems or users that know a good JVM heap size estimate for their
This deferral is useful for systems or users that know a good JVM heap size estimate for their

Should the request defer definition decompression and skip relevant
validations when a `compressed_definition` is provided.
This would be useful for systems or users that know a good JVM heap size estimate for their
model and that their model is valid and likely won't fail during inference.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
model and that their model is valid and likely won't fail during inference.
model and know that their model is valid and likely won't fail during inference.

"defer_definition_decompression": {
"required": false,
"type": "boolean",
"description": "Should the action skip decompressing the definition to validate it and set default values",
Copy link
Contributor

Choose a reason for hiding this comment

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

Since ideally the API docs will ultimately be generated from specs, I think this should match what's in the other asciidoc file. e.g.

Suggested change
"description": "Should the action skip decompressing the definition to validate it and set default values",
"description": "If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations.",

validationException.addValidationError(
"when ["
+ DEFER_DEFINITION_DECOMPRESSION
+ "] is true and a compressed definition is provided, estimated_heap_memory_usage_bytes must be set"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+ "] is true and a compressed definition is provided, estimated_heap_memory_usage_bytes must be set"
+ "] is true and a compressed definition is provided, [" + ESTIMATED_HEAP_MEMORY_USAGE_BYTES + "] must be set"

@@ -138,11 +141,16 @@ protected void masterOperation(Task task,
minCompatibilityVersion.toString()));
return;
}
} else if (state.nodes().getMinNodeVersion().before(state.nodes().getMaxNodeVersion())
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move this check at the top of masterOperation?

In addition, do we really need this check? I'm trying to think what happens if a user starts a rolling upgrade to the cluster and installs a fleet package that tries to put a model with defer_definition_compression. Is it worth failing the request? If we allowed it what would break? I assume if the model was loaded in an older node it would fail as the definition would be missing. Is that preferable?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dimitris-athanasiou I am being paranoid for sure. My concern is that we have no way of determining if the model definition can be inflated on the current min node version or not. Previously, we were able to validate that. I guess its "buyer beware" and I can remove this check, but they could get an ugly parsing error. Which, I suppose, is the case anyways.

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

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

LGTM

@benwtrent benwtrent merged commit 02e17c3 into elastic:master Sep 3, 2021
@benwtrent benwtrent deleted the feature/ml-put-trained-model-improvements branch September 3, 2021 13:07
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Sep 3, 2021
…ed model API (elastic#77189)

This new parameter is a boolean parameter that allows
users to put in a compressed model without it having
to be inflated on the master node during the put
request

This is useful for system/module set up and then later
having the model validated and fully parsed when it
is being loaded on a node for usage
benwtrent added a commit that referenced this pull request Sep 3, 2021
… trained model API (#77189) (#77256)

* [ML] adding new defer_definition_decompression parameter to put trained model API (#77189)

This new parameter is a boolean parameter that allows
users to put in a compressed model without it having
to be inflated on the master node during the put
request

This is useful for system/module set up and then later
having the model validated and fully parsed when it
is being loaded on a node for usage
wjp719 added a commit to wjp719/elasticsearch that referenced this pull request Sep 4, 2021
* master: (128 commits)
  Mute DieWithDignityIT (elastic#77283)
  Fix randomization in MlNodeShutdownIT (elastic#77281)
  Add target_node_name for REPLACE shutdown type (elastic#77151)
  [DOCS] Adds information about version compatibility headers (elastic#77096)
  Fix template equals when mappings are wrapped (elastic#77008)
  Fix TextFieldMapper Retaining a Reference to its Builder (elastic#77251)
  Move die with dignity to be a test module (elastic#77136)
  Update task names for rest compatiblity (elastic#75267)
  [ML] adjusting bwc serialization for elastic#77256 (elastic#77257)
  Move `index.hidden` from Static to Dynamic settings (elastic#77218)
  Handle cgroups v2 in `OsProbe` (elastic#77128)
  Choose postings format from FieldMapper instead of MappedFieldType (elastic#77234)
  Add segment sorter for data streams (elastic#75195)
  Update skip after backport (elastic#77212)
  [ML] adding new defer_definition_decompression parameter to put trained model API (elastic#77189)
  [ML] Fix bug in inference stats persister for when feature reset is called
  Only check replicas in cancelling existing recoveries. (elastic#60564)
  Format `AbstractFilteringTestCase` (elastic#77217)
  [DOCS] Fixes line breaks. (elastic#77248)
  Convert 'routing' values in REST API tests to strings
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:Clients Meta label for clients team Team:ML Meta label for the ML team v7.16.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] add new defer_definition_decompression flag for PUT trained models
6 participants