mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3393] [CLOSED] [Other] setup: reject invalid explicit RoPE scale factors #4612
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4612
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3393
Author: @j-luwierski
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:codex/reject-invalid-rope-scale📝 Commits (1)
b7c8ede[Other] reject invalid explicit RoPE scales📊 Changes
2 files changed (+20 additions, -3 deletions)
View changed files
📝
setup.py(+5 -3)📝
tools/test_setup_rope.py(+15 -0)📄 Description
Problem and result
On current
main, setup accepts an explicit--rope-scaleofnan,inf,-inf, zero, or a value below 1. For example,resolve_rope(1048576, "yarn", float("nan"))returns("yarn", nan); setup can then pass the invalid value into the generated engine arguments. The engine requires a finite factor >= 1.After this change, setup rejects every explicit non-finite factor and every factor below 1 before it writes configuration, and the error names
--rope-scaleand the valid range. Valid factors remain unchanged.Related discussion
This is the rebased follow-up to #2950, which was closed during the 0.2.0-beta tracker reset rather than declined. Its fix was not present on current
main.Approach
Validate the explicit factor at the start of
resolve_rope()withmath.isfinite()and the engine's >= 1 lower bound. Update--helpto state the accepted range. Add regression coverage across contexts below, at and above 262144, with omitted,none,linearandyarnscaling methods.Automatic scaling, valid explicit overrides, model inference and backend code are unchanged. This does not change YaRN quality or require the factor to cover the requested context.
Validation
Revision:
b7c8ede5, based onmain5bda973a. Linux, Python 3; no GPU or model downloads.Passed:
5bda973a: the resolver accepted NaN, both infinities, -1, 0 and 0.5 for contexts 131072, 262144 and 1048576 with linear and yarn.python3 -m unittest tools.test_setup_rope tools.test_setup_choices tools.test_setup_configs tools.test_setup_config -q: 93 tests pass.python3 setup.py --help: help shows the finite and >= 1 constraint.git diff --check.Failed: none.
Not run: GPU builds and model inference; no engine/backend source or build files changed. The test run emitted existing
/proc/cpuinfoResourceWarnings and a read-only fixture note; all 93 tests passed.Limits
Validation covers setup's resolver and its configuration tests. It does not measure model behavior or the quality of RoPE scaling.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.