fix(autotuner): disable async compilation for functions not directly decorated with @triton.jit
Co-authored-by: Xuan Peng<pengxuan9@huawei.com>
# message auto-generated for no-merge-commit merge:
!1279 merge fix/autotune-issue-0212 into main
fix(autotuner): disable async compilation for functions not directly decorated with @triton.jit
Created-by: HinPeng
Commit-by: Xuan Peng
Merged-by: ascend-robot
Description: ## Description
This PR fixes a bug in autotuner where asynchronous compilation mode was enabled even for functions that are not directly decorated with @triton.jit.
Currently, autotuner unconditionally sets async_compile = True when it is constructed, regardless of the nature of the wrapped function. Asynchronous compilation relies on the function being a direct triton.jit kernel (i.e., having the expected attributes and being compiled via the Triton JIT pipeline). However, in some cases the function passed to autotuner is indirectly jitted, for example when it is wrapped by libentry() or other utility decorators. This leads to runtime errors since other decorators may not compatible with AsyncCompileMode yet.
## Solution:
Disable async compilation unless self.fn is a direct instance of a triton.jit function.
See merge request: Ascend/triton-ascend!1279