Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6ee9c4a
Squashed 'external/llvm-project/' changes from 8ffe4def7d09..73f26e2f…
dhernandez0 Nov 10, 2025
1f295b3
Merge commit '6ee9c4a3f176df3b040d60dc2f1b564a6b366d1b' into 2122-nov…
dhernandez0 Nov 10, 2025
af6096a
Remove CopyInterface
dhernandez0 Nov 10, 2025
925e914
[external] external patches for rocmlir
dhernandez0 Nov 10, 2025
2995405
rocmlir changes after upstream merge
dhernandez0 Nov 10, 2025
c3888bb
[external] cherry-pick changes from https://github.com/llvm/llvm-proj…
dhernandez0 Nov 11, 2025
52e251b
[external] upstream merge missing patches
dhernandez0 Nov 11, 2025
74d0f5e
Fix pipeline test
dhernandez0 Nov 11, 2025
5cf16f5
fix tests due to patches in llvm
dhernandez0 Nov 11, 2025
2f00282
Fix wmma, mfma and tosa-conv tests
dhernandez0 Nov 11, 2025
d5fee07
Merge remote-tracking branch 'origin/develop' into 2122-november-upst…
dhernandez0 Nov 11, 2025
37b186f
[external] fix tests due to rocmlir patches
dhernandez0 Nov 11, 2025
2500c9a
Merge remote-tracking branch 'origin/develop' into 2122-november-upst…
dhernandez0 Nov 13, 2025
dd5d5cb
[external] Missing new line
dhernandez0 Nov 13, 2025
904326f
Merge branch 'develop' into 2122-november-upstream-merge
dhernandez0 Nov 14, 2025
067cd86
update librockcompiler_deps.cmake
dhernandez0 Nov 14, 2025
08e5e00
Merge branch 'develop' into 2122-november-upstream-merge
dhernandez0 Nov 14, 2025
4336f13
Merge branch 'develop' into 2122-november-upstream-merge
dhernandez0 Nov 14, 2025
2806c55
Merge branch 'develop' into 2122-november-upstream-merge
dhernandez0 Nov 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions external/llvm-project/.azuredevops/rocm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ trigger:
- '**/*.md'
- LICENSE.TXT

pr: none

jobs:
- template: ${{ variables.CI_COMPONENT_PATH }}/llvm-project.yml@pipelines_repo
18 changes: 16 additions & 2 deletions external/llvm-project/.ci/cache_lit_timing_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import glob

from google.cloud import storage
from google.api_core import exceptions

GCS_PARALLELISM = 100

Expand Down Expand Up @@ -50,7 +51,14 @@ def _maybe_download_timing_file(blob):

def download_timing_files(storage_client, bucket_name: str):
bucket = storage_client.bucket(bucket_name)
blobs = bucket.list_blobs(prefix="lit_timing")
try:
blobs = bucket.list_blobs(prefix="lit_timing")
except exceptions.ClientError as client_error:
print(
"::warning file=cache_lit_timing_files.py::Failed to list blobs "
"in bucket."
)
sys.exit(0)
with multiprocessing.pool.ThreadPool(GCS_PARALLELISM) as thread_pool:
futures = []
for timing_file_blob in blobs:
Expand All @@ -60,7 +68,13 @@ def download_timing_files(storage_client, bucket_name: str):
)
)
for future in futures:
future.get()
future.wait()
if not future.successful():
print(
"::warning file=cache_lit_timing_files.py::Failed to "
"download lit timing file."
)
continue
print("Done downloading")


Expand Down
9 changes: 3 additions & 6 deletions external/llvm-project/.ci/generate_test_report_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
"""Script to generate a build report for Github."""

import argparse
import platform

import generate_test_report_lib

PLATFORM_TITLES = {
"Windows": ":window: Windows x64 Test Results",
"Linux": ":penguin: Linux x64 Test Results",
}

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand All @@ -22,7 +17,9 @@
args = parser.parse_args()

report = generate_test_report_lib.generate_report_from_files(
PLATFORM_TITLES[platform.system()], args.return_code, args.build_test_logs
generate_test_report_lib.compute_platform_title(),
args.return_code,
args.build_test_logs,
)

print(report)
126 changes: 85 additions & 41 deletions external/llvm-project/.ci/generate_test_report_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Library to parse JUnit XML files and return a markdown report."""

from typing import TypedDict, Optional
import platform

from junitparser import JUnitXml, Failure


# This data structure should match the definition in llvm-zorg in
# premerge/advisor/advisor_lib.py
# TODO(boomanaiden154): Drop the Optional here and switch to str | None when
# we require Python 3.10.
class FailureExplanation(TypedDict):
name: str
explained: bool
reason: Optional[str]


SEE_BUILD_FILE_STR = "Download the build's log file to see the details."
UNRELATED_FAILURES_STR = (
"If these failures are unrelated to your changes (for example "
Expand Down Expand Up @@ -41,10 +55,12 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
# touch test/4.stamp
#
# index will point to the line that starts with Failed:. The progress
# indicator is the line before this ([4/5] test/4.stamp) and contains a pretty
# printed version of the target being built (test/4.stamp). We use this line
# and remove the progress information to get a succinct name for the target.
failing_action = ninja_log[index - 1].split("] ")[1]
# indicator is sometimes the line before this ([4/5] test/4.stamp) and
# will contain a pretty printed version of the target being built
# (test/4.stamp) when accurate. We instead parse the failed line rather
# than the progress indicator as the progress indicator may not be
# aligned with the failure.
failing_action = ninja_log[index].split("FAILED: ")[1]
failure_log = []
while (
index < len(ninja_log)
Expand Down Expand Up @@ -80,16 +96,29 @@ def find_failure_in_ninja_logs(ninja_logs: list[list[str]]) -> list[tuple[str, s
return failures


def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
"""Formats ninja failures into summary views for the report."""
def _format_failures(
failures: list[tuple[str, str]], failure_explanations: dict[str, FailureExplanation]
) -> list[str]:
"""Formats failures into summary views for the report."""
output = []
for build_failure in ninja_failures:
for build_failure in failures:
failed_action, failure_message = build_failure
failure_explanation = None
if failed_action in failure_explanations:
failure_explanation = failure_explanations[failed_action]
output.append("<details>")
if failure_explanation:
output.extend(
[
f"<summary>{failed_action} (Likely Already Failing)</summary>" "",
failure_explanation["reason"],
"",
]
)
else:
output.extend([f"<summary>{failed_action}</summary>", ""])
output.extend(
[
"<details>",
f"<summary>{failed_action}</summary>",
"",
"```",
failure_message,
"```",
Expand All @@ -99,6 +128,24 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
return output


def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
failures = {}
for results in junit_objects:
for testsuite in results:
for test in testsuite:
if (
not test.is_passed
and test.result
and isinstance(test.result[0], Failure)
):
if failures.get(testsuite.name) is None:
failures[testsuite.name] = []
failures[testsuite.name].append(
(test.classname + "/" + test.name, test.result[0].text)
)
return failures


# Set size_limit to limit the byte size of the report. The default is 1MB as this
# is the most that can be put into an annotation. If the generated report exceeds
# this limit and failures are listed, it will be generated again without failures
Expand All @@ -112,30 +159,25 @@ def generate_report(
ninja_logs: list[list[str]],
size_limit=1024 * 1024,
list_failures=True,
failure_explanations_list: list[FailureExplanation] = [],
):
failures = {}
failures = get_failures(junit_objects)
tests_run = 0
tests_skipped = 0
tests_failed = 0

failure_explanations: dict[str, FailureExplanation] = {}
for failure_explanation in failure_explanations_list:
if not failure_explanation["explained"]:
continue
failure_explanations[failure_explanation["name"]] = failure_explanation

for results in junit_objects:
for testsuite in results:
tests_run += testsuite.tests
tests_skipped += testsuite.skipped
tests_failed += testsuite.failures

for test in testsuite:
if (
not test.is_passed
and test.result
and isinstance(test.result[0], Failure)
):
if failures.get(testsuite.name) is None:
failures[testsuite.name] = []
failures[testsuite.name].append(
(test.classname + "/" + test.name, test.result[0].text)
)

report = [f"# {title}", ""]

if tests_run == 0:
Expand Down Expand Up @@ -168,7 +210,7 @@ def generate_report(
"",
]
)
report.extend(_format_ninja_failures(ninja_failures))
report.extend(_format_failures(ninja_failures, failure_explanations))
report.extend(
[
"",
Expand Down Expand Up @@ -204,18 +246,7 @@ def plural(num_tests):

for testsuite_name, failures in failures.items():
report.extend(["", f"### {testsuite_name}"])
for name, output in failures:
report.extend(
[
"<details>",
f"<summary>{name}</summary>",
"",
"```",
output,
"```",
"</details>",
]
)
report.extend(_format_failures(failures, failure_explanations))
elif return_code != 0:
# No tests failed but the build was in a failed state. Bring this to the user's
# attention.
Expand All @@ -240,7 +271,7 @@ def plural(num_tests):
"",
]
)
report.extend(_format_ninja_failures(ninja_failures))
report.extend(_format_failures(ninja_failures, failure_explanations))

if failures or return_code != 0:
report.extend(["", UNRELATED_FAILURES_STR])
Expand All @@ -258,7 +289,7 @@ def plural(num_tests):
return report


def generate_report_from_files(title, return_code, build_log_files):
def load_info_from_files(build_log_files):
junit_files = [
junit_file for junit_file in build_log_files if junit_file.endswith(".xml")
]
Expand All @@ -271,6 +302,19 @@ def generate_report_from_files(title, return_code, build_log_files):
ninja_logs.append(
[log_line.strip() for log_line in ninja_log_file_handle.readlines()]
)
return generate_report(
title, return_code, [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
)
return [JUnitXml.fromfile(p) for p in junit_files], ninja_logs


def generate_report_from_files(title, return_code, build_log_files):
junit_objects, ninja_logs = load_info_from_files(build_log_files)
return generate_report(title, return_code, junit_objects, ninja_logs)


def compute_platform_title() -> str:
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
# On Linux the machine value is x86_64 on Windows it is AMD64.
if platform.machine() == "x86_64" or platform.machine() == "AMD64":
arch = "x64"
else:
arch = platform.machine()
return f"{logo} {platform.system()} {arch} Test Results"
Loading