deepspeedai / deepspeedai/DeepSpeed

[Question] Difference between launch_bias_add_transform_0213 and launch_apply_rotary_pos_emb in ds_softmax_context

Open
#4,678 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

https://github.com/microsoft/DeepSpeed/blob/efd4556345c82d15f1aa9bf277240f7ac415b8b4/csrc/transformer/inference/csrc/pt_binding.cpp#L480-L510

I'm confused about these codes.
Both func launch_bias_add_transform_0213 and launch_apply_rotary_pos_emb seems to do rotary_pos,what is the difference, why dose it need to execute rotary_pos twice when rotary_dim > 0 && rotate_half?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with csrc/transformer/inference/csrc/pt_binding.cpp at lines 480-510 and compare the calls to launch_bias_add_transform_0213 and launch_apply_rotary_pos_emb. Trace the rotary_dim > 0 && rotate_half path to determine each function's role and why both are invoked. Done means documenting the distinction and explaining whether rotary position processing is duplicated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.