Repository navigation
Fix Phi3 LongRoPE cache rebuild at the context boundary - #49361
Conversation
|
I checked the failed fetcher job: the runner pod failed to come online ( Could the failed jobs be rerun once the runner is healthy? |
aae0f6b to
4a2f93b
Compare
Rocketknight1
left a comment
There was a problem hiding this comment.
Yes, fix looks good and the failing test is just CI issues. I'll rerun everything before merging. Thank you!
|
[For maintainers] Suggested jobs to run (before merge) run-slow: phi3, phimoe |
CI recapDashboard: View test results in Grafana |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
What does this PR do?
Fixes #49334.
When Phi3 generation crosses the original context limit, it clears the KV cache to recompute the prefix with the long RoPE factors. However,
next_sequence_length=1still makes the base input preparation keep only the last token. I reset that argument alongside the cache so the forward pass receives the full prefix.The regression compares each generation step with an uncached full-prefix forward before, at, and after the boundary, with and without a sliding window. Phimoe's existing copied method and both generated files are synchronized by
make fix-repo.Coordinated in #49334. Searches of the issue timeline and open Phi3/LongRoPE PRs did not find an overlapping fix. AI assistance was used.
Validation
python -m pytest tests/models/phi3/test_modeling_phi3.py tests/models/phimoe/test_modeling_phimoe.py -m 'not slow' -q -o addopts= --disable-warnings: 303 passed, 233 skipped, 101 deselected on CPU. These are the two files selected byutils/tests_fetcher.py.make fix-repo,make check-repo,make style, andgit diff --check: passed.GPU, distributed, and large-checkpoint slow tests were not run locally.
Before submitting