Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions server/src/common/backend_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,10 @@ std::unique_ptr<ModelBackend> create_backend(const BackendArgs & args) {
return backend;

} else if (arch == "deepseek4") {
const PlacementBackend target_backend =
args.device.backend == PlacementBackend::Auto
? compiled_placement_backend()
: args.device.backend;

// HIP single-device launches cannot rely on the CUDA/Halo auto-split
// path; use the single-backend loader, which can fall back to hybrid
// expert placement when a full monolithic load does not fit.
if (target_backend == PlacementBackend::Hip &&
!args.device.is_layer_split() &&
// A single local device uses the monolithic backend. Reserve the
// layer-split adapter for explicit multi-device placement or remote
// target shards.
if (!args.device.is_layer_split() &&
!args.remote_target_shard.enabled()) {
DeepSeek4BackendConfig cfg;
cfg.model_path = args.model_path;
Expand All @@ -241,8 +235,7 @@ std::unique_ptr<ModelBackend> create_backend(const BackendArgs & args) {
return backend;
}

// CUDA builds keep the layer-split backend so they can auto-split
// across CUDA and remote HIP target shards.
// Explicit local splits and CUDA/HIP remote splits use the adapter.
DeepSeek4LayerSplitAdapterConfig cfg;
cfg.target_path = args.model_path;
cfg.device = args.device;
Expand Down