Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/multi_arch_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
test_labels: ${{ needs.setup.outputs.linux_test_labels }}
rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }}
test_type: ${{ needs.setup.outputs.test_type }}
run_extended_tests: ${{ needs.setup.outputs.run_extended_tests }}
permissions:
contents: read
id-token: write
Expand All @@ -105,6 +106,7 @@ jobs:
test_labels: ${{ needs.setup.outputs.windows_test_labels }}
rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }}
test_type: ${{ needs.setup.outputs.test_type }}
run_extended_tests: ${{ needs.setup.outputs.run_extended_tests }}
permissions:
contents: read
id-token: write
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/multi_arch_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
type: string
test_type:
type: string
run_extended_tests:
type: string
default: 'false'
release_type:
description: 'Release type: "" for CI, or "dev", "nightly", "prerelease".'
type: string
Expand Down Expand Up @@ -105,15 +108,18 @@ jobs:
matrix:
family_info: ${{ fromJSON(inputs.build_config).per_family_info }}
uses: ./.github/workflows/test_artifacts.yml
secrets: inherit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's remove this

with:
# Use architecture-specific artifact group for fetching per-arch artifacts
artifact_group: ${{ matrix.family_info.amdgpu_family }}
amdgpu_families: ${{ matrix.family_info.amdgpu_family }}
amdgpu_targets: ${{ matrix.family_info.amdgpu_targets }}
test_runs_on: ${{ matrix.family_info.test-runs-on }}
benchmark_runs_on: ${{ matrix.family_info.benchmark-runs-on }}
test_type: ${{ inputs.test_type }}
test_labels: ${{ inputs.test_labels }}
sanity_check_only_for_family: ${{ matrix.family_info.sanity_check_only_for_family }}
run_extended_tests: ${{ inputs.run_extended_tests }}
release_type: ${{ inputs.release_type }}

build_python_packages:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/multi_arch_ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
type: string
test_type:
type: string
run_extended_tests:
type: string
default: 'false'
release_type:
description: 'Release type: "" for CI, or "dev", "nightly", "prerelease".'
type: string
Expand Down Expand Up @@ -110,15 +113,18 @@ jobs:
matrix:
family_info: ${{ fromJSON(inputs.build_config).per_family_info }}
uses: ./.github/workflows/test_artifacts.yml
secrets: inherit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's remove this, last i remember, the API no longer worsk

with:
# Use architecture-specific artifact group for fetching per-arch artifacts
artifact_group: ${{ matrix.family_info.amdgpu_family }}
amdgpu_families: ${{ matrix.family_info.amdgpu_family }}
amdgpu_targets: ${{ matrix.family_info.amdgpu_targets }}
test_runs_on: ${{ matrix.family_info.test-runs-on }}
benchmark_runs_on: ${{ matrix.family_info.benchmark-runs-on }}
test_type: ${{ inputs.test_type }}
test_labels: ${{ inputs.test_labels }}
sanity_check_only_for_family: ${{ matrix.family_info.sanity_check_only_for_family }}
run_extended_tests: ${{ inputs.run_extended_tests }}
release_type: ${{ inputs.release_type }}

build_python_packages:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/setup_multi_arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ on:
rocm_package_version:
description: ROCm package version (primarily for Python packages).
value: ${{ jobs.setup.outputs.rocm_package_version }}
run_extended_tests:
description: "Boolean string ('true'/'false') controlling extended test enablement (functional + benchmarks)."
value: ${{ jobs.setup.outputs.run_extended_tests }}

permissions:
contents: read
Expand All @@ -89,6 +92,7 @@ jobs:
linux_test_labels: ${{ steps.configure.outputs.linux_test_labels }}
windows_test_labels: ${{ steps.configure.outputs.windows_test_labels }}
rocm_package_version: ${{ steps.rocm_package_version.outputs.rocm_package_version }}
run_extended_tests: ${{ steps.configure.outputs.run_extended_tests }}
steps:
- name: Checking out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
13 changes: 10 additions & 3 deletions build_tools/github_actions/configure_multi_arch_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,7 @@ class TestRocmDecision(JobGroupDecision):

test_type: str = "quick"
test_type_reason: str = "default"
# TODO: Consolidate test_type, test labels, and run_functional_tests
# (from the single-arch pipeline) into a per-platform test config object
# (e.g. linux_test_config JSON) instead of separate top-level outputs.
Comment on lines -371 to -373
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add back comment, this work does not finish this

run_extended_tests: bool = False


@dataclass(frozen=True)
Expand Down Expand Up @@ -603,10 +601,14 @@ def decide_jobs(
ci_inputs=ci_inputs,
git_context=git_context,
)
run_extended_tests = ci_inputs.is_schedule or (
ci_inputs.is_workflow_dispatch and _has_test_labels(ci_inputs)
)
test_rocm = TestRocmDecision(
action=JobAction.RUN,
test_type=test_type,
test_type_reason=test_type_reason,
run_extended_tests=run_extended_tests,
)

# Other jobs run unconditionally with no configuration.
Expand Down Expand Up @@ -871,6 +873,7 @@ def _expand_build_config_for_platform(
"amdgpu_family": platform_info["family"],
"amdgpu_targets": ",".join(platform_info["fetch-gfx-targets"]),
"test-runs-on": test_runs_on,
"benchmark-runs-on": platform_info.get("benchmark-runs-on", ""),
"sanity_check_only_for_family": platform_info.get(
"sanity_check_only_for_family", False
),
Expand Down Expand Up @@ -967,12 +970,16 @@ def write_outputs(
linux = outputs.builds.linux
windows = outputs.builds.windows
test_type = outputs.jobs.test_rocm.test_type if outputs.is_ci_enabled else ""
run_extended_tests = (
outputs.jobs.test_rocm.run_extended_tests if outputs.is_ci_enabled else False
)
output_vars = {
# Workflow YAML references this as 'enable_build_jobs'
"enable_build_jobs": json.dumps(outputs.is_ci_enabled),
"linux_build_config": json.dumps(linux.to_dict()) if linux else "",
"windows_build_config": json.dumps(windows.to_dict()) if windows else "",
"test_type": test_type,
"run_extended_tests": json.dumps(run_extended_tests),
"linux_test_labels": outputs.linux_test_labels,
"windows_test_labels": outputs.windows_test_labels,
}
Expand Down
4 changes: 4 additions & 0 deletions build_tools/github_actions/configure_multi_arch_ci_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ def _append_test_rocm(lines: list[str], outputs: CIOutputs) -> None:
lines.append(
f"Test level: **{test_rocm.test_type}** ({test_rocm.test_type_reason})"
)
lines.append(
f"Extended tests (functional + benchmarks): "
f"**{'enabled' if test_rocm.run_extended_tests else 'disabled'}**"
)

# Component test labels (per platform)
if outputs.linux_test_labels:
Expand Down
117 changes: 117 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 @@ -359,6 +359,48 @@ def test_build_rocm_stage_partitioning(self):
)
self.assertEqual(decision.rebuild_stages, ["math-libs"])

# -- run_extended_tests determination --

def test_schedule_enables_extended_tests(self):
"""Schedule trigger → run_extended_tests True."""
result = cm.decide_jobs(
self._inputs(event_name="schedule"), git_context=cm.GitContext()
)
self.assertTrue(result.test_rocm.run_extended_tests)

def test_workflow_dispatch_with_labels_enables_extended_tests(self):
"""workflow_dispatch with test labels → run_extended_tests True."""
result = cm.decide_jobs(
self._inputs(
event_name="workflow_dispatch",
linux_test_labels=["test:rocprim"],
),
git_context=cm.GitContext(),
)
self.assertTrue(result.test_rocm.run_extended_tests)

def test_workflow_dispatch_without_labels_disables_extended_tests(self):
"""workflow_dispatch without test labels → run_extended_tests False."""
result = cm.decide_jobs(
self._inputs(event_name="workflow_dispatch"),
git_context=cm.GitContext(),
)
self.assertFalse(result.test_rocm.run_extended_tests)

def test_pr_disables_extended_tests(self):
"""pull_request → run_extended_tests False."""
result = cm.decide_jobs(
self._inputs(event_name="pull_request"), git_context=cm.GitContext()
)
self.assertFalse(result.test_rocm.run_extended_tests)

def test_push_disables_extended_tests(self):
"""push → run_extended_tests False."""
result = cm.decide_jobs(
self._inputs(event_name="push"), git_context=cm.GitContext()
)
self.assertFalse(result.test_rocm.run_extended_tests)


# ---------------------------------------------------------------------------
# Step 4: Select Targets
Expand Down Expand Up @@ -713,6 +755,7 @@ def test_release_produces_configs_for_both_platforms(self):
"amdgpu_family",
"amdgpu_targets",
"test-runs-on",
"benchmark-runs-on",
"sanity_check_only_for_family",
}
for config in [result.linux, result.windows]:
Expand Down Expand Up @@ -822,6 +865,21 @@ def test_no_test_runner_label_uses_default(self):
self.assertNotEqual(entry["test-runs-on"], "linux-gfx1151-gpu-rocm")
self.assertNotIn("oem", entry["test-runs-on"])

def test_benchmark_runs_on_key_always_emitted(self):
"""benchmark-runs-on key is present (as a string) even when the matrix entry omits it.

gfx94x has benchmark-runs-on in the matrix; gfx110x does not.
expand_build_configs must emit the key for both, defaulting to ''.
"""
targets = cm.TargetSelection(linux_families=["gfx94x", "gfx110x"])
result = cm.expand_build_configs(
targets=targets, ci_inputs=self._inputs(), test_type="quick"
)
self.assertIsNotNone(result.linux)
for entry in result.linux.per_family_info:
self.assertIn("benchmark-runs-on", entry)
self.assertIsInstance(entry["benchmark-runs-on"], str)


# ---------------------------------------------------------------------------
# Step 6: Format Outputs
Expand Down Expand Up @@ -869,6 +927,39 @@ def test_skipped_ci_write_outputs_summary(self):
outputs = cm.CIOutputs(is_ci_enabled=False)
cm.write_outputs(self._inputs(), outputs)

def test_write_outputs_emits_run_extended_tests(self):
"""write_outputs serialises run_extended_tests bool as 'true'/'false' string."""
jobs = cm.JobDecisions(
build_rocm=cm.BuildRocmDecision(action=cm.JobAction.RUN),
test_rocm=cm.TestRocmDecision(
action=cm.JobAction.RUN,
test_type="comprehensive",
run_extended_tests=True,
),
build_rocm_python=cm.JobGroupDecision(action=cm.JobAction.RUN),
build_pytorch=cm.JobGroupDecision(action=cm.JobAction.RUN),
test_pytorch=cm.JobGroupDecision(action=cm.JobAction.RUN),
)
outputs = cm.CIOutputs(is_ci_enabled=True, jobs=jobs)
captured = {}
with patch(
"configure_multi_arch_ci.gha_set_output",
side_effect=lambda v: captured.update(v),
):
cm.write_outputs(self._inputs(), outputs)
self.assertEqual(captured["run_extended_tests"], "true")

def test_write_outputs_skipped_ci_extended_tests_false(self):
"""Skipped CI emits run_extended_tests='false'."""
outputs = cm.CIOutputs(is_ci_enabled=False)
captured = {}
with patch(
"configure_multi_arch_ci.gha_set_output",
side_effect=lambda v: captured.update(v),
):
cm.write_outputs(self._inputs(), outputs)
self.assertEqual(captured["run_extended_tests"], "false")


# ---------------------------------------------------------------------------
# End-to-end: configure() pipeline
Expand Down Expand Up @@ -901,6 +992,32 @@ def test_pipeline_skips_when_gate_says_skip(self, mock_skip):
self.assertFalse(outputs.is_ci_enabled)
self.assertIsNone(outputs.builds.linux)

def test_schedule_pipeline_enables_extended_tests(self):
"""Schedule trigger through full pipeline → run_extended_tests True."""
inputs = cm.CIInputs(
run_id="12345",
event_name="schedule",
commit_ref="main",
base_ref="HEAD^1",
build_variant="release",
)
outputs = cm.configure(inputs, cm.GitContext())
self.assertTrue(outputs.is_ci_enabled)
self.assertTrue(outputs.jobs.test_rocm.run_extended_tests)

def test_pr_pipeline_disables_extended_tests(self):
"""PR trigger through full pipeline → run_extended_tests False."""
inputs = cm.CIInputs(
run_id="12345",
event_name="pull_request",
commit_ref="feature",
base_ref="HEAD^1",
build_variant="release",
)
outputs = cm.configure(inputs, cm.GitContext())
self.assertTrue(outputs.is_ci_enabled)
self.assertFalse(outputs.jobs.test_rocm.run_extended_tests)


# ---------------------------------------------------------------------------
# Contract: BuildConfig fields match workflow YAML references
Expand Down
Loading