Skip to content

Commit de9503f

Browse files
committed
Enable continuous batching in python package
1 parent 66d9e7d commit de9503f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/continuous_batching_cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
3838
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
3939
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
40-
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONTINUOUS_BATCHING=ON -DENABLE_APPS=ON -S ./ -B ./build/
40+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONTINUOUS_BATCHING=ON -DENABLE_APPS=ON -DENABLE_PYTHON=ON -S ./ -B ./build/
4141
cmake --build ./build/ --config Release -j
4242
- name: Run gtests
4343
run: |

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ find_python3 = true
3333
build_args = ["--parallel", "--target", "py_generate_pipeline"]
3434
install_args = ["--strip"]
3535
install_components = ["wheel_genai"]
36+
options = { "ENABLE_CONTINUOUS_BATCHING" = "ON" }
3637

3738
[build-system]
3839
requires = [

src/python/CMakeLists.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ install(TARGETS openvino_genai py_generate_pipeline
9090
if(ENABLE_CONTINUOUS_BATCHING)
9191
pybind11_add_module(py_continuous_batching python.cpp)
9292
target_link_libraries(py_continuous_batching PRIVATE openvino::continuous_batching)
93-
set_target_properties(py_continuous_batching PROPERTIES
94-
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai>")
93+
set_target_properties(py_continuous_batching PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai>")
94+
95+
# wheel_genai component is used for wheel generation in pyproject.toml.
96+
# Exclude wheel_genai from normal packaging because there's pygenai_X_Y component for that.
97+
install(TARGETS openvino_genai py_continuous_batching
98+
LIBRARY DESTINATION openvino_genai COMPONENT wheel_genai EXCLUDE_FROM_ALL
99+
RUNTIME DESTINATION openvino_genai COMPONENT wheel_genai EXCLUDE_FROM_ALL)
95100
endif()

0 commit comments

Comments
 (0)