Skip to content

Parallel RoPE on metal - #3024

Merged
ggerganov merged 2 commits into
masterfrom
ik/metal_rope
Sep 7, 2023
Merged

ggerganov merged 2 commits into
masterfrom
ik/metal_rope

Conversation

@ikawrakow

@ikawrakow ikawrakow commented Sep 5, 2023 •

Copy link
Copy Markdown
Contributor

Brings a small improvement in TG (~2%).

But the main utility of this PR is to allow for a future change where the KV cache is stored before the RoPE operation, and therefore RoPE needs to be redone for every new token, without major impact on performance as we would have with the current RoPE implementation on metal.

I don't have a Neox model handy, can someone check that I didn't break it? Thanks.

@ikawrakow
ikawrakow requested a review from ggerganov September 5, 2023 10:37
Comment thread ggml-metal.metal Resolved
@ggerganov ggerganov added the need feedback Testing and feedback with results are needed label Sep 5, 2023
@ikawrakow

Copy link
Copy Markdown
Contributor Author

Nobody seems to be objecting. So, merge and see?

@ggerganov

Copy link
Copy Markdown
Member

I just tested Flacon 7B (it is a GPT NeoX model) and it looks like we have broken Metal inference somewhere along the way because master produces junk with Metal. Will first need to fix that and then will check this PR

@ggerganov

ggerganov commented Sep 7, 2023 •

Copy link
Copy Markdown
Member

Looks like something related to Falcon also broke in ca82cf7

Using the previous commit (6a31a3b), text generation is OK

Edit: b7f2aa9 also does not work, so it definitely looks the problem is in ca82cf7

@ikawrakow

Copy link
Copy Markdown
Contributor Author

Fixed the issue observed for Falcon in #3060. If I then cherry-pick the #3060 commit into this branch, Falcon continues to work with this RoPE implementation.

@ggerganov
ggerganov merged commit be8c9c2 into master Sep 7, 2023
@ikawrakow
ikawrakow deleted the ik/metal_rope branch September 24, 2023 16:10
Comment thread ggml-metal.metal Resolved
@cebtenzzre cebtenzzre mentioned this pull request Oct 28, 2023
4 of 5 tasks
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Parallel RoPE on metal

* PR suggestion

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need feedback Testing and feedback with results are needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants