Skip to content

Commit

Permalink
ci(format): add version check in run_format.sh (#753)
Browse files Browse the repository at this point in the history
Make sure the version local format tools is compatible with the version in the CI workflow.

Also bump the version of black to 24.3.0.
  • Loading branch information
lljbash authored Apr 1, 2024
1 parent f84d3f8 commit 8d2a550
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 7,558 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
- uses: psf/black@stable
with: # see: https://black.readthedocs.io/en/stable/getting_started.html
src: "dipu"
version: "~= 23.11.0"
version: "~= 24.3.0"
29 changes: 16 additions & 13 deletions dipu/scripts/autogen_diopi_wrapper/autogen_diopi_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,10 +772,9 @@ def functions_code_gen(fun_config):
)

if fun_config.get("print_func_call_info", False) == True:
fun_config[
"custom_code_at_the_beginning"
] = create_code_to_print_fun_call_info_from_schema(fun_config) + fun_config.get(
"custom_code_at_the_beginning", ""
fun_config["custom_code_at_the_beginning"] = (
create_code_to_print_fun_call_info_from_schema(fun_config)
+ fun_config.get("custom_code_at_the_beginning", "")
)

if fun_config.get("print_op_args", False) == True:
Expand Down Expand Up @@ -881,13 +880,15 @@ def functions_code_gen(fun_config):
],
call_backward_impl_code=[
(
"auto result = "
+ create_call_cpp_function_code_from_schema(
fun_config["backward_schema"]
).replace("; ", ";\n")
(
"auto result = "
+ create_call_cpp_function_code_from_schema(
fun_config["backward_schema"]
).replace("; ", ";\n")
)
if "backward_schema" in fun_config
else ""
)
if "backward_schema" in fun_config
else ""
],
backward_return_code=[
fun_config.get("backward_return_code", "").replace("; ", ";\n")
Expand Down Expand Up @@ -955,9 +956,11 @@ def functions_code_gen(fun_config):
)
],
force_fallback=[
"false"
if fun_config.get("force_fallback", False) in [False, "False"]
else "true"
(
"false"
if fun_config.get("force_fallback", False) in [False, "False"]
else "true"
)
],
fallbackFunc=[
"dipu::native::"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def __init__(self, config_yaml):
detail = config[interface]
assert isinstance(detail, dict)
if "layout" in detail:
self.convert_dict[interface][
"layout"
] = self.layout2memoryformat(detail["layout"])
self.convert_dict[interface]["layout"] = (
self.layout2memoryformat(detail["layout"])
)

def layout2memoryformat(self, layout):
# used when pasing convert_config.yaml, return the memory format based on NCHW/NHWC and other layout.
Expand Down
22 changes: 0 additions & 22 deletions dipu/scripts/ci/ci_lint.sh

This file was deleted.

Loading

0 comments on commit 8d2a550

Please sign in to comment.