From e87830ef0ae83f37a25155791113317df5b6c975 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Wed, 8 Nov 2023 08:08:40 -0500 Subject: [PATCH] container: update tracing dependencies (#591) * chore: update build message Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * chore: add tracing dependencies to container Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- openllm-python/src/openllm/bundle/_package.py | 4 ++-- openllm-python/src/openllm/cli/_factory.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openllm-python/src/openllm/bundle/_package.py b/openllm-python/src/openllm/bundle/_package.py index 5b6ba480..42c07297 100644 --- a/openllm-python/src/openllm/bundle/_package.py +++ b/openllm-python/src/openllm/bundle/_package.py @@ -63,7 +63,7 @@ def build_editable(path: str, package: t.Literal['openllm', 'openllm_core', 'ope return builder.build('wheel', path, config_settings={'--global-option': '--quiet'}) raise RuntimeError('Custom OpenLLM build is currently not supported. Please install OpenLLM from PyPI or built it from Git source.') -def construct_python_options(llm: openllm.LLM[t.Any, t.Any], llm_fs: FS, extra_dependencies: tuple[str, ...] | None = None, adapter_map: dict[str, str] | None = None,) -> PythonOptions: +def construct_python_options(llm: openllm.LLM[t.Any, t.Any], llm_fs: FS, extra_dependencies: tuple[str, ...] | None = None, adapter_map: dict[str, str] | None = None) -> PythonOptions: packages = ['openllm', 'scipy'] # apparently bnb misses this one if adapter_map is not None: packages += ['openllm[fine-tune]'] # NOTE: add openllm to the default dependencies @@ -81,7 +81,7 @@ def construct_python_options(llm: openllm.LLM[t.Any, t.Any], llm_fs: FS, extra_d env['backend_value'] if not openllm_core.utils.is_torch_available(): raise ValueError('PyTorch is not available. Make sure to have it locally installed.') - packages.extend(['torch==2.0.1+cu118', 'vllm==0.2.1.post1', 'xformers==0.0.22']) # XXX: Currently locking this for correctness + packages.extend(['torch==2.0.1+cu118', 'vllm==0.2.1.post1', 'xformers==0.0.22', 'bentoml[tracing]==1.1.9']) # XXX: Currently locking this for correctness wheels: list[str] = [] built_wheels = [build_editable(llm_fs.getsyspath('/'), t.cast(t.Literal['openllm', 'openllm_core', 'openllm_client'], p)) for p in ('openllm_core', 'openllm_client', 'openllm')] if all(i for i in built_wheels): diff --git a/openllm-python/src/openllm/cli/_factory.py b/openllm-python/src/openllm/cli/_factory.py index 28cbb124..f3e4b56c 100644 --- a/openllm-python/src/openllm/cli/_factory.py +++ b/openllm-python/src/openllm/cli/_factory.py @@ -200,6 +200,8 @@ Available official model_id(s): [default: {llm_config['default_id']}] def next_step(model_name: str, adapter_map: DictStrAny | None) -> None: cmd_name = f'openllm build {model_name}' if not llm._local: cmd_name += f' --model-id {llm.model_id}' + if llm._quantise: cmd_name += f' --quantize {llm._quantise}' + cmd_name += f' --serialization {_serialisation}' if adapter_map is not None: cmd_name += ' ' + ' '.join([f'--adapter-id {s}' for s in [f'{p}:{name}' if name not in (None, 'default') else p for p, name in adapter_map.items()]]) if not openllm.utils.get_quiet_mode(): @@ -212,10 +214,9 @@ Available official model_id(s): [default: {llm_config['default_id']}] else: try: server.start(env=start_env, text=True, blocking=True) - except KeyboardInterrupt: - next_step(model, adapter_map) except Exception as err: termui.echo(f'Error caught while running LLM Server:\n{err}', fg='red') + raise else: next_step(model, adapter_map)