Skip to content

Constraints refactor - #786

Merged
mergify[bot] merged 7 commits into
vllm-project:mainfrom
jaredoconnell:feat/constraints-refactor
Jun 11, 2026
Merged

Constraints refactor#786
mergify[bot] merged 7 commits into
vllm-project:mainfrom
jaredoconnell:feat/constraints-refactor

Conversation

@jaredoconnell

@jaredoconnell jaredoconnell commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Uses a new format with a kind discriminator and separate args classes. Includes translation layer for the old CLI format to use the new constraints format.

Details

  • For the CLI refactor
  • Does not expose the new format to the CLI yet. That will be a part of the refactor.
  • As discussed, I removed aliases for the constraints. We can discuss if I chose the right option for each. I chose max_duration instead of max_seconds since it's more generic and with the follow up refactor we can do --constraint kind=max_duration,seconds=120, which would enable --constraint kind=max_duration,minutes=2, or in the new format --constraint max_duration seconds=120

Test Plan

  • Run the tests
  • Run benchmarks as usual

Related Issues


  • "I certify that all code in this PR is my own, except as noted below."

Use of AI

  • Includes code generated or substantially modified by an AI agent
  • Includes tests generated or substantially modified by an AI agent

NOTE: the Generated-by or Assisted-by trailers should be used in git commit messages when code or tests were generated or substantially modified by an AI agent, as described in the project's DEVELOPING.md file.


git log

commit d6a2313
Author: Jared O'Connell joconnel@redhat.com
Date: Tue Jun 9 14:22:47 2026 -0400

Refactor constraints

Uses a new format with a kind discriminator and separate args classes.
Includes translation layer for the old CLI format to use the new constraints format.

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit 04c6960
Author: Jared O'Connell joconnel@redhat.com
Date: Tue Jun 9 15:57:43 2026 -0400

Remove constraint aliases

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit 03046f3
Author: Jared O'Connell joconnel@redhat.com
Date: Wed Jun 10 11:56:26 2026 -0400

Address review comments

Remove old create method, remove unnecessary comments, and remove unnecessary static function.

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit 1e73fca
Author: Jared O'Connell joconnel@redhat.com
Date: Wed Jun 10 13:11:01 2026 -0400

Simplify constraints code paths and fix tests and CI

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit f813642
Author: Jared O'Connell joconnel@redhat.com
Date: Wed Jun 10 13:26:28 2026 -0400

Fix unit tests

Generated-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit f89bd7b
Author: Jared O'Connell joconnel@redhat.com
Date: Wed Jun 10 17:51:12 2026 -0400

Remove legacy pathways and replace "enabled" for oversaturation constraint

Generated-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>

commit 05ca95f
Author: Jared O'Connell joconnel@redhat.com
Date: Wed Jun 10 17:54:39 2026 -0400

Address review comments

Signed-off-by: Jared O'Connell <joconnel@redhat.com>

Assisted-by: Cursor AI Claude Opus 4.6
Generated-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell joconnel@redhat.com

@jaredoconnell jaredoconnell changed the title Feat/constraints refactor Constraints refactor Jun 9, 2026
@sjmonson
sjmonson self-requested a review June 9, 2026 20:44

@dbutenhof dbutenhof 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.

A few comments on a very quick first pass ... I'll delve deeper tomorrow morning.

Comment thread src/guidellm/scheduler/constraints/args.py Outdated
Comment thread src/guidellm/scheduler/constraints/factory.py Outdated
Comment thread src/guidellm/scheduler/constraints/factory.py Outdated

@sjmonson sjmonson 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.

The original constraint code is a little overengineered so it would not hurt to clean up a bit here.

Comment thread src/guidellm/scheduler/constraints/saturation.py Outdated
Comment thread src/guidellm/scheduler/constraints/factory.py Outdated
Comment thread src/guidellm/scheduler/constraints/factory.py Outdated
Comment thread src/guidellm/scheduler/constraints/error.py Outdated
Comment thread src/guidellm/scheduler/constraints/request.py
Uses a new format with a kind discriminator and separate args classes.
Includes translation layer for the old CLI format to use the new constraints format.

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Remove old create method, remove unnecessary comments, and remove unnecessary static function.

Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Assisted-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Generated-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
@jaredoconnell
jaredoconnell force-pushed the feat/constraints-refactor branch from 14f5a45 to f813642 Compare June 10, 2026 17:44
@jaredoconnell

Copy link
Copy Markdown
Collaborator Author

This is now rebased and ready for ew-review.

Comment thread src/guidellm/scheduler/constraints/factory.py Outdated
Comment thread src/guidellm/scheduler/constraints/factory.py Outdated
…raint

Generated-by: Cursor AI Claude Opus 4.6
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
@jaredoconnell
jaredoconnell force-pushed the feat/constraints-refactor branch from e0debc9 to 05ca95f Compare June 10, 2026 22:01

@dbutenhof dbutenhof 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.

This is now rebased and ready for ew-review.

Ew ... 😆

@sjmonson sjmonson 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.

Looks good. Tested locally with a bunch of constraints and all seem to work.

@mergify

mergify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-06-11 18:12 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-06-11 18:13 UTC · at 05ca95fdf8bd251cee3d4431e338331e580d2969 · squash

This pull request spent 16 seconds in the queue, including 4 seconds running CI.

Required conditions to merge
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = quality (3.10) / type-checks
    • check-neutral = quality (3.10) / type-checks
    • check-skipped = quality (3.10) / type-checks
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = quality (3.10) / precommit-checks
    • check-neutral = quality (3.10) / precommit-checks
    • check-skipped = quality (3.10) / precommit-checks
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = quality (3.10) / quality-checks
    • check-neutral = quality (3.10) / quality-checks
    • check-skipped = quality (3.10) / quality-checks
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = tests (3.10) / e2e-tests
    • check-neutral = tests (3.10) / e2e-tests
    • check-skipped = tests (3.10) / e2e-tests
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = tests (3.10) / integration-tests
    • check-neutral = tests (3.10) / integration-tests
    • check-skipped = tests (3.10) / integration-tests
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = tests (3.10) / unit-tests
    • check-neutral = tests (3.10) / unit-tests
    • check-skipped = tests (3.10) / unit-tests
  • any of [🛡 GitHub repository ruleset rule Merge Requirements]:
    • check-success = update-description
    • check-neutral = update-description
    • check-skipped = update-description

@mergify mergify Bot added the queued label Jun 11, 2026
@mergify
mergify Bot merged commit 13c0ba5 into vllm-project:main Jun 11, 2026
12 checks passed
@mergify mergify Bot removed the queued label Jun 11, 2026
@jaredoconnell
jaredoconnell deleted the feat/constraints-refactor branch June 11, 2026 18:30
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.

3 participants