[WIP] exp with SDPA instead of einsum#63
Open
ramithuh wants to merge 3 commits into
Open
Conversation
Collaborator
Author
improvement is minor, but helpful: - 1.33 it/s to 1.41 it/s on GB10 with the following command `python routines/train.py num_workers=2 name=pair_embed_test_SDPA_minimal_proj_z task_group=fixed_protein_cond_a_plinder_only edges_per_batch=125000 max_steps=800000 prot_pos_std=0.5 +trainer.log_every_n_steps=1 wandb_conf.project=omtra_per +trainer.num_sanity_val_steps=0` (testing without pharmit for now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR: Looks like we can rely on SDPA even with the pair bias track. This will only benefit on longer sequences / more pair-biased attention layers.
Todos:
More details:
scaled_dot_product_attentionit will fall to Efficient Attention, and it should be competitive with flashattention.More info about the backends that exist in
F.scaled_dot_product_attentioncan be found in the these slidesI ran two quick experiments to check if the implementations are providing the same answer wandb report comparing the two runs. I did not see a difference in training speed at this scale though :|