Skip to content

Commit

Permalink
Update lintrunner configs
Browse files Browse the repository at this point in the history
Differential Revision: D67650459

Pull Request resolved: #7440
  • Loading branch information
mergennachin authored Dec 26, 2024
1 parent 685a6db commit 7af5f6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ We use [`lintrunner`](https://pypi.org/project/lintrunner/) to help make sure th
code follows our standards. Set it up with:

```
pip install lintrunner==0.11.0
pip install lintrunner-adapters==0.11.0
pip install lintrunner==0.12.7
pip install lintrunner-adapters==0.12.4
lintrunner init
```

Expand Down
4 changes: 2 additions & 2 deletions examples/models/llama/experimental/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def decode_n_tokens(
print(f"cur_token: {cur_token}")
new_tokens, new_probs = [], []
for _ in range(num_new_tokens):
with torch.backends.cuda.sdp_kernel(
enable_flash=False, enable_mem_efficient=False, enable_math=True
with torch.nn.attention.sdpa_kernel(
torch.nn.attention.SDPBackend.MATH
): # Actually better for Inductor to codegen attention here
next_token, next_prob = decode_one_token(
model, cur_token.view(1, -1), **sampling_kwargs
Expand Down
9 changes: 5 additions & 4 deletions exir/dialects/edge/spec/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@ def to_yaml(self) -> Dict[str, Any]:
"type_constraint": type_constraint_yaml,
}
return yaml_dict
except BaseException:
except BaseException as e:
print(
"Operator {} inherited from {} failed convert to yaml".format(
self.func_name, self.inherits
)
)
print(self)
return {}
raise e

def __str__(self) -> str:
my_str: str = "\nop_yaml_info: \n"
Expand Down Expand Up @@ -440,7 +440,8 @@ def gen_op_yaml(op_name: str) -> Optional[EdgeOpYamlInfo]:
except BaseException as e:
# Can not find operator schema, or can not find operator based on op_name.
# Return None to append it into unsupport_funcs and skip.
raise RuntimeError(f"Can not find operator schema for {op_name}") from e
print(f"Can not find operator schema for {op_name}")
raise e

valid_type_combinations = try_all_dtypes_input_samples(op_name)

Expand All @@ -465,7 +466,7 @@ def gen_op_yaml(op_name: str) -> Optional[EdgeOpYamlInfo]:
# Append it to unsupported_funcs.
print("Failed to create yaml file for current function:", op_name)
print("Error msg:", str(e))
return
raise e

return op_yaml_info

Expand Down
12 changes: 6 additions & 6 deletions requirements-lintrunner.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Lintrunner itself
lintrunner==0.11.0
lintrunner-adapters==0.11.0
lintrunner==0.12.7
lintrunner-adapters==0.12.4

# Flake 8 and its dependencies
flake8==6.1.0
flake8-breakpoint==1.1.0
flake8-bugbear==23.9.16
flake8-bugbear==24.4.26
flake8-comprehensions==3.14.0
flake8-pyi==23.5.0
mccabe==0.7.0
pycodestyle==2.11.1
torchfix==0.5.0
torchfix==0.6.0

# UFMT
black==24.4.2
ufmt==2.6.0
usort==1.0.5
ufmt==2.8.0
usort==1.0.8.post1

# Other linters
clang-format==18.1.3
Expand Down

0 comments on commit 7af5f6d

Please sign in to comment.