forked from pytorch/FBGEMM
-
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.
Manually cache block attributes in PackBMatrix::pack_unpack_ (pytorch…
…#702) Summary: Pull Request resolved: pytorch#702 I noticed from inspecting assembly that we were re-loading the 4 block attributes on each loop iteration. It initially surprised me that the compiler was not able to prove that the loop body doesn't mutate the block (I don't see any function calls and TBAA should mean that it can prove nothing aliases the block). On reflection, it is notable that `T` is `signed char` -- `char*` is the one exception to the strict aliasing rule (see https://en.cppreference.com/w/cpp/language/reinterpret_cast), so the compiler cannot prove that `unpack_buf` and `pack_buf` do not alias `block` and thus it has to re-load from `block` each time. Reviewed By: jspark1105 Differential Revision: D30976702 fbshipit-source-id: 0cb47b30aae883aceface0e0a0708504e1254933
- Loading branch information
1 parent
321db4d
commit dccc573
Showing
1 changed file
with
24 additions
and
12 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