Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
9 changes: 6 additions & 3 deletions .github/workflows/multi_arch_ci_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ on:
type: string
default: ""
description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set"
pull_request:
types:
- labeled
- opened
- synchronize

permissions:
contents: read
Expand Down Expand Up @@ -86,6 +91,4 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: |
python build_tools/github_actions/workflow_summary.py \
--workflow-name="${{ github.workflow }}" \
--run-id="${{ github.run_id }}" \
--run-attempt="${{ github.run_attempt }}"
--needs-json '${{ toJSON(needs) }}'
2 changes: 1 addition & 1 deletion build_tools/github_actions/amdgpu_family_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def select_build_runner(platform: str, build_variant: str) -> str:
}, # core42 (8/29)
],
# TODO(#3433): Remove sandbox label once ASAN tests are passing
"test-runs-on-sandbox": "rocm-asan-mi325-sandbox",
"test-runs-on-sandbox": "",
# 8-GPU distribution: 11N (cirrascale) + 7N (core42)
"test-runs-on-multi-gpu": "linux-gfx942-8gpu-ossci-rocm",
"test-runs-on-multi-gpu-labels": [
Expand Down
14 changes: 14 additions & 0 deletions build_tools/github_actions/configure_multi_arch_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,20 @@ def should_skip_ci(
print(" Skipping: 'ci:skip' PR label")
return True

# Skip ASAN on PRs unless submodule changes are present.
# This avoids running expensive ASAN builds on every PR while still
# catching ASAN issues when library code (submodules) changes.
if (
ci_inputs.is_pull_request
and ci_inputs.build_variant == "asan"
and git_context.changed_files is not None
and git_context.submodule_paths is not None
):
matching = set(git_context.submodule_paths) & set(git_context.changed_files)
if not matching:
print(" Skipping: ASAN PR without submodule changes")
return True
Comment on lines +504 to +518

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People are going to send their own [draft] PRs that include submodule updates outside of our regularly scheduled bumps, and this is going to run expensive ASan builds on those PRs.

I bet we'll want a system like https://github.com/iree-org/iree/blob/fbe60d8c0fc391d5f64fe0a71bca330f7bff445c/build_tools/github_actions/configure_ci.py#L203-L212

Let's keep an eye on this. Probably worth a TODO or more details in the comment.


# If we have a list of changed files (push/pull_request events), check if
# CI should run for that set of changed files. For example: if only .md
# files are changed, skip CI.
Expand Down
2 changes: 1 addition & 1 deletion build_tools/github_actions/tests/configure_ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def test_sandbox_test_runner_with_asan(self):
platform="linux",
)
entry = linux_target_output[0]
self.assertEqual(entry["test-runs-on"], "rocm-asan-mi325-sandbox")
self.assertEqual(entry["test-runs-on"], "")

###########################################################################
# Tests for multi-label runner selection
Expand Down
36 changes: 36 additions & 0 deletions build_tools/github_actions/tests/configure_multi_arch_ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,42 @@ def test_none_changed_files_skips_path_filter(self, mock_filter):
self.assertFalse(cm.should_skip_ci(inputs, git))
mock_filter.assert_not_called()

def test_asan_pr_without_submodule_change_skips(self):
"""ASAN PR without submodule changes skips CI."""
inputs = self._inputs(build_variant="asan", pr_labels=[])
git = cm.GitContext(
changed_files=["CMakeLists.txt", "build_tools/script.py"],
submodule_paths=["rocm-libraries", "rocm-systems"],
)
self.assertTrue(cm.should_skip_ci(inputs, git))

def test_asan_pr_with_submodule_change_runs(self):
"""ASAN PR with submodule changes runs CI."""
inputs = self._inputs(build_variant="asan", pr_labels=[])
git = cm.GitContext(
changed_files=["rocm-libraries", "CMakeLists.txt"],
submodule_paths=["rocm-libraries", "rocm-systems"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))

def test_asan_non_pr_runs_regardless_of_submodule(self):
"""ASAN on schedule/push runs regardless of submodule changes."""
inputs = self._inputs(event_name="schedule", build_variant="asan")
git = cm.GitContext(
changed_files=None,
submodule_paths=["rocm-libraries"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))

def test_release_pr_without_submodule_change_runs(self):
"""Release variant PR without submodule changes still runs (not skipped)."""
inputs = self._inputs(build_variant="release", pr_labels=[])
git = cm.GitContext(
changed_files=["CMakeLists.txt"],
submodule_paths=["rocm-libraries"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))


# ---------------------------------------------------------------------------
# Step 3: Decide Jobs
Expand Down
Loading