Skip to content

Commit

Permalink
[ML] Hide inference stats for PyTorch models (#160599)
Browse files Browse the repository at this point in the history
## Summary

Resolves #157385

Hides inference stats for the PyTorch models. 

- The salient information (`inference_count`, `timestamp`) is a repeat
of what is already displayed in the Deployment Stats section.
- `missing_all_fields_count` is confusing as the PyTorch models take a
single input field rather than multiple fields as DFA models do, hence
omitted.
- The deployment stats have an
[error_count](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html)
field, hence it has been added to the Deployment Stats and
`failure_count` has been removed.
- Displays the stats tab by default for expanded rows if the model has
started deployments
  • Loading branch information
darnautov authored Jun 28, 2023
1 parent 6db22e3 commit 4064e2b
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ export const ELASTIC_MODEL_DEFINITIONS = {

export const MODEL_STATE = {
...DEPLOYMENT_STATE,
DOWNLOADING: i18n.translate('xpack.ml.trainedModels.modelsList.downloadingStateLabel', {
defaultMessage: 'downloading',
}),
DOWNLOADED: i18n.translate('xpack.ml.trainedModels.modelsList.downloadedStateLabel', {
defaultMessage: 'downloaded',
}),
DOWNLOADING: 'downloading',
DOWNLOADED: 'downloaded',
} as const;

export type ModelState = typeof MODEL_STATE[keyof typeof MODEL_STATE];
export type ModelState = typeof MODEL_STATE[keyof typeof MODEL_STATE] | null;
1 change: 1 addition & 0 deletions x-pack/plugins/ml/common/types/trained_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export interface AllocatedModel {
throughput_last_minute: number;
number_of_allocations: number;
threads_per_allocation: number;
error_count?: number;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
return v.node.number_of_pending_requests;
},
},
{
name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.errorCountHeader', {
defaultMessage: 'Errors',
}),
width: '60px',
'data-test-subj': 'mlAllocatedModelsTableErrorCount',
render: (v: AllocatedModel) => {
return v.node.error_count ?? 0;
},
},
].filter((v) => !hideColumns.includes(v.id!));

return (
Expand Down
Loading

0 comments on commit 4064e2b

Please sign in to comment.