Skip to content

Commit 984b0e3

Browse files
committed
qwen-3.5-native sample applicaton based on modeling api and IR format only.
/build/samples/cpp/module_genai/md_qwen3_5_modeling \ --model ~/work/openvino.genai.modular-ws/openvino-new-arch/Qwen3.5-35B-A3B-Base_VL_OV_IR \ --mode text --prompt "how to run Qwen3.5 with pytorch" --device GPU.1 [quant] suffix: _q4a_b4a_g128 [info] Text IR not found; falling back to VL text IR with zero visual inputs: "/home/xzhan34/work/openvino.genai.modular-ws/openvino-new-arch/Qwen3.5-35B-A3B-Base_VL_OV_IR/qwen3_5_text_vl_q4a_b4a_g128.xml" [load] text IR: "/home/xzhan34/work/openvino.genai.modular-ws/openvino-new-arch/Qwen3.5-35B-A3B-Base_VL_OV_IR/qwen3_5_text_vl_q4a_b4a_g128.xml" [compile] text -> GPU.1 Failed to infer a tool call example (possible template bug) Mode: hf / text Prompt token size: 11 Output token size: 64 TTFT: 3931.08 ms Decode time: 253332.33 ms TPOT: 4021.15 ms/token Throughput: 0.25 tokens/s It looks like there might be a typo in your request, as the latest official release is **Qwen2.5**. Signed-off-by: Zhang, Xiaolin <xiaolin.zhang@intel.com>
1 parent add8ce5 commit 984b0e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+10613
-5
lines changed

cmake/yaml-cpp.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,11 @@ else()
6666
set(YAML_CPP_INCLUDE_DIRS ${yaml-cpp_SOURCE_DIR}/include CACHE PATH "yaml-cpp include directories" FORCE)
6767
set(YAML_CPP_FETCHED TRUE CACHE BOOL "yaml-cpp was fetched from GitHub" FORCE)
6868

69+
install(TARGETS yaml-cpp EXPORT OpenVINOGenAITargets
70+
RUNTIME DESTINATION bin
71+
LIBRARY DESTINATION lib
72+
ARCHIVE DESTINATION lib
73+
)
74+
6975
message(STATUS "yaml-cpp fetched and built from source (version 0.8.0)")
7076
endif()

samples/cpp/module_genai/CMakeLists.txt

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,58 @@ if(POLICY CMP0135)
4646
cmake_policy(SET CMP0135 NEW)
4747
endif()
4848

49-
add_subdirectory(comfyui)
49+
add_subdirectory(comfyui)
50+
51+
# ---------------------------------------------------------------------------
52+
# md_qwen3_5_modeling: load Qwen3.5 from pre-built OV IR files and run inference.
53+
# Only built when included as part of the OpenVINOGenAI source tree
54+
# (requires access to openvino_genai_obj and internal headers).
55+
# ---------------------------------------------------------------------------
56+
if(TARGET openvino_genai_obj)
57+
add_executable(md_qwen3_5_modeling
58+
md_qwen3_5_modeling.cpp
59+
utils/utils.cpp
60+
utils/vision_utils.cpp
61+
$<TARGET_OBJECTS:openvino_genai_obj>)
62+
63+
target_include_directories(md_qwen3_5_modeling PRIVATE
64+
"${CMAKE_CURRENT_SOURCE_DIR}"
65+
"${OpenVINOGenAI_SOURCE_DIR}/src/cpp/src"
66+
$<TARGET_PROPERTY:openvino::genai,INTERFACE_INCLUDE_DIRECTORIES>
67+
$<TARGET_PROPERTY:nlohmann_json::nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>)
68+
69+
target_link_libraries(md_qwen3_5_modeling PRIVATE
70+
$<TARGET_PROPERTY:openvino_genai_obj,LINK_LIBRARIES>
71+
${OpenCV_LIBS})
72+
73+
target_compile_definitions(md_qwen3_5_modeling PRIVATE
74+
openvino_genai_EXPORTS)
75+
76+
add_dependencies(md_qwen3_5_modeling openvino_genai)
77+
78+
if(WIN32)
79+
set(tokenizers_dll_name_qwen "openvino_tokenizers$<$<CONFIG:Debug>:d>.dll")
80+
elseif(APPLE)
81+
set(tokenizers_dll_name_qwen "libopenvino_tokenizers$<$<CONFIG:Debug>:d>.dylib")
82+
else()
83+
set(tokenizers_dll_name_qwen "libopenvino_tokenizers$<$<CONFIG:Debug>:d>.so")
84+
endif()
85+
86+
add_custom_command(TARGET md_qwen3_5_modeling POST_BUILD
87+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
88+
"$<TARGET_FILE_DIR:openvino_genai>/${tokenizers_dll_name_qwen}"
89+
"$<TARGET_FILE_DIR:md_qwen3_5_modeling>"
90+
VERBATIM)
91+
92+
set_target_properties(md_qwen3_5_modeling PROPERTIES
93+
INSTALL_RPATH_USE_LINK_PATH ON)
94+
95+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
96+
target_compile_options(md_qwen3_5_modeling PRIVATE "/bigobj" "/utf-8")
97+
endif()
98+
99+
install(TARGETS md_qwen3_5_modeling
100+
RUNTIME DESTINATION samples_bin/
101+
COMPONENT samples_bin
102+
EXCLUDE_FROM_ALL)
103+
endif()

samples/cpp/module_genai/comfyui/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ project($TARGET_NAME)
66

77
find_package(OpenVINO REQUIRED)
88
find_package(OpenVINOGenAI REQUIRED)
9-
find_package(yaml-cpp REQUIRED)
9+
10+
# yaml-cpp dependency (reuse parent target or resolve via centralized helper)
11+
if(NOT DEFINED YAML_CPP_TARGET)
12+
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/yaml-cpp.cmake)
13+
endif()
1014

1115
add_executable(${TARGET_NAME}
1216
main.cpp
@@ -21,6 +25,7 @@ target_include_directories(${TARGET_NAME} PRIVATE
2125
target_link_libraries(${TARGET_NAME} PRIVATE
2226
openvino::genai
2327
${OpenCV_LIBS}
28+
${YAML_CPP_TARGET}
2429
)
2530

2631
install(TARGETS ${TARGET_NAME}

0 commit comments

Comments
 (0)