-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Refactors the MX gemm emulation code to properly emulate the memory layout constraints we expect from the future mx-enabled hardware, where we expect: * the first argument to the mx gemm to be required row-major memory format * the second argument to the mx gemm to be required col-major memory format Note that two morally unrelated issues were uncovered with this refactor: 1. when autocast is on, compile is no longer matching eager numerics. Since the "before this PR" state isn't really representative of the world, I'm treating this as a newly uncovered issue, and we can fix it in a future PR. 2. our transpose logic for fp4 packed into two elements per byte doesn't work for tensors of shape (M, 1), because we currently rely on the `is_contiguous()` function to see if our tensor was transposed. We could work around, but punting that until a time that becomes important. I expect most tensors in real world usage with MX to not hit this case. Test Plan: ``` pytest test/prototype/mx_formats/ -s -x ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 8d6ca220c947880f5221b284149f5563745a517d ghstack-comment-id: 2605962974 Pull Request resolved: #1593
- Loading branch information
Showing
5 changed files
with
125 additions
and
37 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
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