diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2aab636bbde..a85e54d05d18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,7 @@ +default_stages: [pre-commit, pre-push, manual] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-symlinks - id: destroyed-symlinks @@ -17,12 +18,11 @@ repos: - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.7.1 hooks: - id: ruff files: '^python/.*' - args: ["--fix", "--line-length", "120"] - stages: [pre-commit, pre-push, manual] + args: ["--fix", "--exit-non-zero-on-fix"] exclude: | (?x)( ^python/triton/runtime/.*| @@ -31,18 +31,16 @@ repos: ) - repo: https://github.com/google/yapf - rev: be72557 + rev: "7e21823" hooks: - id: yapf args: ["-p", "-i"] - stages: [pre-commit, pre-push, manual] exclude: "python/test/unit/language/test_line_info.py" - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v16.0.6 + rev: v19.1.2 hooks: - id: clang-format - stages: [pre-commit, pre-push, manual] # Expand YAML anchors in files used by github workflows, because github can't # do this itself. This lets us use anchors, which avoids code duplication. diff --git a/python/src/passes.h b/python/src/passes.h index 46801d802c75..629fe362d8b2 100644 --- a/python/src/passes.h +++ b/python/src/passes.h @@ -34,7 +34,5 @@ }) #define ADD_PASS_OPTION_WRAPPER_4(name, builder, ty0, ty1, ty2, ty3) \ - m.def(name, \ - [](mlir::PassManager &pm, ty0 val0, ty1 val1, ty2 val2, ty3 val3) { \ - pm.addPass(builder({val0, val1, val2, val3})); \ - }) + m.def(name, [](mlir::PassManager &pm, ty0 val0, ty1 val1, ty2 val2, \ + ty3 val3) { pm.addPass(builder({val0, val1, val2, val3})); }) diff --git a/python/triton/compiler/code_generator.py b/python/triton/compiler/code_generator.py index 9ab3f4bc0c79..ec0ef227fa01 100644 --- a/python/triton/compiler/code_generator.py +++ b/python/triton/compiler/code_generator.py @@ -804,7 +804,7 @@ def visit_UnaryOp(self, node): def _verify_loop_carried_variable(self, name, loop_val, live_val): assert _is_triton_value(loop_val), f'cannot reassign constxpr {name} in the loop' assert _is_triton_value(live_val), f'cannot reasign constexpr {name} in the loop' - assert type(loop_val) == type(live_val), f'Loop carried variable {name} changed type' + assert type(loop_val) is type(live_val), f'Loop carried variable {name} changed type' assert not _is_triton_tensor(loop_val) or loop_val.type == live_val.type, \ f'Loop-carried variable {name} has initial type {live_val.type} '\ f'but is re-assigned to {loop_val.type} in loop! '\ diff --git a/third_party/proton/csrc/include/Utility/Errors.h b/third_party/proton/csrc/include/Utility/Errors.h index 094723d6f7e8..09c44025dc45 100644 --- a/third_party/proton/csrc/include/Utility/Errors.h +++ b/third_party/proton/csrc/include/Utility/Errors.h @@ -7,7 +7,7 @@ namespace proton { class NotImplemented : public std::logic_error { public: - NotImplemented() : std::logic_error("Not yet implemented"){}; + NotImplemented() : std::logic_error("Not yet implemented") {}; }; } // namespace proton diff --git a/third_party/proton/test/example_cuda.json b/third_party/proton/test/example_cuda.json index 445f0e224c65..5c742267acab 100644 --- a/third_party/proton/test/example_cuda.json +++ b/third_party/proton/test/example_cuda.json @@ -1,4 +1,4 @@ - [ +[ { "children": [ { diff --git a/third_party/proton/test/example_hip.json b/third_party/proton/test/example_hip.json index 68538706cfe9..70eaf325d35b 100644 --- a/third_party/proton/test/example_hip.json +++ b/third_party/proton/test/example_hip.json @@ -1,4 +1,4 @@ - [ +[ { "children": [ {