torchfix
torchfix copied to clipboard
TorchFix - a linter for PyTorch-using code with autofix support
See https://github.com/pytorch/pytorch/issues/125050 for details. This will require passing file path as an input to the rules. In general it doesn't make too much sense, but for PyTorch-internal rule like TOR901...
As described in https://github.com/pytorch/test-infra/pull/4559#discussion_r1319881628 It will be just a linter, not a codemod, as it's not possible to determine the desired value statically.
Add a doc (probably just part of README) listing all available error types with codes and explanations. Then add a test that the doc has the info for the error...
Inside a model definition, the `torch.nn.Module` objects inside a Python list do not get their parameters registered. Hence such parameters do not get trained by the optimizer, even though they...
TorchFix should understand statically types of the objects. This feature will enable more rules and more precise targeting for the existing rules. The implementation will require adoption of Pyre and...
Today, use_reentrant defaults to True, but TOR003 sets use_reentrant=False which may subtly differ in behavior in certain cases. We should either make TOR003 set use_reentrant=True, or not run it by...
Currently TorchFix tries to follow latest PyTorch main for things like deprecated APIs. This is not ideal for people who want to use a specific release, for example. So every...
``` b = torch.zeros_like(a) ``` should be preferred over ``` b = torch.zeros(...).to(a) ``` to avoid copies.
Add documentation for the rules to the https://github.com/pytorch-labs/torchfix/blob/main/README.md, see the existing file for examples. If you what to work on a task, please comment on this issue and link your...