Skip to content

Reject SPSA int params with C < 0.50 during workload validation#320

Open
yohaann196 wants to merge 6 commits intoAndyGrant:masterfrom
yohaann196:master
Open

Reject SPSA int params with C < 0.50 during workload validation#320
yohaann196 wants to merge 6 commits intoAndyGrant:masterfrom
yohaann196:master

Conversation

@yohaann196
Copy link
Copy Markdown

Fixes #304

verify_spsa_inputs already rejected float params with C <= 0.00, but
had no equivalent check for int params. A C of 0 for an int param would
pass validation, get stored, and then cause a divide-by-zero in
spsa_workload_assignment_dict when computing r_values = a / c ** 2.

The minimum meaningful C for an int param is 0.50, which matches the
floor already applied in spsa_utils.py:

c_values = np.maximum(c_values / c_compression, np.where(is_float, 0.0, 0.5))

Also fixes a typo in the existing error message:
"Datatype must be int for float" -> "Datatype must be int or float"

yohaann196 and others added 6 commits April 5, 2026 09:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Reject SPSA int params with C < 0.50 during workload validation
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.

SPSA Params with a given C of 0 should be ignored

2 participants