forked from facebookresearch/xformers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once the profiler has run, we sum all of the flops for all the operators. To do so, we need to de-duplicate events (eg SDPA calling MM: we should count the flops only once). When there is ambiguity, we chose to count the flops of the parent operator (if we know its flops). This process was quite slow when we had a lot of events (~45k for a Llama7B on difformers), and could take up to 5mn (`O(N^2)` algo). Now it takes ~1sec (`O(N*ln(N))`) ghstack-source-id: 7aac17cf85ae68990e37467c40aa0d5a89e8927c Pull Request resolved: fairinternal/xformers#1203 __original_commit__ = fairinternal/xformers@9820ed0
- Loading branch information
Showing
2 changed files
with
35 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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