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

Improve configuration handling with KServe #2994

Closed
sgaist opened this issue Mar 2, 2024 · 0 comments · Fixed by #2995
Closed

Improve configuration handling with KServe #2994

sgaist opened this issue Mar 2, 2024 · 0 comments · Fixed by #2995
Labels
enhancement New feature or request kfserving
Milestone

Comments

@sgaist
Copy link
Contributor

sgaist commented Mar 2, 2024

🐛 Describe the bug

The current implementation of the configuration file loading when using the KServe wrapper is sub-optimal.

Based on the content of the __main__.py file, there are several defaults values that are in use however, if any of the corresponding keys are missing from the configuration file, a KeyError will get triggered and thus the execution will never reach the default value handling code.

The configuration loading also does not ignore lines starting with # as the file format defines.

Error logs

INFO:root:Wrapper: loading configuration from ts-config.conf
Traceback (most recent call last):
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 103, in
) = parse_config()
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 46, in parse_config
keys["model_snapshot"] = json.loads(keys["model_snapshot"])
KeyError: 'model_snapshot'

Installation instructions

Installed torchserve from sources

Model Packaing

Using the mnist example

config.properties

enable_envvars_config=true

Versions


Environment headers

Torchserve branch:

torchserve==0.9.0
torch-model-archiver==0.9.0b20240224

Python version: 3.10 (64-bit runtime)
Python executable: /Users/home/miniconda3/envs/pytorch-serve-dev/bin/python

Versions of relevant python libraries:
captum==0.6.0
numpy==1.24.3
pillow==10.2.0
psutil==5.9.8
pygit2==1.13.3
pylint==3.0.3
pytest==7.3.1
pytest-cov==4.1.0
pytest-mock==3.12.0
requests==2.31.0
requests-oauthlib==1.3.1
requests-toolbelt==1.0.0
torch==2.2.1
torch-model-archiver==0.9.0b20240224
torch-workflow-archiver==0.2.11b20240224
torchaudio==2.2.1
torchdata==0.7.1
torchpippy==0.1.1
torchserve==0.9.0
torchtext==0.17.1
torchvision==0.17.1
transformers==4.38.1
wheel==0.42.0
torch==2.2.1
torchtext==0.17.1
torchvision==0.17.1
torchaudio==2.2.1

Java Version:

OS: Mac OSX 13.6.4 (arm64)
GCC version: N/A
Clang version: 15.0.0 (clang-1500.1.0.2.5)
CMake version: version 3.28.3

Versions of npm installed packages:
**Warning: newman, newman-reporter-html markdown-link-check not installed...

Repro instructions

Follow the mnist example and start torchserve

Create the properties file

Start the kserve wrapper

 CONFIG_PATH=./ts-config.conf python3 kubernetes/kserve/kserve_wrapper/__main__.py

Possible Solution

For the default part, refactor the properties handling so that if a key is missing, the default value is used.

For the # add a check for that character before handling the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kfserving
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants