-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed segfault caused by mis-aligned input tensors (#894)
Summary: Pull Request resolved: #894 This diff fixed two issues: * our input tensors may not be well-aligned with respect to our kernels. For example, our fp16-gemm kernel may require 16-byte alignment, but the input tensor for the gemm is not aligned by 16 bytes. We fix the issue by cloning the non-alignment inputs with torch.clone, which almost always gives us 256-byte aligned pointers. * It's not uncommon that multiple shape definitions share the same dimension values. In such a case, we could keep a single definition. In some rare cases, this little trick can dramatically reduce the number of lines generated for the relevant concatenate op and thus may improve the compilation time. Currently, we only enable this optimization for cases where we care about compilation time, as for most cases, the unoptimized version can generate more readable code while having little impact to the compilation time. Reviewed By: ipiszy Differential Revision: D48238260 fbshipit-source-id: 4298f586322c32a3beff46f55ca579de4a40171f
- Loading branch information
1 parent
e0e00e2
commit c795b8c
Showing
3 changed files
with
128 additions
and
22 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