Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Layers] Added RotaryEmbedding forward for bc mode & Fixed rope ut #383

Merged
merged 1 commit into from
May 11, 2024

Conversation

abenmao
Copy link
Contributor

@abenmao abenmao commented May 10, 2024

No description provided.

@pujiang2018 pujiang2018 added the continuous batching continuous batching label May 11, 2024
const int half = (dim + 1) / 2;
const int heads = std::max(qHeads, kHeads);

#pragma omp parallel for collapse(2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently we have imbalance tasks inside omp block, we could optimize it in next stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each row of q and k can be parallel, so it should be balanced~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when kHeads < qHeads, it may cause imbalance issue. but anyhow, next step.

src/kernels/rotary_embedding_kernels.cpp Outdated Show resolved Hide resolved
src/layers/attention.h Show resolved Hide resolved
src/layers/yarn_scaled_rotary_embedding.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous batching continuous batching
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants