Skip to content

Commit 403c641

Browse files
committed
fix: guard DSpark native-SAS warning behind USE_NPU.
deepseek_v4_ori_window_left is declared in the NPU-only npu_torch/deepseek_sparse_attention.h, whose include is already USE_NPU gated, but the warning that calls it in DFlashWorkerImpl::init_model sat outside any guard, breaking the MLU and CUDA builds. Wrap the native-SAS warning in #if defined(USE_NPU).
1 parent 0f5047b commit 403c641

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

xllm/core/runtime/dflash_worker_impl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ bool DFlashWorkerImpl::init_model(const std::string& model_weights_path,
359359
<< (draft_args.dspark_use_native_sas()
360360
? "native explicit indices"
361361
: "CANN 9.0-compatible q_len=1 fallback");
362+
#if defined(USE_NPU)
362363
if (draft_args.dspark_use_native_sas()) {
363364
LOG(WARNING)
364365
<< "Native DeepSeek-V4 DSpark SAS requires an operator that "
@@ -369,6 +370,7 @@ bool DFlashWorkerImpl::init_model(const std::string& model_weights_path,
369370
/*use_native_dspark_sas=*/true)
370371
<< ".";
371372
}
373+
#endif
372374
// Keep the trained mtp.0.embed and mtp.<last>.head modules loaded by
373375
// DeepseekV4DSparkForCausalLMImpl. Sharing the target modules here makes
374376
// the draft backbone/Markov head project through the wrong vocabulary

0 commit comments

Comments
 (0)