Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/format.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,28 @@ jobs:
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-17
sudo apt-get install -y clang-format-15

- name: Check changed files
run: |
set -euo pipefail

if [ "${{ github.event_name }}" = "pull_request" ]; then
diff_range="${{ github.event.pull_request.base.sha }}...HEAD"
elif [ "${{ github.event_name }}" = "push" ] && \
[ -n "${{ github.event.before }}" ] && \
[ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
diff_range="${{ github.event.before }}..${{ github.sha }}"
else
default_branch="${{ github.event.repository.default_branch }}"
git fetch --no-tags --prune origin \
"+refs/heads/${default_branch}:refs/remotes/origin/${default_branch}"
diff_range="origin/${default_branch}...HEAD"
fi

echo "Checking files changed in ${diff_range}"
git diff --diff-filter=d --name-only \
origin/${{ github.base_ref }}...HEAD \
"${diff_range}" -- \
> all_changed_files.txt

awk '/\.(cc|cpp|cxx|h|hpp)$/ && $0 !~ /^third_party\// { print }' \
Expand All @@ -60,7 +76,7 @@ jobs:
exit 0
fi

xargs -a changed_files.txt clang-format-17 --dry-run -Werror
xargs -r -a changed_files.txt clang-format-15 --dry-run -Werror

python-black:
needs: markdownlint
Expand Down
6 changes: 3 additions & 3 deletions backend/ascend_autotune_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _ascend_autotune_fn():
"""Lazy singleton accessor for ascend ``autotune``."""
global _ASCEND_AUTOTUNE
if _ASCEND_AUTOTUNE is None:
from .ascend_autotune_runtime.autotuner import autotune as _fn
from .ascend_autotune_runtime.ascend_kernel_autotuner import autotune as _fn

_ASCEND_AUTOTUNE = _fn
return _ASCEND_AUTOTUNE
Expand All @@ -58,7 +58,7 @@ def _ascend_max_autotune_fn():
"""Lazy singleton accessor for ascend ``max_autotune``."""
global _ASCEND_MAX_AUTOTUNE
if _ASCEND_MAX_AUTOTUNE is None:
from .ascend_autotune_runtime.autotuner import max_autotune as _fn
from .ascend_autotune_runtime.ascend_kernel_autotuner import max_autotune as _fn

_ASCEND_MAX_AUTOTUNE = _fn
return _ASCEND_MAX_AUTOTUNE
Expand All @@ -68,7 +68,7 @@ def _ascend_max_autotune_fn():
# Proxies (installed once on import of this module)
# ------------------------------------------------------------------
def _autotune_proxy(configs, key, **kwargs):
if _is_ascend_backend():
if _is_ascend_backend() or kwargs.get("hints") is not None:
return _ascend_autotune_fn()(configs=configs, key=key, **kwargs)
from triton.runtime.autotuner import autotune as _stock

Expand Down
26 changes: 22 additions & 4 deletions backend/ascend_autotune_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Adapted for DLCompiler (triton.backends.dicp_triton).
"""

from .autoparser import (
from .kernel_ast_analyzer import (
AutoParser,
AxesKeyParser,
SplitAxesParser,
Expand All @@ -13,13 +13,22 @@
LowDimsAxesParser,
PtrNumsParser,
)
from .tile_generator import AxisInfo, BlockInfo, KernelMeta, TileGenerator
from .compile_options import (
from .tile_candidate_generator import AxisInfo, BlockInfo, KernelMeta, TileGenerator
from .schedule_profiles import (
CompileOptionsSpec,
CompileFailureRegionSet,
classify_compile_failure,
compile_profile_to_config,
effective_compile_profile_key,
expand_compile_option_configs,
generate_linked_compile_neighbors,
get_stage1_probe_configs,
get_stage1_probe_profiles,
make_stage2_seed_profiles,
parse_compile_options_hint,
validate_compile_profile,
)
from .autotuner import (
from .ascend_kernel_autotuner import (
AutoTilingTuner,
autotune,
max_autotune,
Expand All @@ -46,8 +55,17 @@
"KernelMeta",
"TileGenerator",
"CompileOptionsSpec",
"CompileFailureRegionSet",
"classify_compile_failure",
"compile_profile_to_config",
"effective_compile_profile_key",
"expand_compile_option_configs",
"generate_linked_compile_neighbors",
"get_stage1_probe_configs",
"get_stage1_probe_profiles",
"make_stage2_seed_profiles",
"parse_compile_options_hint",
"validate_compile_profile",
"AutoTilingTuner",
"autotune",
"max_autotune",
Expand Down
Loading
Loading