Skip to content

Commit 3889f3f

Browse files
authored
[CI] bump yapf version from be72557 to 7e21823 (#4997)
This PR bumps `yapf` version from `be72557` to `7e21823` in pre-commit hook. Commit `7e21823` fixes race condition when `pre-commit` running `yapf` in parallel. Use a sha1 revision rather than a semver on PyPI because the change is not released yet. See also: - google/yapf#1243 ------ 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 - [X] 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.)
1 parent 78c8054 commit 3889f3f

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
default_stages: [pre-commit, pre-push, manual]
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
4+
rev: v5.0.0
45
hooks:
56
- id: check-symlinks
67
- id: destroyed-symlinks
@@ -17,12 +18,11 @@ repos:
1718
- id: debug-statements
1819

1920
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.1.3
21+
rev: v0.7.1
2122
hooks:
2223
- id: ruff
2324
files: '^python/.*'
24-
args: ["--fix", "--line-length", "120"]
25-
stages: [pre-commit, pre-push, manual]
25+
args: ["--fix", "--exit-non-zero-on-fix"]
2626
exclude: |
2727
(?x)(
2828
^python/triton/runtime/.*|
@@ -31,18 +31,16 @@ repos:
3131
)
3232
3333
- repo: https://github.com/google/yapf
34-
rev: be72557
34+
rev: "7e21823"
3535
hooks:
3636
- id: yapf
3737
args: ["-p", "-i"]
38-
stages: [pre-commit, pre-push, manual]
3938
exclude: "python/test/unit/language/test_line_info.py"
4039

4140
- repo: https://github.com/pre-commit/mirrors-clang-format
42-
rev: v16.0.6
41+
rev: v19.1.2
4342
hooks:
4443
- id: clang-format
45-
stages: [pre-commit, pre-push, manual]
4644

4745
# Expand YAML anchors in files used by github workflows, because github can't
4846
# do this itself. This lets us use anchors, which avoids code duplication.

python/src/passes.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@
3434
})
3535

3636
#define ADD_PASS_OPTION_WRAPPER_4(name, builder, ty0, ty1, ty2, ty3) \
37-
m.def(name, \
38-
[](mlir::PassManager &pm, ty0 val0, ty1 val1, ty2 val2, ty3 val3) { \
39-
pm.addPass(builder({val0, val1, val2, val3})); \
40-
})
37+
m.def(name, [](mlir::PassManager &pm, ty0 val0, ty1 val1, ty2 val2, \
38+
ty3 val3) { pm.addPass(builder({val0, val1, val2, val3})); })

python/triton/compiler/code_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ def visit_UnaryOp(self, node):
804804
def _verify_loop_carried_variable(self, name, loop_val, live_val):
805805
assert _is_triton_value(loop_val), f'cannot reassign constxpr {name} in the loop'
806806
assert _is_triton_value(live_val), f'cannot reasign constexpr {name} in the loop'
807-
assert type(loop_val) == type(live_val), f'Loop carried variable {name} changed type'
807+
assert type(loop_val) is type(live_val), f'Loop carried variable {name} changed type'
808808
assert not _is_triton_tensor(loop_val) or loop_val.type == live_val.type, \
809809
f'Loop-carried variable {name} has initial type {live_val.type} '\
810810
f'but is re-assigned to {loop_val.type} in loop! '\

third_party/proton/csrc/include/Utility/Errors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace proton {
77

88
class NotImplemented : public std::logic_error {
99
public:
10-
NotImplemented() : std::logic_error("Not yet implemented"){};
10+
NotImplemented() : std::logic_error("Not yet implemented") {};
1111
};
1212

1313
} // namespace proton

third_party/proton/test/example_cuda.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
[
22
{
33
"children": [
44
{

third_party/proton/test/example_hip.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
[
22
{
33
"children": [
44
{

0 commit comments

Comments
 (0)