Skip to content

Commit 9114927

Browse files
committed
ov-master-rebase: vision model divide-by-zero and tokenizer DLL loading in build-master
Two runtime bugs fixed for build-master (ENABLE_NEW_ARCH_OPS=OFF): 1. Vision model INT4 quantization (divide-by-zero crash): The shared SafetensorsWeightFinalizer applied INT4_ASYM quantization to both text and vision models. Vision encoder weights must NOT be quantized - INT4 weights cause STATUS_INTEGER_DIVIDE_BY_ZERO (0xC0000094) in the CPU plugin during vision inference. Fix: use a separate non-quantizing finalizer for create_qwen3_omni_vision_model. 2. Tokenizer DLL not found (core.cpp:193 exception): The tokenizers_dll_name CMake variable was only defined inside the if(ENABLE_NEW_ARCH_OPS) guard block. When ENABLE_NEW_ARCH_OPS=OFF, the post-build copy for the always-built targets (modeling_qwen3_omni, modeling_qwen3_omni_tts_min) used an empty variable, so openvino_tokenizers.dll was never copied next to the exe. Fix: define tokenizers_dll_name before the always-built targets section.
1 parent f45b4dd commit 9114927

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/cpp/src/modeling/samples/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ set_target_properties(modeling_qwen3_vl PROPERTIES
4848

4949
endif() # ENABLE_NEW_ARCH_OPS -- modeling_qwen3_vl
5050

51+
# ── Tokenizer library name (needed for post-build copy on all targets) ──
52+
if(NOT tokenizers_dll_name)
53+
if(WIN32)
54+
set(tokenizers_dll_name "openvino_tokenizers$<$<CONFIG:Debug>:d>.dll")
55+
elseif(APPLE)
56+
set(tokenizers_dll_name "libopenvino_tokenizers$<$<CONFIG:Debug>:d>.dylib")
57+
else()
58+
set(tokenizers_dll_name "libopenvino_tokenizers$<$<CONFIG:Debug>:d>.so")
59+
endif()
60+
endif()
61+
5162
# ── Always-built targets (needed for build-master too) ──
5263

5364
add_executable(modeling_qwen3_omni

src/cpp/src/modeling/samples/modeling_qwen3_omni.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,19 @@ int main(int argc, char* argv[]) try {
688688
ov::genai::safetensors::SafetensorsWeightSource source(std::move(data));
689689
ov::genai::safetensors::SafetensorsWeightFinalizer finalizer(quant_config);
690690

691+
// Vision model must NOT be quantized — INT4/INT8 weights cause divide-by-zero
692+
// in the CPU plugin during vision inference.
693+
ov::genai::modeling::weights::QuantizationConfig no_quant;
694+
ov::genai::safetensors::SafetensorsWeightFinalizer vision_finalizer(no_quant);
695+
691696
auto text_model = ov::genai::modeling::models::create_qwen3_omni_text_model(
692697
omni_cfg,
693698
source,
694699
finalizer,
695700
false,
696701
true);
697702

698-
auto vision_model = ov::genai::modeling::models::create_qwen3_omni_vision_model(omni_cfg, source, finalizer);
703+
auto vision_model = ov::genai::modeling::models::create_qwen3_omni_vision_model(omni_cfg, source, vision_finalizer);
699704

700705
if (precision_mode == PrecisionMode::kFP32 ||
701706
precision_mode == PrecisionMode::kInfFp32KvInt8 ||

0 commit comments

Comments
 (0)