Skip to content

Commit 314537f

Browse files
committed
Fix in 'num_requests_running' calculation
1 parent 47adbd2 commit 314537f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/vllm-sim/simulator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,12 @@ func (s *VllmSimulator) reqProcessingWorker(ctx context.Context, id int) {
317317

318318
// decrease model usage reference number
319319
func (s *VllmSimulator) responseSentCallback(model string) {
320+
321+
atomic.AddInt64(&(s.nRunningReqs), -1)
322+
s.reportRequests()
323+
320324
if model == s.model {
321-
// this is base model - do nothing
325+
// this is base model - do not continue
322326
return
323327
}
324328

@@ -341,8 +345,6 @@ func (s *VllmSimulator) responseSentCallback(model string) {
341345

342346
s.reportLoras()
343347

344-
atomic.AddInt64(&(s.nRunningReqs), -1)
345-
s.reportRequests()
346348
}
347349

348350
// sendCompletionError sends an error response for the curent completion request

0 commit comments

Comments
 (0)