mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2950] [CLOSED] fix(setup): reject invalid RoPE scaling factors #4354
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#4354
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/2950
Author: @j-luwierski
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:codex/validate-rope-scale📝 Commits (1)
ca288c8fix(setup): reject invalid RoPE scaling factors📊 Changes
2 files changed (+20 additions, -3 deletions)
View changed files
📝
setup.py(+5 -3)📝
tools/test_setup_rope.py(+15 -0)📄 Description
Summary
Setup's
resolve_rope()accepts an explicit--rope-scale nan,inf, or a value below 1 and forwards it into the saved engine arguments. The engine rejects these values:rope_scaling_invalid()requires a finite factor >= 1.Reject invalid explicit factors during setup's RoPE resolution, before configuration is saved, with a message naming the flag and its valid range.
What changed
setup.py: validate explicit factors usingmath.isfinite()and the engine's >= 1 lower bound; document the range in--help.tools/test_setup_rope.py: cover NaN, both infinities, negative, zero and fractional factors below 1 across contexts below, at and above 262144, with omitted/none/linear/yarn methods. Confirm valid explicit factors remain unchanged, including factors smaller than the context-derived ratio.Automatic scaling, valid explicit overrides, model inference and backend code are unchanged. This does not change YaRN quality or enforce a context-covering factor.
Validation
Based on upstream
477ac13cbe8e582c20484871ce459d20d82df09d, Linux, Python 3; no GPU or model downloads.python3 -m unittest tools.test_setup_rope tools.test_setup_choices tools.test_setup_configs tools.test_setup_config -q: 89 tests pass.--yesand Enter): 50/50 comparisons match for exit code, normalized serialized configuration and questions.tools.test_setup_goldenruns 93 tests with 8 Unsloth golden subcase failures. The same 8 subcases fail with the original upstream setup; golden files were not regenerated.git diff --checkpasses.No CUDA/HIP/SYCL source or build file changes; backend builds and on-model inference were not run.
Related work
Searched open issues/PRs for
rope-scale,resolve_rope, RoPE validation and non-finite factors; no matching setup-validation fix found. Existing cache migration (#1698) and Metal RoPE support (#2819) address separate behavior.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.