镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Treat a config constraint equal to the threshold as violating strict "<" - #1668

Open
Mohammad Sohail Shaikh (sohailshk) wants to merge 1 commit into
microsoft:mainfrom
sohailshk:fix/blendsearch-strict-less-than-constraint
Open

Mohammad Sohail Shaikh (sohailshk) wants to merge 1 commit into
microsoft:mainfrom
sohailshk:fix/blendsearch-strict-less-than-constraint

Conversation

@sohailshk

Copy link
Copy Markdown

Why are these changes needed?

BlendSearch._violate_config_constriants() flags sign == "<" only when value > threshold; equality also violates a strict <. The docs (website/docs/Use-Cases/Tune-User-Defined-Function.md, "More constraints on the tuning") list "<=", ">=", "<" and ">" separately; ">" was already strict. With config_constraints=[(lambda c: c["n"], "<", 5)] on tune.randint(0, 11), n == 5 was still evaluated. The existing test uses threshold 0.5 on a 0/1 value, so equality never occurs.

Change: > to >= for the < case. Test: a CFO run with points_to_evaluate=[{"n": 5}] must never evaluate n >= 5; fails on main (assert 5 < 5), passes now.

Related issue number

None.

Checks

Checks run: black (line length 120) and ruff on the changed files. The pinned pre-commit hook versions were not run. No doc changes are needed.

BlendSearch._violate_config_constriants() flagged '<' constraints only when
value > threshold, so a config whose constraint value equals the threshold was
evaluated although value < threshold is false (the other three signs were
already strict in the right direction).

This branch has not been deployed

No deployments
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.

1 participant