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

Lower minimum model memory limit value from 1MB to 1kB. #49227

Merged

Conversation

przemekwitek
Copy link
Contributor

@przemekwitek przemekwitek commented Nov 18, 2019

This PR lowers the minimum model memory limit from 1MB to 1kB.

Relates #49168

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

Given what the C++ does - see https://github.com/elastic/ml-cpp/pull/584/files#diff-8c1b056d827cb41f2dbd4a97a5e202deR59 - it might be better to change DataFrameAnalyticsConfig.MIN_MODEL_MEMORY_LIMIT to 1kb instead of messing with the estimates in the "estimate" action. If we cap at 1mb here then there is no point in the C++ outputting values that are less than a kilobyte.

I am pretty sure we once discussed whether model memory limits for data frame analytics jobs should be whole numbers of megabytes like they are for anomaly detection jobs. I cannot find the whole discussion now. It was touched on in elastic/ml-cpp#584 (comment), but I think there was a bigger discussion somewhere where there was a desire to allow model memory limits less than a megabyte for really small jobs.

Changing the min model memory limit to 1kb might have side other effects though, so please check how it's used throughout the code.

@przemekwitek
Copy link
Contributor Author

Given what the C++ does - see https://github.com/elastic/ml-cpp/pull/584/files#diff-8c1b056d827cb41f2dbd4a97a5e202deR59 - it might be better to change DataFrameAnalyticsConfig.MIN_MODEL_MEMORY_LIMIT to 1kb instead of messing with the estimates in the "estimate" action. If we cap at 1mb here then there is no point in the C++ outputting values that are less than a kilobyte.

I didn't want to change C++ as it's not the layer that has the knowledge of this minimum memory limit.

I am pretty sure we once discussed whether model memory limits for data frame analytics jobs should be whole numbers of megabytes like they are for anomaly detection jobs. I cannot find the whole discussion now. It was touched on in elastic/ml-cpp#584 (comment), but I think there was a bigger discussion somewhere where there was a desire to allow model memory limits less than a megabyte for really small jobs.

I'm all for lowering the limit to 1kB. Having said that, I don't remember the outcome of the discussion you are referring to so I may be missing some context.

Changing the min model memory limit to 1kb might have side other effects though, so please check how it's used throughout the code.

The minimum limit of 1MB is only used during config creation to reject configs for which the limit is set lower.
Looking at where the DataFrameAnalyticsConfig.getModelMemoryLimit() is used, I cannot see a direct threat to jobs functioning.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

Code LGTM, but please can you change the PR title and description before merging

@przemekwitek przemekwitek changed the title Respect minimum model memory limit when returning memory usage estimation Lower minimum model memory limit value from 1MB to 1kB. Nov 18, 2019
@przemekwitek
Copy link
Contributor Author

Code LGTM, but please can you change the PR title and description before merging

Done.

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