Skip to content

Commit c48d6f9

Browse files
committed
bugfix: fix coredump issue when both EPLB and schedule overlap are enabled.
1 parent 3330318 commit c48d6f9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

xllm/core/runtime/worker_impl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,13 @@ WorkerImpl::estimate_kv_cache_capacity_async() {
235235

236236
void WorkerImpl::update_last_step_output(
237237
const std::optional<ForwardOutput>& output) {
238-
if (output.value().sample_output.next_tokens.defined() || FLAGS_enable_eplb) {
238+
if (output.value().sample_output.next_tokens.defined()) {
239239
last_step_output_ = std::move(output.value());
240240
last_step_output_valid_ = true;
241241
} else {
242+
if(FLAGS_enable_eplb) {
243+
last_step_output_ = std::move(output.value());
244+
}
242245
last_step_output_valid_ = false;
243246
}
244247
}
@@ -281,7 +284,7 @@ void WorkerImpl::prepare_work_before_execute(const ForwardInput& inputs,
281284
is_prefill);
282285
processed_inputs.input_params.dp_ep_padding_data = dp_ep_padding.build();
283286
if (FLAGS_enable_eplb) {
284-
expert_load_data_.fill_(0);
287+
// expert_load_data_.fill_(0);
285288
processed_inputs.input_params.expert_load_data = expert_load_data_;
286289
}
287290
}
@@ -339,7 +342,7 @@ ForwardOutput WorkerImpl::get_last_step_result() {
339342
ForwardOutput output;
340343
std::unique_lock<std::mutex> lock(mtx_);
341344
cv_.wait(lock, [this] { return is_recorded_; });
342-
if (last_step_output_valid_) {
345+
if (last_step_output_valid_ || FLAGS_enable_eplb) {
343346
output = last_step_output_;
344347
}
345348
is_recorded_ = false;

0 commit comments

Comments
 (0)