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

[rope] Fix running with cudagraph #156

Closed
wants to merge 1 commit into from
Closed

[rope] Fix running with cudagraph #156

wants to merge 1 commit into from

Conversation

xuzhao9
Copy link
Contributor

@xuzhao9 xuzhao9 commented Feb 6, 2025

Tensor view does not support in-place detaching with .detach_(), use .contiguous() call to convert tensor views to tensor.

Fixes #155

Test plan:

$ python run.py --op rope  --cudagraph
       (H, T)    apply_rotary_pos_emb-latency    liger_rotary_pos_emb-latency    inductor_rotary_pos_emb_full_op-latency
-------------  ------------------------------  ------------------------------  -----------------------------------------
 (8192, 1024)               0.209794 (±0.08%)               0.079294 (±0.09%)                          0.044696 (±0.17%)
 (8192, 2048)               0.425296 (±0.07%)               0.167398 (±0.07%)                          0.083712 (±0.10%)
 (8192, 4096)               0.869108 (±0.07%)               0.333221 (±0.04%)                          0.175674 (±0.27%)
 (8192, 8192)               1.734228 (±0.05%)               0.655273 (±0.05%)                          0.442072 (±1.22%)
(8192, 16384)              4.405540 (±13.46%)               1.325537 (±8.78%)                          1.177186 (±0.31%)
  (512, 2048)               0.033462 (±0.33%)               0.010369 (±0.14%)                          0.006766 (±0.16%)
 (2048, 2048)               0.098888 (±0.23%)               0.027084 (±0.25%)                          0.019540 (±1.82%)
 (8192, 2048)               0.424953 (±0.06%)               0.167613 (±0.05%)                          0.088726 (±0.66%)

@facebook-github-bot
Copy link
Contributor

@xuzhao9 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@xuzhao9 merged this pull request in a42aa62.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

detach_ issue with RoPE and --cudagraphs
2 participants