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

Add custom ops kl_div and swiglu #2508

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

FindHao
Copy link
Member

@FindHao FindHao commented Oct 14, 2024

Add kl_div and swiglu from liger kernel

Test Plan:

% python run_benchmark.py triton --op swiglu  --num-inputs 1
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.55s/it]
  x_val    torch_swiglu-latency    liger_swiglu-latency    inductor_swiglu-latency
-------  ----------------------  ----------------------  -------------------------
      0                 3.23677                 3.37923                    3.30358
% python run_benchmark.py triton --op kl_div  --num-inputs 1 --fwd_bwd
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:03<00:00,  3.34s/it]
  x_val    torch_kl_div-latency    liger_kl_div-latency    inductor_kl_div-latency
-------  ----------------------  ----------------------  -------------------------
      0                0.762816                0.538752                   0.409888

@facebook-github-bot
Copy link
Contributor

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

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.

2 participants