test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Co-authored-by: jeshd<chengmaofan@huawei.com>
# message auto-generated for no-merge-commit merge:
!1644 merge cases_refactor_for_main into main
test(tutorials): move test cases in tutorials to pytest_ut, move examples to unitest
Created-by: jeshd
Commit-by: jeshd
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
### Related Issue
https://gitcode.com/Ascend/triton-ascend/issues/396
### Summary
This PR mainly organizes the examples in the Ascend tutorial into pytest cases, and migrates the original examples to unittest.
### Changes
Added test cases for low-memory dropout, extern functions, grouped gemm, persistent matmul, etc. Meanwhile, converted the corresponding test cases under the tutorial directory to pytest format, keeping them consistent with the original tutorial examples.
Fixed test failures in fused-softmax, matrix-multiplication, demo-libentry, rab_time, hstu_attention and other test cases.
For each test script name.py in third_party/ascend/tutorials, there is a corresponding pytest test case script test_name.py in third_party/ascend/unittest/pytest_ut.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [x] This PR does not need a test because fix test cases.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1644
test(AutoBlockify): add pytest_ut and mlir testcase
Co-authored-by: kang-ingu<kang.ingu@huawei.com>
# message auto-generated for no-merge-commit merge:
!1335 merge test-auto-blockify-v2 into main
test(AutoBlockify): add pytest_ut and mlir testcase
Created-by: kang-ingu
Commit-by: kang-ingu
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1335
feat(refactor): unify implicit permute logic
Co-authored-by: candyhong<1102229410@qq.com>
Co-authored-by: LH_123L<liuhuan261@huawei.com>
Co-authored-by: KanuaK<zhouyihan1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1245 merge main/feat-implicit-permute-candy-test into main
feat(refactor): unify implicit permute logic
Created-by: candyhong
Commit-by: candyhong;KanuaK;LH_123L
Merged-by: ascend-robot
Description: ## Background
### Related ISSUE:[#305](https://gitcode.com/Ascend/triton-ascend/issues/305)
The current implicit permute logic in Triton-Ascend (TA) has flaws that impact maintainability, hardware utilization, and scenario coverage:
| Issue Category | Key Symptoms | Impact |
| --------------------- | ----------------------------------------------------------------- | ----------------------------------------------- |
| Dispersed Logic | No unified entry for adaptation logic | High maintenance cost, risk of logic conflicts |
| Missing HW Adaptation | No differentiated processing logic for hardware types | Failed to leverage hardware capabilities(NDDMA) |
| Incomplete Capability | No support for variable stride analysis/For-loop pointer analysis | Poor coverage of scenarios |
## Optimization Goals
1. **Unify Logic**: Converge all implicit permute logic to a single entry, define unified rules for hardware/scenarios.
2. **Complete Capabilities**: Support constant/variable stride analysis, For-loop pointer analysis, and unify ptr/mask analysis logic.
3. **HW Adaptation**: Implement hardware-specific/software fallback implicit permute solutions.
## Verification
| Test Suite | Test Count | Main Branch Result | PR Result | Status |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
| generalization(main) | 91373 | [pre-smoke-108](https://devcloud.cn-north-4.huaweicloud.com/codeci/project/1e20b309fcb34b00a0043a87e461c95a/codeci/detail/workspace/15834d5b21a14cd99ef2ea8651c54f7d/111)<br><br>81773 pass | [per-smoke-111](https://devcloud.cn-north-4.huaweicloud.com/cicd/project/1e20b309fcb34b00a0043a87e461c95a/pipeline/detail/945b705f6f1d4087a1a08d834fbc2c51/cdbf3a4922e241e8a0b1a6dadb3d5a82?v=1)<br><br>81773 pass | Pass |
## Checklist
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [x] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1245
feat: add copy interface that copy from ub to ub or l1
Co-authored-by: f42e278<zhangce29@huawei.com>
# message auto-generated for no-merge-commit merge:
!1225 merge feat_copy into main
feat: add copy interface that copy from ub to ub or l1
Created-by: f42e278
Commit-by: f42e278
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1225
add(ut):add argmin/argmax ut
Co-authored-by: chnjz233<jiangzheng26@huawei.com>
# message auto-generated for no-merge-commit merge:
!1358 merge ut_argmin into main
add(ut):add argmin/argmax ut
Created-by: chnjz233
Commit-by: chnjz233
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1358
add(ut):add argmin/argmax ut
Co-authored-by: chnjz233<jiangzheng26@huawei.com>
# message auto-generated for no-merge-commit merge:
!1358 merge ut_argmin into main
add(ut):add argmin/argmax ut
Created-by: chnjz233
Commit-by: chnjz233
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1358
feat(inline_asm): support nD tensor case for inline asm
Co-authored-by: KanuaK<zhouyihan1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1473 merge feat/inline-asm-2D into main
feat(inline_asm): support nD tensor case for inline asm
Created-by: KanuaK
Commit-by: KanuaK
Merged-by: ascend-robot
Description: Generalize ElementwiseInlineAsm lowering in TritonToLLVM to support N-D tensors by converting linear indices to multi-dimensional indices, removing the previous 1D-only restriction.
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1473
[DTS2026030923544]# 将psg.asm中的kv值修改为npu亲和写法
Co-authored-by: w30012745<wangxiaoshuai2@h-partners.com>
# message auto-generated for no-merge-commit merge:
!1402 merge assume into main
[DTS2026030923544]# 将psg.asm中的kv值修改为npu亲和写法
Created-by: Wangxiaoshuai2
Commit-by: w30012745
Merged-by: ascend-robot
Description: Description:
test_assume函数调用报错unknown key llir,经排查这个是非npu亲和的写法,需要进行修改
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1402
feat(refactor): unify implicit permute logic
Co-authored-by: candyhong<1102229410@qq.com>
Co-authored-by: LH_123L<liuhuan261@huawei.com>
Co-authored-by: KanuaK<zhouyihan1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1245 merge main/feat-implicit-permute-candy-test into main
feat(refactor): unify implicit permute logic
Created-by: candyhong
Commit-by: candyhong;KanuaK;LH_123L
Merged-by: ascend-robot
Description: ## Background
### Related ISSUE:[#305](https://gitcode.com/Ascend/triton-ascend/issues/305)
The current implicit permute logic in Triton-Ascend (TA) has flaws that impact maintainability, hardware utilization, and scenario coverage:
| Issue Category | Key Symptoms | Impact |
| --------------------- | ----------------------------------------------------------------- | ----------------------------------------------- |
| Dispersed Logic | No unified entry for adaptation logic | High maintenance cost, risk of logic conflicts |
| Missing HW Adaptation | No differentiated processing logic for hardware types | Failed to leverage hardware capabilities(NDDMA) |
| Incomplete Capability | No support for variable stride analysis/For-loop pointer analysis | Poor coverage of scenarios |
## Optimization Goals
1. **Unify Logic**: Converge all implicit permute logic to a single entry, define unified rules for hardware/scenarios.
2. **Complete Capabilities**: Support constant/variable stride analysis, For-loop pointer analysis, and unify ptr/mask analysis logic.
3. **HW Adaptation**: Implement hardware-specific/software fallback implicit permute solutions.
## Verification
| Test Suite | Test Count | Main Branch Result | PR Result | Status |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
| generalization(main) | 91373 | [pre-smoke-108](https://devcloud.cn-north-4.huaweicloud.com/codeci/project/1e20b309fcb34b00a0043a87e461c95a/codeci/detail/workspace/15834d5b21a14cd99ef2ea8651c54f7d/111)<br><br>81773 pass | [per-smoke-111](https://devcloud.cn-north-4.huaweicloud.com/cicd/project/1e20b309fcb34b00a0043a87e461c95a/pipeline/detail/945b705f6f1d4087a1a08d834fbc2c51/cdbf3a4922e241e8a0b1a6dadb3d5a82?v=1)<br><br>81773 pass | Pass |
## Checklist
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [x] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1245
fix(UseAnalysis):set usetype of the operands of AtomicRMWOp to MixUse
Co-authored-by: chnjz233<jiangzheng26@huawei.com>
# message auto-generated for no-merge-commit merge:
!1289 merge AtomicRMWOp into main
fix(UseAnalysis):set usetype of the operands of AtomicRMWOp to MixUse
Created-by: chnjz233
Commit-by: chnjz233
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1289
feat(buffer): support bind buffer
Co-authored-by: jqran<jiaochaoran@huawei.com>
# message auto-generated for no-merge-commit merge:
!1186 merge feat-bind-buffer into main
feat(buffer): support bind buffer
Created-by: jqran
Commit-by: jqran
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1186
fix: Move makeTensorPtrOp cache after redundantOp create
Co-authored-by: wutianyao<wutianyao1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1414 merge main4 into main
fix: Move makeTensorPtrOp cache after redundantOp create
Created-by: wutianyao
Commit-by: wutianyao
Merged-by: ascend-robot
Description: When makeblockptr is rewritten, a redundantOp is generated. The source of blockdata should be directed to this newly generated op and then stored in the cache. Otherwise, when the blockdata is retrieved from the cache and reinterpretcast is created based on the source, the sequence will be incorrect.
----
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1414
test(op): commit cat helper func
Co-authored-by: MaxYy<yuyang61@huawei.com>
# message auto-generated for no-merge-commit merge:
!1292 merge cat into main
test(op): commit cat helper func
Created-by: MaxYy
Commit-by: MaxYy
Merged-by: ascend-robot
Description: 提交cat helper func用例, 共8个场景 再提交3个 自验证已通过
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1292
Revert "feat(op): add cdiv op"
Co-authored-by: wcleungaj<leung.wing.chung@huawei.com>
# message auto-generated for no-merge-commit merge:
!1266 merge fix-revert-add-cdiv-op into main
Revert "feat(op): add cdiv op"
Created-by: wcleungaj
Commit-by: wcleungaj
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1266
fix(BlockPtrAnalysis):add dimension information to scalar blockdata
Co-authored-by: chnjz233<jiangzheng26@huawei.com>
# message auto-generated for no-merge-commit merge:
!1548 merge blockptranalysis into main
fix(BlockPtrAnalysis):add dimension information to scalar blockdata
Created-by: chnjz233
Commit-by: chnjz233
Merged-by: ascend-robot
Description: 给scalar blockdata 增加维度信息
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1548
feat: add copy interface that copy from ub to ub or l1
Co-authored-by: f42e278<zhangce29@huawei.com>
# message auto-generated for no-merge-commit merge:
!1225 merge feat_copy into main
feat: add copy interface that copy from ub to ub or l1
Created-by: f42e278
Commit-by: f42e278
Merged-by: ascend-robot
Description: The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1225
testing: Add code coverage ut and mlir testing cases for TritonToUnstructure, TritonToHIVM, BubbleUpOp, DiscreteMask
Co-authored-by: wutianyao<wutianyao1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1649 merge main6 into main
testing: Add code coverage ut and mlir testing cases for TritonToUnstructure, TritonToHIVM, BubbleUpOp, DiscreteMask
Created-by: wutianyao
Commit-by: wutianyao
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
# New contributor declaration
- [ ] I am not making a trivial change, such as fixing a typo in a comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [ ] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [ ] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1649
fix(DiscreteMask): distribute broadcast over andi in collectAndLeaves
Co-authored-by: candyhong<1102229410@qq.com>
# message auto-generated for no-merge-commit merge:
!1478 merge main/fix-disc-broadcast into main
fix(DiscreteMask): distribute broadcast over andi in collectAndLeaves
Created-by: candyhong
Commit-by: candyhong
Merged-by: ascend-robot
Description: ## Related Issue
[MTE Out-of-Bounds Access in Discrete Mask Load Operations](https://gitcode.com/Ascend/triton-ascend/issues/389)
## Backgroup
The **DiscreteMaskAccessConversionPass** is designed to handle non-rectangular discrete mask load/store operations.
When a Triton kernel combines two 1-D row masks using & before broadcasting to 2-D, the IR is generated as:
```c++
%row_and_1d = arith.andi(expand_dims(row_boundary), expand_dims(row_disc))
// [BLOCK_M, 1]
%row_2d = tt.broadcast(%row_and_1d) // [BLOCK_M, BLOCK_N]
%col_2d = tt.broadcast(expand_dims(col_mask)) // [BLOCK_M, BLOCK_N]
%combined = arith.andi(%row_2d, %col_2d) // [BLOCK_M, BLOCK_N]
```
The original pass could not penetrate the broadcast node, so it failed to extract row_boundary as the contiguous bound.
This causes the compiler to emit **unbounded full-block memory loads** for tail blocks, leading to RuntimeError:.. The DDR address of the MTE instruction is out of range.
To resolve this, we apply the algebraic equivalence:
$$ broadcast(andi(a, b)) = andi(broadcast(a), broadcast(b))$$
so that row_boundary and row_disc are extracted as separate leaves and classified correctly as contMask and discMask respectively.
## Changes
1. **Enhance DiscreteMaskAccessConversionPass:**
Implement IR rewrite rule to decompose broadcast(andi(a,b)) into andi(broadcast(a), broadcast(b)), enabling correct extraction of contiguous boundary masks.
2. **Add MTE out-of-bounds reproduction test:**
Add a reliable test case to verify MTE memory safety for tail-block loads.
3. **Add 2-D combined discrete mask test:**
Extend test coverage for 2-D composite mask patterns including broadcast(cont & disc) used in AND-combined masks.
## CheckList
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [x] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1478
fix: raise error for unsupported allow_tf32 in dot_op
Co-authored-by: ZhangAiqiang<zhangaiqiang1@huawei.com>
# message auto-generated for no-merge-commit merge:
!1643 merge tf32_ban_main into main
fix: raise error for unsupported allow_tf32 in dot_op
Created-by: zaq15csdn
Commit-by: ZhangAiqiang
Merged-by: ascend-robot
Description: <!---
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace [ ] with
[x] to indicate you have done them.
-->
# New contributor declaration
- [x] I am not making a trivial change, such as fixing a typo in a comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [ ] I have run pre-commit run --from-ref origin/main --to-ref HEAD.
- Select one of the following.
- [x] I have added tests.
- /test for lit tests
- /unittest for C++ tests
- /python/test for end-to-end tests
- [ ] This PR does not need a test because FILL THIS IN.
- Select one of the following.
- [x] I have not added any lit tests.
- [ ] The lit tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)
See merge request: Ascend/triton-ascend!1643