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

Backward compatability Issue with ModelName and Level for custom metrics #2772

Closed
Tracked by #1492
agunapal opened this issue Nov 7, 2023 · 1 comment
Closed
Tracked by #1492
Assignees
Labels
metrics triaged Issue has been reviewed and triaged

Comments

@agunapal
Copy link
Collaborator

agunapal commented Nov 7, 2023

🐛 Describe the bug

With 0.6.0 TorchServe, we observe the following for custom metrics

2023-11-07T21:34:24,676 [INFO ] W-9028-mnist_1.0-stdout MODEL_METRICS - ExtraInitializationTime.Milliseconds:1001.04|#ModelName:mnist,Level:Model|#hostname:ip-172-31-60-100,requestID:5348d06f-3c30-4ac0-b412-8b62b1e93a3a,timestamp:1699392864

2023-11-07T21:34:35,041 [INFO ] W-9003-mnist_1.0 org.pytorch.serve.wlm.WorkerThread - Flushing req. to backend at: 1699392875041
2023-11-07T21:34:35,042 [INFO ] W-9003-mnist_1.0-stdout MODEL_LOG - Backend received inference at: 1699392875
2023-11-07T21:34:35,053 [INFO ] W-9003-mnist_1.0-stdout MODEL_METRICS - batchSize.request:1|#ModelName:mnist,Level:Model|#hostname:ip-172-31-60-100,requestID:514b4052-0067-411b-8262-cdd127e6a83e,timestamp:1699392875

With 0.9.0 TorchServe, we observe the following

2023-10-27T10:43:07,174 - ExtraInitializationTime.ms:1000.18|#MethodName:initialize,Level:Error|#hostname:88665a372f4b.ant.amazon.com,requestID:null,timestamp:1698428587
2023-10-27T10:43:10,438 - batchSize.request:1.0|#HandlerName:MNISTDigitClassifier,MethodName:preprocess,ModelName:mnist,Level:Model|#hostname:88665a372f4b.ant.amazon.com,requestID:cd84d644-cec7-40b1-b236-48589c345d94,timestamp:1698428590

Error logs

Posted above

Installation instructions

No

Model Packaing

N/A

config.properties

No response

Versions

0.9.0

Repro instructions

N/A

Possible Solution

No response

cc @namannandan

@namannandan
Copy link
Collaborator

In versions up to 0.6.0, the request_id for model load requests are generated at random. Therefore, metrics updated in the initialize function of the handler have both ModelName and Level dimensions

serve/ts/model_loader.py

Lines 90 to 91 in 4236a86

# TODO: Request ID is not given. UUID is a temp UUID.
metrics = MetricsStore(uuid.uuid4(), model_name)

In versions 0.6.1 onward, the request_ids is not set, therefore, metrics updated in the initialize function only have the Level dimension set to Level:Error.

self.metrics_cache = MetricsCacheYamlImpl(config_file_path=metrics_config)
if self.metrics_cache:
self.metrics_cache.initialize_cache()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metrics triaged Issue has been reviewed and triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants