-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKEND] fix bf16 representation in TritonNvidiaGPU and bf16 tl.sort…
… bug (#3975) Since LLVM now support `bf16`, it is not necessary that [represent `bf16` as `i16`](#1245 (comment)) in TritonGPUtoLLVM conversion, in which case `bf16` compare makes mistake as compare is converted to `arith.cmpf` while `i16` is not compatible with `arith.cmpf`, thus `bf16` compare and `tl.sort` both report [bug](#3873). Meanwhile, use of `core.arange` in `_compare_and_swap` causes the unaligned data type when call `tl.sort` for `bf16`. Data type of `left` and `right` needs to be casted to `y.dtype` to fix `tl.sort`. The revision have passed the python tests as below in docker on H100: ```sh $ sudo pip uninstall pytorch-triton $ cd triton $ pip install -e python $ python -m pytest python/test/unit # ... 11309 passed, 1219 skipped, 156 warnings in 3222.26s (0:53:42) ``` However, I cannot build cpp test with the errors: ```sh $ cd python/build/cmake.linux-x86_64-cpython-3.10/ $ ninja test [0/1] Re-running CMake... /bin/bash: line 1: /tmp/pip-build-env-phcu6k1b/overlay/local/lib/python3.10/dist-packages/cmake/data/bin/cmake: No such file or directory FAILED: build.ninja /tmp/pip-build-env-phcu6k1b/overlay/local/lib/python3.10/dist-packages/cmake/data/bin/cmake --regenerate-during-build -S/home/scratch.haoruoc_gpu/repos/triton -B/home/scratch.haoruoc_gpu/repos/triton/python/build/cmake.linux-x86_64-cpython-3.10 ninja: error: rebuilding 'build.ninja': subcommand failed ``` The given path in `build.ninja` does not exist. Besides, I do not revise AMD backend as I have no access to corresponding hardware. --------- Co-authored-by: haoruoc <[email protected]>
- Loading branch information
1 parent
100e2aa
commit 445d5ed
Showing
8 changed files
with
36 additions
and
33 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
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