From e6d3480022b2003adbc6a3c8f5f765a2a4622d25 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 21:00:48 +0000 Subject: [PATCH 01/12] Upload integrate tools for integrate transparency --- build_tools/integrate/README.md | 6 + build_tools/integrate/llvm_bump_revision.sh | 41 ++++ .../stablehlo_tag_and_bump_version.sh | 197 ++++++++++++++++++ build_tools/update_version_h_cpp.sh | 124 ----------- 4 files changed, 244 insertions(+), 124 deletions(-) create mode 100644 build_tools/integrate/README.md create mode 100755 build_tools/integrate/llvm_bump_revision.sh create mode 100755 build_tools/integrate/stablehlo_tag_and_bump_version.sh delete mode 100755 build_tools/update_version_h_cpp.sh diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md new file mode 100644 index 0000000000..71454406e7 --- /dev/null +++ b/build_tools/integrate/README.md @@ -0,0 +1,6 @@ +# Integrate Scripts + +A collection of scripts used to integrate the StableHLO repository into the +rest of the OpenXLA repos. These scripts are run ~2x/wk by a StableHLO oncall +rotation at Google to ensure new changes can propagate to the rest of the +ecosystem in a reasonable amount of time. diff --git a/build_tools/integrate/llvm_bump_revision.sh b/build_tools/integrate/llvm_bump_revision.sh new file mode 100755 index 0000000000..8d05637fcc --- /dev/null +++ b/build_tools/integrate/llvm_bump_revision.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +GH_ACTIONS="$SCRIPT_DIR/../github_actions/" +REPO_ROOT="$SCRIPT_DIR/../.." + +# Update build files +bump_to_xla_llvm_version() { + LLVM_URL="https://raw.githubusercontent.com/openxla/xla/refs/heads/main/third_party/llvm/workspace.bzl" + LLVM_REV=$(curl -s LLVM_URL | grep 'LLVM_COMMIT =' | cut -d '"' -f 2) + echo "Bumping to LLVM commit: $LLVM_REV" + echo "$LLVM_REV" > ./build_tools/llvm_version.txt + + # Lint revision + SCRIPT_DIR="$(dirname "$(realpath "$0")")" + lint_llvm_commit.sh -f . +} + +apply_xla_patch() { + PATCH_URL="https://raw.githubusercontent.com/openxla/xla/refs/heads/main/third_party/stablehlo/temporary.patch" + PATCH=$(curl -s $PATCH_URL) + if (( $(echo "$PATCH" | wc -l) < 2 )); then + echo "Patch file is empty, skipping patch." + return 0 + fi + + TMP_DIR=$(mktemp -d) + TMP_PATCH="$TMP_DIR/temporary.patch" + echo "Cloning patch into $TMP_PATCH" + echo "$PATCH" > $TMP_PATCH + cd $REPO_ROOT + patch -p1 < $TMP_PATCH +} + +bump_to_xla_llvm_version +apply_xla_patch + +# Print the commit message +echo "Commit changes with message:" +echo "git add ." +echo "git commit -m \"Integrate LLVM at llvm/llvm-project@${LLVM_REV:0:12}\"" diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh new file mode 100755 index 0000000000..3b6b205bbe --- /dev/null +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -0,0 +1,197 @@ +#!/bin/bash + +exit_with_usage() { + echo "Usage: $0 [-t ]" + echo " -t Specify a commit to tag, must be an integrated StableHLO commit" + echo " available on https://github.com/search?q=repo%3Aopenxla%2Fxla+integrate+stablehlo&type=commits" + echo " If not specifed, will only bump the 4w and 12w versions." + exit 1 +} + +## Tag old version +tag_integrated_version() { + # Must be valid commit + if ! git rev-parse "$COMMIT" > /dev/null; then + echo "Could not find commit $COMMIT." + echo "Sync with upstream and pull changes to local repo." + exit 1 + fi + + # Ensure proper commit + # NOTE: THIS COMMIT MUST BE INTEGRATED INTO OPENXLA/XLA BY STABLEHLO ONCALL + # Valid commit hashes here: + # https://github.com/search?q=repo%3Aopenxla%2Fxla+integrate+stablehlo&type=commits + echo "Using commit:" + git log --format=%B -n 1 "$COMMIT" + echo + read -p "Is this the correct commit? [y] " -n 1 -r + echo; echo + if [[ $REPLY =~ ^[Nn]$ ]]; then + echo "Exiting..." + exit 1 + fi + + RELEASE="${VERSION[0]}.${VERSION[1]}.${VERSION[2]}" + RELEASE_TAG="v$RELEASE" + NEW_RELEASE="${VERSION[0]}.${VERSION[1]}.$((VERSION[2]+1))" + echo "Creating tagged release $RELEASE_TAG at $COMMIT" + echo "$ git tag -a $RELEASE_TAG $COMMIT -m \"StableHLO $RELEASE_TAG\"" + git tag -a $RELEASE_TAG $COMMIT -m "StableHLO $RELEASE_TAG" + echo + echo "Most recent tags:" + git tag --sort=-version:refname | head -3 + echo + echo "If this is incorrect, can undo using:" + echo "$ git tag -d $RELEASE_TAG" + echo +} + +bump_patch_version() { + ## Bump revision + echo "Bumping revision to: $NEW_VERSION_STR" + echo "$ sed -i \"s/$OLD_VERSION_STR/$NEW_VERSION_STR/\" $VERSION_H" + sed -i "s/$OLD_VERSION_STR/$NEW_VERSION_STR/" $VERSION_H + echo +} + +## Setup version variables as globals: +## VERSION, OLD_VERSION_STR, NEW_VERSION_STR +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" +VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" +setup_version_vars() { + # getCurrentVersion() { Version(0, X, Y); } + VERSION_STR=$(cat $VERSION_H | grep getCurrentVersion -A1 | grep -o 'Version([0-9], .*)') + REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" + if [[ $VERSION_STR =~ $REGEX ]] + then + VERSION=(${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}) + OLD_VERSION_STR="${BASH_REMATCH}" + NEW_VERSION_STR="Version(${VERSION[0]}, ${VERSION[1]}, $((VERSION[2]+1)))" + else + echo "Error: Could not find current version string in Version.h" >&2 + exit 1 + fi +} + +tag_and_bump() { + COMMIT="$1" + setup_version_vars + echo "Bumping version $OLD_VERSION_STR -> $NEW_VERSION_STR" + + tag_integrated_version $COMMIT + bump_patch_version + + ## Next steps + echo "NEXT STEPS" + echo " Push tag to upstream using:" + echo " $ git push upstream $RELEASE_TAG" + echo + echo " Commit and patch bump changes:" + echo " $ git add ." + echo " $ git commit -m \"Bump patch version after integrate $RELEASE -> $NEW_RELEASE\"" +} + +## Update the 4w and 12w forward compatiblility versions +# This function: +# Replaces WEEK_4 and WEEK12 versions in stablehlo/dialect/Version.cpp +# return Version(a, b, c); // WEEK_4 ANCHOR: DO NOT MODIFY +# return Version(m, n, p); // WEEK_12 ANCHOR: DO NOT MODIFY +# WEEK_4 version - The most recent git tag that was created at least 28 days ago. +# WEEK_12 version - The most recent git tag that was created at least 84 days ago. + +update_forward_compat_versions() { + echo "Bumping 4w and 12w compatibility window values" + + UTC_TIME=$(date -u +%s) + + WEEK_4_TAG="" + WEEK_12_TAG="" + + git fetch --tags upstream + + # Iterate over tags finding the proper tag + while IFS= read -r line; do + # split line CSV + IFS=',' read -r tag_ts tag_v <<< "$line" + ts_diff=$(( (UTC_TIME - tag_ts) / 86400 )) + + if [ -z "$WEEK_4_TAG" ] && [ "$ts_diff" -ge 28 ]; then + WEEK_4_TAG=$tag_v + fi + + if [ -z "$WEEK_12_TAG" ] && [ "$ts_diff" -ge 84 ]; then + WEEK_12_TAG=$tag_v + break + fi + done < <(git for-each-ref --sort=taggerdate --format '%(taggerdate:unix),%(refname:short)' refs/tags | tail -40 | tac) + + if [ -z "$WEEK_4_TAG" ] || [ -z "$WEEK_12_TAG" ]; then + echo "Error: WEEK_4 or WEEK_12 tag not found." >&2 + exit 1 + fi + + WEEK_4_TAG=$(echo "$WEEK_4_TAG" | sed -n 's/.*v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1, \2, \3/p') + WEEK_12_TAG=$(echo "$WEEK_12_TAG" | sed -n 's/.*v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1, \2, \3/p') + + if [ -z "$WEEK_4_TAG" ] || [ -z "$WEEK_12_TAG" ]; then + echo "Error: Unable to parse the WEEK_4 or WEEK_12 tag" >&2 + exit 1 + fi + + echo "New WEEK_4 Version: $WEEK_4_TAG" >&2 + echo "New WEEK_12 Version: $WEEK_12_TAG" >&2 + + sed -i -E \ + -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY)/\1$WEEK_4_TAG\5/" \ + -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY)/\1$WEEK_12_TAG\5/" \ + "$VERSION_CPP" + + + # Checking Version.cpp values + grep "WEEK_4 ANCHOR: DO NOT MODIFY" "$VERSION_CPP" >&2 + grep "WEEK_12 ANCHOR: DO NOT MODIFY" "$VERSION_CPP" >&2 + + if [ "$(grep -c -E "return Version\($WEEK_4_TAG\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY" "$VERSION_CPP")" -ne 1 ]; then + echo "ERROR: WEEK_4 version is not correct" >&2 + exit 1 + fi + + if [ "$(grep -c -E "return Version\($WEEK_12_TAG\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY" "$VERSION_CPP")" -ne 1 ]; then + echo "ERROR: WEEK_12 version is not correct" >&2 + exit 1 + fi +} + +# ------ +# MAIN +# ------ + +COMMIT_TO_TAG="" +while getopts 't:' flag; do + case "${flag}" in + t) COMMIT_TO_TAG="$OPTARG" ;; + *) exit_with_usage ;; + esac +done +shift $(( OPTIND - 1 )) + +## Validation +if [ $# -ne 0 ]; then + exit_with_usage +fi + +# Must have upstream remote - This is needed to fetch and add tags +if ! git remote | grep upstream > /dev/null; then + echo "Missing upstream remote. Use:" + echo "$ git remote add upstream https://github.com/openxla/stablehlo.git" + exit 1 +fi + +update_forward_compat_versions + +if [ -n "$COMMIT_TO_TAG" ]; then + tag_and_bump $COMMIT_TO_TAG +else + echo "No commit to tag specified, only bumping 4w and 12w values." +fi diff --git a/build_tools/update_version_h_cpp.sh b/build_tools/update_version_h_cpp.sh deleted file mode 100755 index 752cc87932..0000000000 --- a/build_tools/update_version_h_cpp.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -# Copyright 2024 The StableHLO Authors. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script: -# 1. Replaces current version in stablehlo/dialect/Version.h with the next -# patch version -# static Version getCurrentVersion() { return Version(x, y, z); } -# new version will be (x, y, z + 1) -# 2. Replaces WEEK_4 and WEEK12 versions in stablehlo/dialect/Version.cpp -# return Version(a, b, c); // WEEK_4 ANCHOR: DO NOT MODIFY -# return Version(m, n, p); // WEEK_12 ANCHOR: DO NOT MODIFY -# WEEK_4 version - The most recent git tag that was created at least 28 days ago. -# WEEK_12 version - The most recent git tag that was created at least 84 days ago. - -set -o errexit -set -o nounset -set -o pipefail - -script_dir="$(dirname "$(realpath "$0")")" -version_h="$script_dir/../stablehlo/dialect/Version.h" -version_cpp="$script_dir/../stablehlo/dialect/Version.cpp" - -fetch_current_version() { - # getCurrentVersion() { Version(X, Y, Z); } - ver_str=$(grep -A1 getCurrentVersion "$version_h" | grep -o 'Version(.*[0-9])') - REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" - if [[ $ver_str =~ $REGEX ]]; then - curr_ver=("${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}") - else - echo "Error: Could not find current version string in $version_h" >&2 - exit 1 - fi -} -fetch_current_version - -# calculate next current ver (patch ver + 1) -next_curr_z=$((curr_ver[2] + 1)) - -utc_time=$(date -u +%s) - -week_4_tag="" -week_12_tag="" - -while IFS= read -r line; do - # split line CSV - IFS=',' read -r tag_ts tag_v <<< "$line" - ts_diff=$(( (utc_time - tag_ts) / 86400 )) - - if [ -z "$week_4_tag" ] && [ "$ts_diff" -ge 28 ]; then - week_4_tag=$tag_v - fi - - if [ -z "$week_12_tag" ] && [ "$ts_diff" -ge 84 ]; then - week_12_tag=$tag_v - break - fi -done < <(git for-each-ref --sort=taggerdate --format '%(taggerdate:unix),%(refname:short)' refs/tags | tail -40 | tac) - -if [ -z "$week_4_tag" ] || [ -z "$week_12_tag" ]; then - echo "Error: WEEK_4 or WEEK_12 tag not found." >&2 - exit 1 -fi - -week_4_tag=$(echo "$week_4_tag" | sed -n 's/.*v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1, \2, \3/p') -week_12_tag=$(echo "$week_12_tag" | sed -n 's/.*v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1, \2, \3/p') - -if [ -z "$week_4_tag" ] || [ -z "$week_12_tag" ]; then - echo "Error: Unable to parse the WEEK_4 or WEEK_12 tag" >&2 - exit 1 -fi - -echo "Next Current Version: ${curr_ver[0]}, ${curr_ver[1]}, $next_curr_z" >&2 -echo "WEEK_4 Version: $week_4_tag" >&2 -echo "WEEK_12 Version: $week_12_tag" >&2 - -# Saving Version.h values -echo "Saving $version_h..." >&2 - -sed -i -E \ --e "s/(static Version getCurrentVersion\(\) \{ return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\); \})/\1\2, \3, $next_curr_z\5/" \ -"$version_h" - -# Checking Version.h values -grep "static Version getCurrentVersion()" "$version_h" >&2 - -if [ "$(grep -c "static Version getCurrentVersion() { return Version(${curr_ver[0]}, ${curr_ver[1]}, $next_curr_z); }" "$version_h")" -ne 1 ]; then - echo "ERROR: getCurrentVersion() version is not correct" >&2 - exit 1 -fi - -# Saving Version.cpp values -echo "Saving $version_cpp..." >&2 - -sed -i -E \ --e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY)/\1$week_4_tag\5/" \ --e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY)/\1$week_12_tag\5/" \ -"$version_cpp" - -# Checking Version.cpp values -grep "WEEK_4 ANCHOR: DO NOT MODIFY" "$version_cpp" >&2 -grep "WEEK_12 ANCHOR: DO NOT MODIFY" "$version_cpp" >&2 - -if [ "$(grep -c -E "return Version\($week_4_tag\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY" "$version_cpp")" -ne 1 ]; then - echo "ERROR: WEEK_4 version is not correct" >&2 - exit 1 -fi - -if [ "$(grep -c -E "return Version\($week_12_tag\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY" "$version_cpp")" -ne 1 ]; then - echo "ERROR: WEEK_12 version is not correct" >&2 - exit 1 -fi - -echo "Done" >&2 From 87311f628456e16f7bcb3d8b39fc314de81310b3 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 21:29:26 +0000 Subject: [PATCH 02/12] shellcheck --- build_tools/integrate/llvm_bump_revision.sh | 27 ++++++++++++------- .../stablehlo_tag_and_bump_version.sh | 26 +++++++++++++----- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/build_tools/integrate/llvm_bump_revision.sh b/build_tools/integrate/llvm_bump_revision.sh index 8d05637fcc..bf930491aa 100755 --- a/build_tools/integrate/llvm_bump_revision.sh +++ b/build_tools/integrate/llvm_bump_revision.sh @@ -1,7 +1,19 @@ #!/bin/bash +# Copyright 2024 The StableHLO Authors. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. SCRIPT_DIR="$(dirname "$(realpath "$0")")" -GH_ACTIONS="$SCRIPT_DIR/../github_actions/" +GH_ACTIONS="$SCRIPT_DIR/../github_actions" REPO_ROOT="$SCRIPT_DIR/../.." # Update build files @@ -10,15 +22,12 @@ bump_to_xla_llvm_version() { LLVM_REV=$(curl -s LLVM_URL | grep 'LLVM_COMMIT =' | cut -d '"' -f 2) echo "Bumping to LLVM commit: $LLVM_REV" echo "$LLVM_REV" > ./build_tools/llvm_version.txt - - # Lint revision - SCRIPT_DIR="$(dirname "$(realpath "$0")")" - lint_llvm_commit.sh -f . + "$GH_ACTIONS/lint_llvm_commit.sh" -f . } apply_xla_patch() { PATCH_URL="https://raw.githubusercontent.com/openxla/xla/refs/heads/main/third_party/stablehlo/temporary.patch" - PATCH=$(curl -s $PATCH_URL) + PATCH=$(curl -s "$PATCH_URL") if (( $(echo "$PATCH" | wc -l) < 2 )); then echo "Patch file is empty, skipping patch." return 0 @@ -27,9 +36,9 @@ apply_xla_patch() { TMP_DIR=$(mktemp -d) TMP_PATCH="$TMP_DIR/temporary.patch" echo "Cloning patch into $TMP_PATCH" - echo "$PATCH" > $TMP_PATCH - cd $REPO_ROOT - patch -p1 < $TMP_PATCH + echo "$PATCH" > "$TMP_PATCH" + cd "$REPO_ROOT" || exit 1 + patch -p1 < "$TMP_PATCH" } bump_to_xla_llvm_version diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index 3b6b205bbe..eaab6c1ad0 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -1,4 +1,16 @@ #!/bin/bash +# Copyright 2024 The StableHLO Authors. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. exit_with_usage() { echo "Usage: $0 [-t ]" @@ -26,7 +38,7 @@ tag_integrated_version() { echo read -p "Is this the correct commit? [y] " -n 1 -r echo; echo - if [[ $REPLY =~ ^[Nn]$ ]]; then + if [[ "$REPLY" =~ ^[Nn]$ ]]; then echo "Exiting..." exit 1 fi @@ -36,7 +48,7 @@ tag_integrated_version() { NEW_RELEASE="${VERSION[0]}.${VERSION[1]}.$((VERSION[2]+1))" echo "Creating tagged release $RELEASE_TAG at $COMMIT" echo "$ git tag -a $RELEASE_TAG $COMMIT -m \"StableHLO $RELEASE_TAG\"" - git tag -a $RELEASE_TAG $COMMIT -m "StableHLO $RELEASE_TAG" + git tag -a "$RELEASE_TAG" "$COMMIT" -m "StableHLO $RELEASE_TAG" echo echo "Most recent tags:" git tag --sort=-version:refname | head -3 @@ -50,7 +62,7 @@ bump_patch_version() { ## Bump revision echo "Bumping revision to: $NEW_VERSION_STR" echo "$ sed -i \"s/$OLD_VERSION_STR/$NEW_VERSION_STR/\" $VERSION_H" - sed -i "s/$OLD_VERSION_STR/$NEW_VERSION_STR/" $VERSION_H + sed -i "s/$OLD_VERSION_STR/$NEW_VERSION_STR/" "$VERSION_H" echo } @@ -61,9 +73,9 @@ VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" setup_version_vars() { # getCurrentVersion() { Version(0, X, Y); } - VERSION_STR=$(cat $VERSION_H | grep getCurrentVersion -A1 | grep -o 'Version([0-9], .*)') + VERSION_STR=$(cat "$VERSION_H" | grep getCurrentVersion -A1 | grep -o 'Version([0-9], .*)') REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" - if [[ $VERSION_STR =~ $REGEX ]] + if [[ "$VERSION_STR" =~ "$REGEX" ]] then VERSION=(${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}) OLD_VERSION_STR="${BASH_REMATCH}" @@ -79,7 +91,7 @@ tag_and_bump() { setup_version_vars echo "Bumping version $OLD_VERSION_STR -> $NEW_VERSION_STR" - tag_integrated_version $COMMIT + tag_integrated_version "$COMMIT" bump_patch_version ## Next steps @@ -191,7 +203,7 @@ fi update_forward_compat_versions if [ -n "$COMMIT_TO_TAG" ]; then - tag_and_bump $COMMIT_TO_TAG + tag_and_bump "$COMMIT_TO_TAG" else echo "No commit to tag specified, only bumping 4w and 12w values." fi From b3481463725cc94a2f3915c1266ad01886ce320f Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 21:40:44 +0000 Subject: [PATCH 03/12] Add readme details --- build_tools/integrate/README.md | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index 71454406e7..2d3d5ec81f 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -4,3 +4,40 @@ A collection of scripts used to integrate the StableHLO repository into the rest of the OpenXLA repos. These scripts are run ~2x/wk by a StableHLO oncall rotation at Google to ensure new changes can propagate to the rest of the ecosystem in a reasonable amount of time. + +## Integrate Process + +### Bump LLVM Revision + +First we bump LLVM to match that of XLA, and apply any patches the the XLA +LLVM integrate had to apply to StableHLO to build LLVM: + +``` +$ ./build_tools/integrate/llvm_bump_revision.sh +``` + +### Integarte into OpenXLA Repositories + +The StableHLO oncall then integrates the change into the google monorepo, which +propagates the new StableHLO features to XLA, Shardy, JAX, TF, etc, including +any changes or patches that were needed to build these projects with the new +feature. + +_Note: this is the only step that must be carried out by a Google team member._ + +### Tag the integrated StableHLO commit and bump StableHLO version numbers + +This step takes care of a few things: +1. Add a tag for the integrated StableHLO version +2. Bump the patch version in [Version.h](https://github.com/openxla/stablehlo/tree/main/stablehlo/dialect/Version.h#L41) +3. Bump the 4w and 12w forward compatibility requirement versions in + [Version.cpp](https://github.com/openxla/stablehlo/blob/main/stablehlo/dialect/Version.cpp#L75) + +``` +Usage: ./build_tools/integrate/stablehlo_tag_and_bump_version.sh [-t ] + -t Specify a commit to tag, must be an integrated StableHLO commit + available on https://github.com/search?q=repo%3Aopenxla%2Fxla+integrate+stablehlo&type=commits + If not specifed, will only bump the 4w and 12w versions. + +$ ./build_tools/integrate/stablehlo_tag_and_bump_version.sh -t 37487a8e +``` From 25b39ec5c68785b1f9a15a406fc9df98165b0dba Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 21:56:13 +0000 Subject: [PATCH 04/12] Update readme --- build_tools/integrate/README.md | 47 ++++++++++++++++++- build_tools/integrate/llvm_bump_revision.sh | 7 +-- .../stablehlo_tag_and_bump_version.sh | 8 ++-- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index 2d3d5ec81f..f5397f9b19 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -12,8 +12,17 @@ ecosystem in a reasonable amount of time. First we bump LLVM to match that of XLA, and apply any patches the the XLA LLVM integrate had to apply to StableHLO to build LLVM: -``` +```sh $ ./build_tools/integrate/llvm_bump_revision.sh +Using LLVM commit: b3134fa2338388adf8cfb2d77339d0b042eab9f6 +Updating LLVM Commit & SHA256 +Bumping commit to: b3134fa2338388adf8cfb2d77339d0b042eab9f6 +Bumping sha256 to: b6024606092290b0838735c26ad1c5c239b3e931136b420af8680e3a1156e759 +Patch file openxla/xla/third_party/stablehlo/temporary.patch is empty +Skipping patch apply +Commit changes with message: +git add . +git commit -m "Integrate LLVM at llvm/llvm-project@b3134fa23383" ``` ### Integarte into OpenXLA Repositories @@ -33,11 +42,45 @@ This step takes care of a few things: 3. Bump the 4w and 12w forward compatibility requirement versions in [Version.cpp](https://github.com/openxla/stablehlo/blob/main/stablehlo/dialect/Version.cpp#L75) -``` +```sh Usage: ./build_tools/integrate/stablehlo_tag_and_bump_version.sh [-t ] -t Specify a commit to tag, must be an integrated StableHLO commit available on https://github.com/search?q=repo%3Aopenxla%2Fxla+integrate+stablehlo&type=commits If not specifed, will only bump the 4w and 12w versions. $ ./build_tools/integrate/stablehlo_tag_and_bump_version.sh -t 37487a8e +Bumping 4w and 12w compatibility window values +From https://github.com/openxla/stablehlo +New WEEK_4 Version: 1, 7, 8 +New WEEK_12 Version: 1, 6, 0 + return Version(1, 7, 8); // WEEK_4 ANCHOR: DO NOT MODIFY + return Version(1, 6, 0); // WEEK_12 ANCHOR: DO NOT MODIFY +Bumping version Version(1, 8, 4) -> Version(1, 8, 5) +Using commit: +Integrate LLVM at llvm/llvm-project@246b57cb2086 (#2620) + +Is this the correct commit? [y] y + +Creating tagged release v1.8.4 at 37487a8e +$ git tag -a v1.8.4 37487a8e -m "StableHLO v1.8.4" +fatal: tag 'v1.8.4' already exists + +Most recent tags: +v1.8.4 +v1.8.3 +v1.8.2 + +If this is incorrect, can undo using: +$ git tag -d v1.8.4 + +Bumping revision to: Version(1, 8, 5) +$ sed -i "s/Version(1, 8, 4)/Version(1, 8, 5)/" /usr/local/google/home/gleasonk/Coding/openxla/stablehlo/build_tools/integrate/../../stablehlo/dialect/Version.h + +NEXT STEPS + Push tag to upstream using: + $ git push upstream v1.8.4 + + Commit and patch bump changes: + $ git add . + $ git commit -m "Bump patch version after integrate 1.8.4 -> 1.8.5" ``` diff --git a/build_tools/integrate/llvm_bump_revision.sh b/build_tools/integrate/llvm_bump_revision.sh index bf930491aa..94af7e1bf8 100755 --- a/build_tools/integrate/llvm_bump_revision.sh +++ b/build_tools/integrate/llvm_bump_revision.sh @@ -19,8 +19,8 @@ REPO_ROOT="$SCRIPT_DIR/../.." # Update build files bump_to_xla_llvm_version() { LLVM_URL="https://raw.githubusercontent.com/openxla/xla/refs/heads/main/third_party/llvm/workspace.bzl" - LLVM_REV=$(curl -s LLVM_URL | grep 'LLVM_COMMIT =' | cut -d '"' -f 2) - echo "Bumping to LLVM commit: $LLVM_REV" + LLVM_REV=$(curl -s $LLVM_URL | grep 'LLVM_COMMIT =' | cut -d '"' -f 2) + echo "Using LLVM commit: $LLVM_REV" echo "$LLVM_REV" > ./build_tools/llvm_version.txt "$GH_ACTIONS/lint_llvm_commit.sh" -f . } @@ -29,7 +29,8 @@ apply_xla_patch() { PATCH_URL="https://raw.githubusercontent.com/openxla/xla/refs/heads/main/third_party/stablehlo/temporary.patch" PATCH=$(curl -s "$PATCH_URL") if (( $(echo "$PATCH" | wc -l) < 2 )); then - echo "Patch file is empty, skipping patch." + echo "Patch file openxla/xla/third_party/stablehlo/temporary.patch is empty" + echo "Skipping patch apply" return 0 fi diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index eaab6c1ad0..e7387a9774 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -75,7 +75,7 @@ setup_version_vars() { # getCurrentVersion() { Version(0, X, Y); } VERSION_STR=$(cat "$VERSION_H" | grep getCurrentVersion -A1 | grep -o 'Version([0-9], .*)') REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" - if [[ "$VERSION_STR" =~ "$REGEX" ]] + if [[ $VERSION_STR =~ $REGEX ]] then VERSION=(${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}) OLD_VERSION_STR="${BASH_REMATCH}" @@ -155,9 +155,9 @@ update_forward_compat_versions() { echo "New WEEK_12 Version: $WEEK_12_TAG" >&2 sed -i -E \ - -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY)/\1$WEEK_4_TAG\5/" \ - -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY)/\1$WEEK_12_TAG\5/" \ - "$VERSION_CPP" + -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_4 ANCHOR: DO NOT MODIFY)/\1$WEEK_4_TAG\5/" \ + -e "s/(return Version\()([0-9]+), ([0-9]+), ([0-9]+)(\);\s+\/\/ WEEK_12 ANCHOR: DO NOT MODIFY)/\1$WEEK_12_TAG\5/" \ + "$VERSION_CPP" # Checking Version.cpp values From 2a47eacca43b61b99692544906e2413a5200706a Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 21:58:43 +0000 Subject: [PATCH 05/12] fix shellcheck --- build_tools/integrate/stablehlo_tag_and_bump_version.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index e7387a9774..adfd03ce24 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -73,12 +73,12 @@ VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" setup_version_vars() { # getCurrentVersion() { Version(0, X, Y); } - VERSION_STR=$(cat "$VERSION_H" | grep getCurrentVersion -A1 | grep -o 'Version([0-9], .*)') + VERSION_STR=$(grep getCurrentVersion -A1 "$VERSION_H" | grep -o 'Version([0-9], .*)') REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" if [[ $VERSION_STR =~ $REGEX ]] then - VERSION=(${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}) - OLD_VERSION_STR="${BASH_REMATCH}" + VERSION=("${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}") + OLD_VERSION_STR="${BASH_REMATCH[0]}" NEW_VERSION_STR="Version(${VERSION[0]}, ${VERSION[1]}, $((VERSION[2]+1)))" else echo "Error: Could not find current version string in Version.h" >&2 From 16b8acf20b5bfff662c5e3281996c071ead3b536 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 15 Nov 2024 22:02:20 +0000 Subject: [PATCH 06/12] fix shellcheck --- build_tools/integrate/README.md | 2 -- build_tools/integrate/stablehlo_tag_and_bump_version.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index f5397f9b19..22621bcea9 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -50,7 +50,6 @@ Usage: ./build_tools/integrate/stablehlo_tag_and_bump_version.sh [-t Date: Fri, 15 Nov 2024 22:03:16 +0000 Subject: [PATCH 07/12] typo fix --- build_tools/integrate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index 22621bcea9..02af9d8411 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -72,7 +72,7 @@ If this is incorrect, can undo using: $ git tag -d v1.8.4 Bumping revision to: Version(1, 8, 5) -$ sed -i "s/Version(1, 8, 4)/Version(1, 8, 5)/" /usr/local/google/home/gleasonk/Coding/openxla/stablehlo/build_tools/integrate/../../stablehlo/dialect/Version.h +$ sed -i "s/Version(1, 8, 4)/Version(1, 8, 5)/" ./stablehlo/dialect/Version.h NEXT STEPS Push tag to upstream using: From 57993b0121e1f4727c56a8ca611ac4e552912f17 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Mon, 18 Nov 2024 18:32:53 +0000 Subject: [PATCH 08/12] Add set directives --- build_tools/integrate/llvm_bump_revision.sh | 4 ++++ build_tools/integrate/stablehlo_tag_and_bump_version.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/build_tools/integrate/llvm_bump_revision.sh b/build_tools/integrate/llvm_bump_revision.sh index 94af7e1bf8..99e64073b8 100755 --- a/build_tools/integrate/llvm_bump_revision.sh +++ b/build_tools/integrate/llvm_bump_revision.sh @@ -42,6 +42,10 @@ apply_xla_patch() { patch -p1 < "$TMP_PATCH" } +set -o errexit # Exit immediately if any command returns a non-zero exit status +set -o nounset # Using uninitialized variables raises error and exits +set -o pipefail # Ensures the script detects errors in any part of a pipeline. + bump_to_xla_llvm_version apply_xla_patch diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index c37b6c32a3..b536eebfd9 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -179,6 +179,10 @@ update_forward_compat_versions() { # MAIN # ------ +set -o errexit # Exit immediately if any command returns a non-zero exit status +set -o nounset # Using uninitialized variables raises error and exits +set -o pipefail # Ensures the script detects errors in any part of a pipeline. + COMMIT_TO_TAG="" while getopts 't:' flag; do case "${flag}" in From 68d1ac0f243b211f44613cb4a70864ed4ed24e6d Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Mon, 18 Nov 2024 18:33:40 +0000 Subject: [PATCH 09/12] markdownlint --- build_tools/integrate/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index 02af9d8411..a8bf170aaf 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -37,6 +37,7 @@ _Note: this is the only step that must be carried out by a Google team member._ ### Tag the integrated StableHLO commit and bump StableHLO version numbers This step takes care of a few things: + 1. Add a tag for the integrated StableHLO version 2. Bump the patch version in [Version.h](https://github.com/openxla/stablehlo/tree/main/stablehlo/dialect/Version.h#L41) 3. Bump the 4w and 12w forward compatibility requirement versions in From 6342efec717b29efb419af9d101325bfe8e7282e Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Mon, 18 Nov 2024 22:04:18 +0000 Subject: [PATCH 10/12] use local for local vars --- .../stablehlo_tag_and_bump_version.sh | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index b536eebfd9..21b1e5777f 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -20,8 +20,30 @@ exit_with_usage() { exit 1 } +## Setup global variables: +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +VERSION="" +VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" +VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" +setup_version_vars() { + # getCurrentVersion() { Version(0, X, Y); } + local VERSION_STR=$(grep getCurrentVersion -A1 "$VERSION_H" | grep -o 'Version([0-9], .*)') + local REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" + if [[ $VERSION_STR =~ $REGEX ]] + then + VERSION=("${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}") + else + echo "Error: Could not find current version string in Version.h" >&2 + exit 1 + fi +} +setup_version_vars + ## Tag old version tag_integrated_version() { + local COMMIT="$1" + local RELEASE_TAG="$2" + # Must be valid commit if ! git rev-parse "$COMMIT" > /dev/null; then echo "Could not find commit $COMMIT." @@ -43,9 +65,6 @@ tag_integrated_version() { exit 1 fi - RELEASE="${VERSION[0]}.${VERSION[1]}.${VERSION[2]}" - RELEASE_TAG="v$RELEASE" - NEW_RELEASE="${VERSION[0]}.${VERSION[1]}.$((VERSION[2]+1))" echo "Creating tagged release $RELEASE_TAG at $COMMIT" echo "$ git tag -a $RELEASE_TAG $COMMIT -m \"StableHLO $RELEASE_TAG\"" git tag -a "$RELEASE_TAG" "$COMMIT" -m "StableHLO $RELEASE_TAG" @@ -59,39 +78,21 @@ tag_integrated_version() { } bump_patch_version() { - ## Bump revision + ## Bump patch version in Version.h + local VERSION_STR="Version(${VERSION[0]}, ${VERSION[1]}, ${VERSION[2]})" + local NEW_VERSION_STR="Version(${VERSION[0]}, ${VERSION[1]}, $((VERSION[2]+1)))" echo "Bumping revision to: $NEW_VERSION_STR" - echo "$ sed -i \"s/$OLD_VERSION_STR/$NEW_VERSION_STR/\" $VERSION_H" - sed -i "s/$OLD_VERSION_STR/$NEW_VERSION_STR/" "$VERSION_H" + echo "$ sed -i \"s/$VERSION_STR/$NEW_VERSION_STR/\" $VERSION_H" + sed -i "s/$VERSION_STR/$NEW_VERSION_STR/" "$VERSION_H" echo } -## Setup version variables as globals: -## VERSION, OLD_VERSION_STR, NEW_VERSION_STR -SCRIPT_DIR="$(dirname "$(realpath "$0")")" -VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" -VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" -setup_version_vars() { - # getCurrentVersion() { Version(0, X, Y); } - VERSION_STR=$(grep getCurrentVersion -A1 "$VERSION_H" | grep -o 'Version([0-9], .*)') - REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" - if [[ $VERSION_STR =~ $REGEX ]] - then - VERSION=("${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}") - OLD_VERSION_STR="${BASH_REMATCH[0]}" - NEW_VERSION_STR="Version(${VERSION[0]}, ${VERSION[1]}, $((VERSION[2]+1)))" - else - echo "Error: Could not find current version string in Version.h" >&2 - exit 1 - fi -} - tag_and_bump() { - COMMIT="$1" - setup_version_vars - echo "Bumping version $OLD_VERSION_STR -> $NEW_VERSION_STR" - - tag_integrated_version "$COMMIT" + local COMMIT="$1" + local RELEASE="${VERSION[0]}.${VERSION[1]}.${VERSION[2]}" + local RELEASE_TAG="v$RELEASE" + local NEXT_RELEASE="${VERSION[0]}.${VERSION[1]}.$((VERSION[2]+1))" + tag_integrated_version "$COMMIT" "$RELEASE_TAG" bump_patch_version ## Next steps @@ -101,7 +102,7 @@ tag_and_bump() { echo echo " Commit and patch bump changes:" echo " $ git add ." - echo " $ git commit -m \"Bump patch version after integrate $RELEASE -> $NEW_RELEASE\"" + echo " $ git commit -m \"Bump patch version after integrate $RELEASE -> $NEXT_RELEASE\"" } ## Update the 4w and 12w forward compatiblility versions @@ -115,10 +116,10 @@ tag_and_bump() { update_forward_compat_versions() { echo "Bumping 4w and 12w compatibility window values" - UTC_TIME=$(date -u +%s) + local UTC_TIME=$(date -u +%s) - WEEK_4_TAG="" - WEEK_12_TAG="" + local WEEK_4_TAG="" + local WEEK_12_TAG="" git fetch --tags upstream From bafd5e3cf52d01cd5d143c43c12562a966c358d4 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Mon, 18 Nov 2024 22:19:11 +0000 Subject: [PATCH 11/12] shellcheck --- build_tools/integrate/README.md | 6 ++++-- build_tools/integrate/stablehlo_tag_and_bump_version.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index a8bf170aaf..b859ffec15 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -9,8 +9,10 @@ ecosystem in a reasonable amount of time. ### Bump LLVM Revision -First we bump LLVM to match that of XLA, and apply any patches the the XLA -LLVM integrate had to apply to StableHLO to build LLVM: +The XLA repo has constant integrates of LLVM and carries a patch file for +StableHLO in [temporary.patch(https://github.com/openxla/xla/blob/main/third_party/stablehlo/temporary.patch), +which contains any changes needed to build StableHLO at a new LLVM revision. +To sync to XLA's LLVM revision and apply necessary patches, use: ```sh $ ./build_tools/integrate/llvm_bump_revision.sh diff --git a/build_tools/integrate/stablehlo_tag_and_bump_version.sh b/build_tools/integrate/stablehlo_tag_and_bump_version.sh index 21b1e5777f..b03aa107e3 100755 --- a/build_tools/integrate/stablehlo_tag_and_bump_version.sh +++ b/build_tools/integrate/stablehlo_tag_and_bump_version.sh @@ -27,7 +27,8 @@ VERSION_H="$SCRIPT_DIR/../../stablehlo/dialect/Version.h" VERSION_CPP="$SCRIPT_DIR/../../stablehlo/dialect/Version.cpp" setup_version_vars() { # getCurrentVersion() { Version(0, X, Y); } - local VERSION_STR=$(grep getCurrentVersion -A1 "$VERSION_H" | grep -o 'Version([0-9], .*)') + local VERSION_STR + VERSION_STR=$(grep getCurrentVersion -A1 "$VERSION_H" | grep -o 'Version([0-9], .*)') local REGEX="Version\(([0-9]+), ([0-9]+), ([0-9]+)\)" if [[ $VERSION_STR =~ $REGEX ]] then @@ -116,7 +117,8 @@ tag_and_bump() { update_forward_compat_versions() { echo "Bumping 4w and 12w compatibility window values" - local UTC_TIME=$(date -u +%s) + local UTC_TIME + UTC_TIME=$(date -u +%s) local WEEK_4_TAG="" local WEEK_12_TAG="" From 12e30c47f80e936a9d96c805641f766b51ae18d4 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Mon, 18 Nov 2024 22:20:23 +0000 Subject: [PATCH 12/12] markdownlint --- build_tools/integrate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/integrate/README.md b/build_tools/integrate/README.md index b859ffec15..a578713497 100644 --- a/build_tools/integrate/README.md +++ b/build_tools/integrate/README.md @@ -10,7 +10,7 @@ ecosystem in a reasonable amount of time. ### Bump LLVM Revision The XLA repo has constant integrates of LLVM and carries a patch file for -StableHLO in [temporary.patch(https://github.com/openxla/xla/blob/main/third_party/stablehlo/temporary.patch), +StableHLO in [temporary.patch](https://github.com/openxla/xla/blob/main/third_party/stablehlo/temporary.patch), which contains any changes needed to build StableHLO at a new LLVM revision. To sync to XLA's LLVM revision and apply necessary patches, use: