Skip to content

Commit 8d2a550

Browse files
authored
ci(format): add version check in run_format.sh (#753)
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.
1 parent f84d3f8 commit 8d2a550

File tree

9 files changed

+60
-7558
lines changed

9 files changed

+60
-7558
lines changed

.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
- uses: psf/black@stable
5252
with: # see: https://black.readthedocs.io/en/stable/getting_started.html
5353
src: "dipu"
54-
version: "~= 23.11.0"
54+
version: "~= 24.3.0"

dipu/scripts/autogen_diopi_wrapper/autogen_diopi_wrapper.py

+16-13
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,9 @@ def functions_code_gen(fun_config):
772772
)
773773

774774
if fun_config.get("print_func_call_info", False) == True:
775-
fun_config[
776-
"custom_code_at_the_beginning"
777-
] = create_code_to_print_fun_call_info_from_schema(fun_config) + fun_config.get(
778-
"custom_code_at_the_beginning", ""
775+
fun_config["custom_code_at_the_beginning"] = (
776+
create_code_to_print_fun_call_info_from_schema(fun_config)
777+
+ fun_config.get("custom_code_at_the_beginning", "")
779778
)
780779

781780
if fun_config.get("print_op_args", False) == True:
@@ -881,13 +880,15 @@ def functions_code_gen(fun_config):
881880
],
882881
call_backward_impl_code=[
883882
(
884-
"auto result = "
885-
+ create_call_cpp_function_code_from_schema(
886-
fun_config["backward_schema"]
887-
).replace("; ", ";\n")
883+
(
884+
"auto result = "
885+
+ create_call_cpp_function_code_from_schema(
886+
fun_config["backward_schema"]
887+
).replace("; ", ";\n")
888+
)
889+
if "backward_schema" in fun_config
890+
else ""
888891
)
889-
if "backward_schema" in fun_config
890-
else ""
891892
],
892893
backward_return_code=[
893894
fun_config.get("backward_return_code", "").replace("; ", ";\n")
@@ -955,9 +956,11 @@ def functions_code_gen(fun_config):
955956
)
956957
],
957958
force_fallback=[
958-
"false"
959-
if fun_config.get("force_fallback", False) in [False, "False"]
960-
else "true"
959+
(
960+
"false"
961+
if fun_config.get("force_fallback", False) in [False, "False"]
962+
else "true"
963+
)
961964
],
962965
fallbackFunc=[
963966
"dipu::native::"

dipu/scripts/autogen_diopi_wrapper/op_memory_format_converter.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ def __init__(self, config_yaml):
100100
detail = config[interface]
101101
assert isinstance(detail, dict)
102102
if "layout" in detail:
103-
self.convert_dict[interface][
104-
"layout"
105-
] = self.layout2memoryformat(detail["layout"])
103+
self.convert_dict[interface]["layout"] = (
104+
self.layout2memoryformat(detail["layout"])
105+
)
106106

107107
def layout2memoryformat(self, layout):
108108
# used when pasing convert_config.yaml, return the memory format based on NCHW/NHWC and other layout.

dipu/scripts/ci/ci_lint.sh

-22
This file was deleted.

0 commit comments

Comments
 (0)