Skip to content

fix(perf): stop open-loop dispatch at duration deadline - #1501

Merged
Yunnglin merged 2 commits into
modelscope:mainfrom
YingchaoX:fix/open-loop-duration-deadline
Jul 21, 2026
Merged

Yunnglin merged 2 commits into
modelscope:mainfrom
YingchaoX:fix/open-loop-duration-deadline

Conversation

@YingchaoX

Copy link
Copy Markdown
Contributor

Summary

Fix open-loop scheduling so no new request is dispatched after the --duration deadline.

The fix covers both:

  • regular Poisson open-loop scheduling
  • workload_trace arrival-offset scheduling

Problem

The scheduler caps its sleep to the remaining time before the deadline. However, after the sleep returns, it previously created the request task without checking the deadline again.

As a result, a request scheduled beyond the duration limit could still be dispatched exactly when the deadline was reached.

This conflicts with the documented soft-exit behavior: new requests should stop at the deadline, while requests already in flight are allowed to finish.

Changes

  • Re-check the deadline after the scheduling sleep and before creating a request task.
  • Preserve the existing warmup and in-flight request behavior.
  • Add parameterized regression coverage for both trace-based and Poisson scheduling.

Scope

This is intentionally a narrow scheduler fix.

It does not change:

  • CLI arguments or configuration
  • arrival schedule calculation
  • warmup behavior
  • completion of already in-flight requests

Testing

  • pytest tests/perf/test_open_loop_strategy.py -q
  • pytest tests/cli/test_all.py::TestRun::test_ci_lite -v -s -p no:warnings
  • pre-commit run --all-files

All checks passed.

Related Issues

Fixes #1500.

Related to #1494.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds duration deadline checks to the open-loop performance strategy to stop dispatching requests once the deadline is reached, and includes a unit test to verify this behavior. The review feedback points out that the newly added checks introduce redundancy with existing pre-sleep checks, and suggests removing the redundant pre-sleep checks to simplify the code.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread evalscope/perf/core/strategies/open_loop.py
Comment thread evalscope/perf/core/strategies/open_loop.py

@Yunnglin Yunnglin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yunnglin
Yunnglin merged commit 1320364 into modelscope:main Jul 21, 2026
4 of 5 checks passed

This branch had an error being deployed

1 failed deployment
qoder-review — 8832c565 Deployed Jul 21, 2026 by YingchaoX via qoder-review-external #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open-loop mode dispatches one extra request after the --duration deadline

2 participants