Skip to content

Commit 5517462

Browse files
committed
Merge branch 'main' into patch/mlir/shapecast-broadcast
2 parents 32c870b + 6e94dc3 commit 5517462

File tree

4,475 files changed

+222700
-104763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,475 files changed

+222700
-104763
lines changed

.ci/metrics/metrics_test.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Tests for metrics.py"""
5+
6+
from dataclasses import dataclass
7+
import requests
8+
import unittest
9+
import unittest.mock
10+
11+
import metrics
12+
13+
14+
class TestMetrics(unittest.TestCase):
15+
def test_upload_gauge_metric(self):
16+
"""Test that we can upload a gauge metric correctly.
17+
18+
Also verify that we pass around parameters like API keys and user IDs
19+
correctly to the HTTP POST request.
20+
"""
21+
test_metrics = [metrics.GaugeMetric("gauge_test", 5, 1000)]
22+
return_value = requests.Response()
23+
return_value.status_code = 204
24+
with unittest.mock.patch(
25+
"requests.post", return_value=return_value
26+
) as post_mock:
27+
metrics.upload_metrics(test_metrics, "test_userid", "test_api_key")
28+
self.assertSequenceEqual(post_mock.call_args.args, [metrics.GRAFANA_URL])
29+
self.assertEqual(
30+
post_mock.call_args.kwargs["data"], "gauge_test value=5 1000"
31+
)
32+
self.assertEqual(
33+
post_mock.call_args.kwargs["auth"], ("test_userid", "test_api_key")
34+
)
35+
36+
def test_upload_job_metric(self):
37+
"""Test that we can upload a job metric correctly."""
38+
test_metrics = [
39+
metrics.JobMetrics("test_job", 5, 10, 1, 1000, 7, "test_workflow")
40+
]
41+
return_value = requests.Response()
42+
return_value.status_code = 204
43+
with unittest.mock.patch(
44+
"requests.post", return_value=return_value
45+
) as post_mock:
46+
metrics.upload_metrics(test_metrics, "test_userid", "test_aoi_key")
47+
self.assertEqual(
48+
post_mock.call_args.kwargs["data"],
49+
"test_job queue_time=5,run_time=10,status=1 1000",
50+
)
51+
52+
def test_upload_unknown_metric(self):
53+
"""Test we report an error if we encounter an unknown metric type."""
54+
55+
@dataclass
56+
class FakeMetric:
57+
fake_data: str
58+
59+
test_metrics = [FakeMetric("test")]
60+
61+
with self.assertRaises(ValueError):
62+
metrics.upload_metrics(test_metrics, "test_userid", "test_api_key")
63+
64+
def test_bad_response_code(self):
65+
"""Test that we gracefully handle HTTP response errors."""
66+
test_metrics = [metrics.GaugeMetric("gauge_test", 5, 1000)]
67+
return_value = requests.Response()
68+
return_value.status_code = 403
69+
# Just assert that we continue running here and do not raise anything.
70+
with unittest.mock.patch("requests.post", return_value=return_value) as _:
71+
metrics.upload_metrics(test_metrics, "test_userid", "test_api_key")
72+
73+
74+
if __name__ == "__main__":
75+
unittest.main()

.git-blame-ignore-revs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,40 @@ d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
106106
ce46adb8b7ce645353eccaedf31ed9765dab77bb
107107
68070f908bb7ac5f0b5fa9722caa504ecf723f6b
108108
5213c57cb1f0d78aad9a253b7f6a2b62ff4c7859
109+
110+
# [mlir] Update create method
111+
9e7834cadf48292b5d127d6d98f9e6d565ed5d9a
112+
284a5c2c0b97edddf255ea210f939203ad3d09f2
113+
c090ed53fb73f59cf221f5610430af8047758117
114+
fcbcfe44cff00101a6a98a73971398eb8dd87710
115+
258daf539583b80e0217d1d87941412d65cf16aa
116+
c610b244937ed847b0275ccb038c0f2d36310b4a
117+
b58ad3650f2195117f484d551ffbada27e7d1e14
118+
258d04c810ab10f101324cbf1fe3c7be65eb1938
119+
a6bf40d1c6cf010b3ad90bf7f410983453f4deb2
120+
dcfc853c51aecf6538182378c016f8e1604e7e97
121+
3f74334c38120bbdefac012d478dfce8e4eb0906
122+
a636b7bfdd1d8304b78e8b42ec900a21736d4afb
123+
75aa7065dcf653de7870758cd502a7c714f4bcd7
124+
2f5312563fd5cb2e355ec49109f3e63875337c7c
125+
967626b842551ecd997c0d10eb68c3015b63a3d7
126+
588845defd09359a8b87db339b563af848cf45a7
127+
b0434925c98c9a8906afea60a1304c870b1f574a
128+
8fff238b2c363b036ce9e7bf7abab3acafc87ab2
129+
38976a03cd367b27437e0d1e81c0ccaee2777b47
130+
eaa67a3cf041009ae33a45159d0465262c3af5dc
131+
b0312be6aa664e4cb9abec6d080e971493093d05
132+
2736fbd8324bf21a130c8abd4bd0e7d3aa840ac1
133+
4ae9fdca8af095afd91705f8dd143e93b304b6fb
134+
f904cdd6c3049e605d24ed17680e80e7133908a0
135+
972ac59c9af4ad47af0b3542ae936b3470727e5f
136+
7b787965431e666858fdf66db25ee5a129833927
137+
c3823af156b517d926a56e3d0d585e2a15720e96
138+
dce6679cf5cbbdaffb9c2b51dc762c5c6689ea78
139+
9844ba6d9740206129b52633c555f767eaa45581
140+
5547c6cd03ddddd405a09e51624e1f19955a85b1
141+
a3a007ad5fa20abc90ead4e1030b481bf109b4cf
142+
46f6df0848ea04449c6179ecdedc404ee5b5cf11
143+
b7e332d3f59f567b1999fbcc660d7837cba8e406
144+
6056f942abe83b05406df8b04e95ec37a3d160b5
145+
906295b8a31c8dac5aa845864c0bca9f02f86184

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,16 @@
120120
/mlir/**/Index* @mogball
121121

122122
# MLIR Python Bindings
123-
/mlir/test/python/ @ftynse @makslevental @stellaraccident
124-
/mlir/python/ @ftynse @makslevental @stellaraccident
123+
/mlir/test/python/ @ftynse @makslevental @stellaraccident @rolfmorel
124+
/mlir/python/ @ftynse @makslevental @stellaraccident @rolfmorel
125+
/mlir/lib/Bindings/Python @makslevental @rolfmorel
125126

126127
# MLIR Mem2Reg/SROA
127128
/mlir/**/Transforms/Mem2Reg.* @moxinilian
128129
/mlir/**/Transforms/SROA.* @moxinilian
129130

130131
# BOLT
131-
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis
132+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis @yozhu
132133

133134
# Bazel build system.
134135
/utils/bazel/ @rupprecht @keith @aaronmondal

.github/workflows/check-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- name: Install Python Dependencies
3232
run: |
3333
pip3 install -r .ci/all_requirements.txt
34+
pip3 install -r .ci/metrics/requirements.lock.txt
3435
pip3 install pytest==8.4.1
3536
- name: Run Tests
3637
working-directory: .ci

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ RUN powershell -Command \
9090
RUN git config --system core.longpaths true & \
9191
git config --global core.autocrlf false
9292
93-
ARG RUNNER_VERSION=2.327.0
93+
ARG RUNNER_VERSION=2.327.1
9494
ENV RUNNER_VERSION=$RUNNER_VERSION
9595
9696
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ RUN apt-get update && \
5858
python3-psutil \
5959
sudo \
6060
# These are needed by the premerge pipeline. Pip is used to install
61-
# dependent python packages and ccache is used for build caching. File and
62-
# tzdata are used for tests.
61+
# dependent python packages. File and tzdata are used for tests.
6362
python3-pip \
64-
ccache \
6563
file \
6664
tzdata && \
6765
apt-get clean && \
@@ -96,7 +94,7 @@ WORKDIR /home/gha
9694

9795
FROM ci-container as ci-container-agent
9896

99-
ENV GITHUB_RUNNER_VERSION=2.327.0
97+
ENV GITHUB_RUNNER_VERSION=2.327.1
10098

10199
RUN mkdir actions-runner && \
102100
cd actions-runner && \

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@ jobs:
2121
- os: ubuntu-24.04
2222
build_type: Debug
2323
ccache-variant: sccache
24-
c_compiler: clang-21
25-
cpp_compiler: clang++-21
24+
c_compiler: clang-20
25+
cpp_compiler: clang++-20
2626
target: x86_64-unknown-linux-llvm
2727
include_scudo: ON
2828
- os: ubuntu-24.04
2929
build_type: Release
3030
ccache-variant: sccache
31-
c_compiler: clang-21
32-
cpp_compiler: clang++-21
31+
c_compiler: clang-20
32+
cpp_compiler: clang++-20
3333
target: x86_64-unknown-linux-llvm
3434
include_scudo: ON
3535
- os: ubuntu-24.04
3636
build_type: MinSizeRel
3737
ccache-variant: sccache
38-
c_compiler: clang-21
39-
cpp_compiler: clang++-21
38+
c_compiler: clang-20
39+
cpp_compiler: clang++-20
4040
target: x86_64-unknown-linux-llvm
4141
include_scudo: ON
4242
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
4343
- os: ubuntu-24.04-arm
4444
build_type: Debug
4545
ccache-variant: ccache
46-
c_compiler: clang-21
47-
cpp_compiler: clang++-21
46+
c_compiler: clang-20
47+
cpp_compiler: clang++-20
4848
target: aarch64-unknown-linux-llvm
4949
include_scudo: ON
5050
- os: ubuntu-24.04
5151
build_type: Debug
5252
ccache-variant: ccache
53-
c_compiler: clang-21
54-
cpp_compiler: clang++-21
53+
c_compiler: clang-20
54+
cpp_compiler: clang++-20
5555
target: x86_64-unknown-uefi-llvm
5656
include_scudo: OFF
5757
# TODO: add back gcc build when it is fixed
@@ -81,7 +81,7 @@ jobs:
8181
run: |
8282
wget https://apt.llvm.org/llvm.sh
8383
chmod +x llvm.sh
84-
sudo ./llvm.sh 21
84+
sudo ./llvm.sh 20
8585
sudo apt-get update
8686
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
8787
sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
'generic-abi-unstable',
129129
'generic-hardening-mode-debug',
130130
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
131132
'generic-hardening-mode-fast',
132133
'generic-hardening-mode-fast-with-abi-breaks',
133134
'generic-merged',

.github/workflows/libcxx-build-containers.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ on:
1818
- 'libcxx/utils/ci/**'
1919
- '.github/workflows/libcxx-build-containers.yml'
2020
pull_request:
21-
branches:
22-
- main
2321
paths:
2422
- 'libcxx/utils/ci/**'
2523
- '.github/workflows/libcxx-build-containers.yml'
@@ -36,7 +34,9 @@ jobs:
3634

3735
- name: Build the Linux builder image
3836
working-directory: libcxx/utils/ci
39-
run: docker compose build actions-builder
37+
run: |
38+
docker compose build builder-base
39+
docker compose build actions-builder
4040
env:
4141
TAG: ${{ github.sha }}
4242

@@ -57,6 +57,7 @@ jobs:
5757
if: github.event_name == 'push'
5858
working-directory: libcxx/utils/ci
5959
run: |
60+
docker compose push builder-base
6061
docker compose push actions-builder
6162
env:
6263
TAG: ${{ github.sha }}

.github/workflows/premerge.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
# why we do not hardcode it.
6363
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
6464
export SCCACHE_GCS_RW_MODE=READ_WRITE
65+
66+
# Set the idle timeout to zero to ensure sccache runs for the
67+
# entire duration of the job. Otherwise it might stop if we run
68+
# several test suites in a row and discard statistics that we want
69+
# to save in the end.
70+
export SCCACHE_IDLE_TIMEOUT=0
6571
sccache --start-server
6672
6773
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
@@ -110,7 +116,9 @@ jobs:
110116
shell: cmd
111117
run: |
112118
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
113-
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
119+
# See the comments above in the Linux job for why we define each of
120+
# these environment variables.
121+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
114122
- name: Upload Artifacts
115123
if: '!cancelled()'
116124
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

0 commit comments

Comments
 (0)