diff --git a/src/multimodal/host_preprocessor.rs b/src/multimodal/host_preprocessor.rs index bfad9cb9d..a4024cfd8 100644 --- a/src/multimodal/host_preprocessor.rs +++ b/src/multimodal/host_preprocessor.rs @@ -44,10 +44,14 @@ mod export; use super::qwen_vl::insert_qwen_vl_image_tokens; use export::export_mlx_tensor; use export::{ - build_prepared_prefill, export_llava_prefill, export_qwen2_vl_prefill, usize_to_i32, - validate_embedding_shape, validate_processor_shape, validate_projected_shape, - validate_sequence_capacity, + build_prepared_prefill, export_llava_prefill, usize_to_i32, validate_embedding_shape, + validate_processor_shape, validate_projected_shape, validate_sequence_capacity, }; +// Only the `xla-iree` Qwen2-VL prefill path calls this, so importing it +// unconditionally leaves it unused in a default-feature build and `-D warnings` +// turns that into a hard error. The gate has to match the single call site. +#[cfg(any(feature = "xla-iree", test))] +use export::export_qwen2_vl_prefill; /// Vision implementation selected for OpenXLA multimodal preprocessing. #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/src/multimodal/host_preprocessor_export.rs b/src/multimodal/host_preprocessor_export.rs index e50c288f1..061d497ef 100644 --- a/src/multimodal/host_preprocessor_export.rs +++ b/src/multimodal/host_preprocessor_export.rs @@ -151,6 +151,11 @@ pub(super) fn export_llava_prefill( ) } +// Reachable in production only from the `xla-iree` Qwen2-VL prefill path, and +// exercised by the module tests regardless, so the gate carries `test` too. +// Without it a default-feature `cargo clippy --lib -- -D warnings` fails the +// build on `function is never used`. +#[cfg(any(feature = "xla-iree", test))] pub(super) fn export_qwen2_vl_prefill( logical_tokens: Vec, merged: InputEmbeddings,