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

Revert Revert "[ML] Use perAllocation and perDeployment memory usage in the model assignment planner" #101853

Merged
merged 6 commits into from
Nov 7, 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 @@ -130,12 +130,14 @@ private void waitForDeploymentStarted(String modelId) throws Exception {

@SuppressWarnings("unchecked")
private void assertOldMemoryFormat(String modelId) throws Exception {
// There was a change in the MEMORY_OVERHEAD value in 8.3.0, see #86416
long memoryOverheadMb = Version.fromString(UPGRADE_FROM_VERSION).onOrBefore(Version.V_8_3_0) ? 270 : 240;
valeriy42 marked this conversation as resolved.
Show resolved Hide resolved
var response = getTrainedModelStats(modelId);
Map<String, Object> map = entityAsMap(response);
List<Map<String, Object>> stats = (List<Map<String, Object>>) map.get("trained_model_stats");
assertThat(stats, hasSize(1));
var stat = stats.get(0);
Long expectedMemoryUsage = ByteSizeValue.ofMb(240).getBytes() + RAW_MODEL_SIZE * 2;
Long expectedMemoryUsage = ByteSizeValue.ofMb(memoryOverheadMb).getBytes() + RAW_MODEL_SIZE * 2;
Integer actualMemoryUsage = (Integer) XContentMapValues.extractValue("model_size_stats.required_native_memory_bytes", stat);
assertThat(
Strings.format("Memory usage mismatch for the model %s in cluster state %s", modelId, CLUSTER_TYPE.toString()),
Expand Down