Skip to content

Commit 6fe4fa0

Browse files
authored
[backend](fix) remove lib-call no-inline option (#1923)
Stop passing --enable-lib-call-no-inline=false to bishengir-compile for Ascend950 targets. The explicit override changes vendor code generation and regresses kernels that worked before it was introduced. Remove the target and compiler-capability helpers that were only used to append this option. (cherry picked from commit 8e833b8) Signed-off-by: zhanwei33 <22679270+zhanwei33@users.noreply.github.com> Co-authored-by: zhanwei33 <22679270+zhanwei33@users.noreply.github.com>
1 parent 5377005 commit 6fe4fa0

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

third_party/ascend/backend/compiler.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -505,23 +505,6 @@ def get_common_bishengir_compile_options(metadata):
505505
return [bishengir_target_opt]
506506

507507

508-
def _needs_lib_call_no_inline(metadata):
509-
"""Return whether the target needs the CANN 9.1 hacc.noinline workaround."""
510-
arch = metadata['target'].arch
511-
return arch.startswith("Ascend950")
512-
513-
514-
@functools.lru_cache()
515-
def _npu_compiler_supports_option(compiler_path: str, option: str) -> bool:
516-
"""Check an optional BiShengIR flag instead of assuming toolchain parity."""
517-
try:
518-
result = subprocess.run([compiler_path, "--help"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
519-
timeout=10, check=False)
520-
except (OSError, subprocess.SubprocessError):
521-
return False
522-
return option in result.stdout
523-
524-
525508
def get_auto_bind_sub_block_option(metadata):
526509
# auto_tile_and_bind_subblock is read from the module.
527510
# enable_auto_bind_sub_block is set by the user and has a higher priority.
@@ -735,9 +718,6 @@ def linalg_to_bin_enable_npu_compile_910_95(linalg: str, metadata, opt):
735718
"--enable-hfusion-compile=true",
736719
"--enable-triton-kernel-compile=true",
737720
]
738-
if (_needs_lib_call_no_inline(metadata)
739-
and _npu_compiler_supports_option(npu_compiler_path, "--enable-lib-call-no-inline")):
740-
_compile_option_list += ["--enable-lib-call-no-inline=false"]
741721
bisheng_options = metadata["bisheng_options"]
742722
if bisheng_options is not None:
743723
_compile_option_list += [f"--append-bisheng-options={bisheng_options}"]
@@ -948,9 +928,6 @@ def linalg_to_bin_enable_npu_compile_A2_A3(linalg: str, metadata, opt):
948928
bishengir_hivm_opt,
949929
"--enable-triton-kernel-compile=true",
950930
]
951-
if (_needs_lib_call_no_inline(metadata)
952-
and _npu_compiler_supports_option(npu_compiler_path, "--enable-lib-call-no-inline")):
953-
_compile_option_list += ["--enable-lib-call-no-inline=false"]
954931

955932
_compile_option_list += ["--mlir-print-ir-after-failure"]
956933
_compile_option_list += ["--mlir-print-stacktrace-on-diagnostic"]

0 commit comments

Comments
 (0)