-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LAYOUTS] Cache LinearLayout creation (#5542)
It was reported that triton compilation times have heavily increased lately. The cause of this is that we very often create the associated LL to check properties of a given Layout. We do this thousands of times, and this gets very expensive. In this PR, we implement a thread-safe cache for LinearLayouts. We clear this cache after we are done with the TTGIR -> LLVM conversion. In the future, we will make `DistributedEncoding` inherit from `LinearLayoutEncoding`, which will mean that `DistributedEncoding`s will always have access to their associated LinearLayout. Even in this scenario I still think that caching will be good, as there is no real 1-to-1 correspondence between `DistributedEncoding`s and `LinearLayout`s due to broadcasting, where we tile a layout along the tensor or we make it smaller. As such, I think this cache may be also useful in the future.
- Loading branch information
Showing
3 changed files
with
83 additions
and
15 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
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