Skip to content

Commit

Permalink
[CI] bump yapf version from be72557 to 7e21823 (#4997)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
XuehaiPan authored Oct 28, 2024
1 parent 78c8054 commit 3889f3f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/.*|
Expand All @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions python/src/passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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})); })
2 changes: 1 addition & 1 deletion python/triton/compiler/code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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! '\
Expand Down
2 changes: 1 addition & 1 deletion third_party/proton/csrc/include/Utility/Errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion third_party/proton/test/example_cuda.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
[
{
"children": [
{
Expand Down
2 changes: 1 addition & 1 deletion third_party/proton/test/example_hip.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
[
{
"children": [
{
Expand Down

0 comments on commit 3889f3f

Please sign in to comment.