Conversation
|
I realized the pre-commit is already run, so I'll force push to this branch to remove github action that I added. This PR must be merged without squash! |
b863570 to
82b2ac5
Compare
|
@ZzEeKkAa what do you think of |
|
I don't have anything against ruff) Just did not use it before |
I suggest using |
Is this because of the addition of
I'm in favour of this PR (I just never had the experience of setting something up like this before or the time to figure it out) and I'm happy with either of |
|
Let's use Ruff as it's used by all other CUDA Python projects. |
82b2ac5 to
15c31b6
Compare
15c31b6 to
6d7de70
Compare
Yes
Idea is to keep history for the changes to So yeah, if commit will be different after rebase (not sure why it is needed for branch merge, we need to update commit hash there. |
|
Just rebased the branch to work with ruff. Should be good to go) |
I guess it is generally a bad idea to run any linters/formatters on the generated code. But I'm all in for |
isVoid
left a comment
There was a problem hiding this comment.
I managed to give a rough pass to the code which mostly looks good to me. I went over the new ruff config v.s. the flake8 config and discovered a nice small discussion around W503 and W504 - apparently it was controversial and ruff didn't implement them:
astral-sh/ruff#4125
As for the f-string dicussion below - I realized they are unsafe fixes. They might be a nice code style improvement in a future PR if we can scrutinize into each of the fstring use case deeper. But they shouldn't block this PR.
@ZzEeKkAa What do you think the current developer should do to merge this PR into current working branches?
| newdims = ( | ||
| newdims[0:unknownidx] | ||
| + (self.size // knownsize,) | ||
| + newdims[unknownidx + 1 :] | ||
| ) |
There was a problem hiding this comment.
We even have backslash line breaks! 🤣
| mem, sz = cufunc.module.get_global_symbol( | ||
| "%s__%s__" % (cufunc.name, name) | ||
| ) |
There was a problem hiding this comment.
This looks so much nicer, but it would be even better if ruff can auto format into f-strings.
| tid = "tid=%s" % list(self.threadIdx) | ||
| ctaid = "ctaid=%s" % list(self.blockIdx) | ||
| if str(e) == "": | ||
| msg = "%s %s" % (tid, ctaid) | ||
| else: | ||
| msg = '%s %s: %s' % (tid, ctaid, e) | ||
| msg = "%s %s: %s" % (tid, ctaid, e) |
There was a problem hiding this comment.
Same, f-strings would be nice.
Yes, and in
Yes, lets target it in another PR.
Simple merge + resolve conflicts generally should work, otherwise it will be nice to get |
|
@gmarkall could we merge this PR? |
|
I just merged this, but I had to do it outside the normal PR flow because even "rebase and merge" changes the commit hashes, which would mess up the |
- Locate nvvm, libdevice, nvrtc, and cudart from nvidia-*-cu12 wheels (NVIDIA#155) - reinstate test (NVIDIA#226) - Restore PR NVIDIA#185 (Stop Certain Driver API Discovery for "v2") (NVIDIA#223) - Report NVRTC builtin operation failures to the user (NVIDIA#196) - Add Module Setup and Teardown Callback to Linkable Code Interface (NVIDIA#145) - Test CUDA 12.8. (NVIDIA#187) - Ensure RTC Bindings Clamp to the Maximum Supported CC (NVIDIA#189) - Migrate code style to ruff (NVIDIA#170) - Use less GPU memory in test_managed_alloc_driver_undersubscribe. (NVIDIA#188) - Update workflows to always use proxy cache. (NVIDIA#191)
- Locate nvvm, libdevice, nvrtc, and cudart from nvidia-*-cu12 wheels (#155) - reinstate test (#226) - Restore PR #185 (Stop Certain Driver API Discovery for "v2") (#223) - Report NVRTC builtin operation failures to the user (#196) - Add Module Setup and Teardown Callback to Linkable Code Interface (#145) - Test CUDA 12.8. (#187) - Ensure RTC Bindings Clamp to the Maximum Supported CC (#189) - Migrate code style to ruff (#170) - Use less GPU memory in test_managed_alloc_driver_undersubscribe. (#188) - Update workflows to always use proxy cache. (#191)
Description
flake8withruffcode style to automatically format code.ruffhas same set of features asflake8, so having both linters is redundant.ruffalso adds auto formatting features likeblack. Config was ported from.flake8to.pre-commit-config.yamlwith these differences:W503andW504(line break after binary operator).This PR must be merged without squash, to separate config changes (that we want in history) from formatter changes (that we do not want). If rebased, please update
.git-blame-ignore-revscommit hash.Old description
This PR must be merged without squash!