From 44f49227cd989d77275e900497a8555705404306 Mon Sep 17 00:00:00 2001 From: Jeongkyu Shin Date: Wed, 29 Jul 2026 00:03:48 +0900 Subject: [PATCH] fix(multimodal): gate the Qwen2-VL prefill export on the feature that calls it `export_qwen2_vl_prefill` was imported and defined unconditionally, but its only non-test call site sits inside `#[cfg(feature = "xla-iree")]`. The pipeline-parallel workflow runs `cargo clippy -p mlxcel --lib --tests -- -D warnings` with no features, so that call site compiles out, the import goes unused and the function goes dead, and `-D warnings` turns both into errors. The job fails on every PR that touches the pipeline-parallel paths, regardless of what the PR changes. The gate now matches the call site, plus `test` because the module tests exercise the function irrespective of features. Verified by reproducing the exact CI invocation locally: it failed with the two errors before the change and compiles clean after, while `clippy --release --lib --tests --features metal,accelerate` stays clean and the Qwen2-VL export tests still pass. This went unnoticed because the workflow is path-filtered to the pipeline-parallel modules and last ran on 2026-07-20, while the unconditional import arrived on 2026-07-24 in `edc0ebbb6`. --- src/multimodal/host_preprocessor.rs | 10 +++++++--- src/multimodal/host_preprocessor_export.rs | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) 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,