Asynchronous/Synchronous Scale Workers request eventually scales up workers(min_workers) successfully even if the model was registered initially with an non existent handler!!
Context
- torchserve version: latest master
- torch version: 1.5.1
- torchvision version [if any]: NA
- torchtext version [if any]: NA
- torchaudio version [if any]: NA
- java version: JDK-11
- Operating System and version: Ubuntu 18.04 on c4.4xlarge instance
Your Environment
- Installed using source? [yes/no]: yes
- Are you planning to deploy it using docker container? [yes/no]: yes
- Is it a CPU or GPU environment?: both
- Using a default/custom handler? [If possible upload/share custom handler/model]: Non-existent/Dummy Handler
- What kind of model is it e.g. vision, text, audio?: vision
- Are you planning to use local models from model-store or public url being used e.g. from S3 bucket etc.? public url [If public url then provide link.]: (https://torchserve.s3.amazonaws.com/mar_files/mnist.mar)
- Provide config.properties, logs [ts.log] and parameters used for model registration/update APIs: ts.log test_exec.log
"{{protocol}}://{{hostname}}:{{mgmt-port}}/models/mnist?min_worker=4&synchronous=true"
- Link to your project [if any]:
Expected Behavior
Scale an already registered model with non-existent handler for some positive min_workers value. - torchserve should ideally be able to identify if the handler specified is a non-existent one and then it should not scale the workers if the handler is non existent. "{{protocol}}://{{hostname}}:{{mgmt-port}}/models/mnist?min_worker=4&synchronous=true"
Current Behavior
Scale an already registered model with non-existent handler for some positive min_workers value - Then it still allows the background workers to scale up even though the handler is non-existent.
Possible Solution
Currently Torchserve tries to scale up workers repeatedly in the background(retryCount). If we can check first that the handler is existent or not, and based on the same we should decide whether to attempt to scale the workers or not.
Steps to Reproduce
- "{{protocol}}://{{hostname}}:{{mgmt-port}}/models/mnist?min_worker=4&synchronous=true"
Failure Logs [if any]
Response code is 2XX, whereas it should be 5XX. Output of curl http://localhost:8081/models/mnist: [ { "modelName": "mnist", "modelVersion": "1.0", "modelUrl": "https://torchserve.s3.amazonaws.com/mar_files/mnist.mar", "runtime": "python", "minWorkers": 4, "maxWorkers": 4, "batchSize": 1, "maxBatchDelay": 100, "loadedAtStartup": false, "workers": [ { "id": "9000", "startTime": "2020-07-20T13:37:06.773Z", "status": "READY", "gpu": false, "memoryUsage": 0 }, { "id": "9001", "startTime": "2020-07-20T13:37:06.774Z", "status": "READY", "gpu": false, "memoryUsage": 0 }, { "id": "9002", "startTime": "2020-07-20T13:37:06.774Z", "status": "READY", "gpu": false, "memoryUsage": 0 }, { "id": "9003", "startTime": "2020-07-20T13:37:06.774Z", "status": "READY", "gpu": false, "memoryUsage": 0 } ] } ]