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

Triton Attention #22

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

Triton Attention #22

wants to merge 18 commits into from

Conversation

seanxwzhang
Copy link
Contributor

@seanxwzhang seanxwzhang commented Jan 27, 2025

This PR implements power_attention interface with multiple read and writes for any p in log space.

Not tested yet

Sean Zhang and others added 5 commits January 26, 2025 08:59
…direction (#4)

* Changed the timing function to just compile and warm up the relevant direction

* Bugfix
@seanxwzhang seanxwzhang requested a review from jbuckman as a code owner January 27, 2025 08:35
seanxwzhang and others added 13 commits January 27, 2025 23:15
* add theoretical and walltime

* small is better

* add in script for plotting

* add comparison plots

* add rebased

* wip

* Updated some stuff

* wip

* wip

* Incomplete impl

* Added assert

* Updated compare2 with jacob version of triton kernel

* Changed the timing function to just compile and warm up the relevant direction

* Removed triton power again for now

* delete unused code

* address comments, merge compare

* nit

* Update pyproject.toml

* done

* need torch to build

* use the right pip

* use python module for pip and pytest

* build requires torch

* land this thing now

---------

Co-authored-by: Sean Zhang <[email protected]>
Co-authored-by: Jacob Buckman <[email protected]>
* add mode to comapre

* added run_baseline

* add run_baseline and profile_baseline

* remove unnecessary import

* better measurement

---------

Co-authored-by: Sean Zhang <[email protected]>
* Fixed flops and regenerated plots to add to README

* Update

* Update
* triton update fwd done

* bwd passed

* better order

* add benchmark

* compile on the fly, no second run

* deterministic conditions

* 2 for loops, additional 4% speed up

* remove unnecessary variable

* functional query_state

* update_state passing all tests; improved _inspect.py a bit

* all passing

* add power_full_triton

* use print_runtime

* use print_runtime

* limit torch versio

---------

Co-authored-by: Sean Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants