Skip to content

Commit

Permalink
show less verbose log
Browse files Browse the repository at this point in the history
  • Loading branch information
AshburnLee committed Sep 24, 2024
1 parent 74dc4a2 commit 01b1aef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/auto-update-translator-cid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,18 @@ jobs:
- name: Search the latest valid Translator cid
if: ${{ env.TARGET_PRID == null }}
run: |
env
./scripts/check-update-translator-cid.sh $CID_LATEST $CID_CURRENT
touch test_summary.log
./scripts/check-update-translator-cid.sh $CID_LATEST $CID_CURRENT test_summary.log
if git status --porcelain ./lib/Target/SPIRV/spirv-llvm-translator.conf | grep '^ M'; then
echo "MODIFIED=true" >> $GITHUB_ENV
echo "spirv-llvm-translator.conf has been modified"
fi
- name: Show summary of failed commit id
if: ${{ env.TARGET_PRID == null }}
run: |
cat test_summary.log
# raise PR by bot
- name: Create PR if config is updated
if: ${{ env.TARGET_PRID == null && env.MODIFIED == 'true' }}
Expand Down
11 changes: 7 additions & 4 deletions scripts/check-update-translator-cid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -euo pipefail
# $1 is the latest commit id from SPIRV-LLVM-Translator
# $2 is the commit id from Triton's spirv-llvm-translator.conf

if [ "$#" -ne 2 ]; then
echo "Please provide commit id from Translator and from spirv-llvm-translator.conf. Usage: $0 cid1 cid2"
if [ "$#" -ne 3 ]; then
echo "Please provide commit id from Translator and from spirv-llvm-translator.conf. Usage: $0 cid1 cid2 log"
exit 1
fi

Expand All @@ -24,21 +24,24 @@ COMMIT_IDS=$(git -C $TRITON_PROJ/external/SPIRV-LLVM-Translator log --format="%H
# check every commit ids
cd $TRITON_PROJ
FOUND=false
# TEST_FAILED="test_failed_$(date +%Y%m%d%H%M%S)"
for cid in $COMMIT_IDS; do
echo "$cid" > ./lib/Target/SPIRV/spirv-llvm-translator.conf
if ! ./scripts/compile-triton.sh --clean; then
# if ! ./scripts/compile-triton.sh --clean; then
if ! echo $PWD; then
echo "Triton compile failed for translator commit $cid"
continue
fi

# execute default tests
if ./scripts/test-triton.sh --skip-pytorch-install; then
if test_out=$(./scripts/test-triton.sh --skip-pytorch-install 2>&1); then
echo "Tests passed for translator commit $cid"
echo "A newer commit found: $cid"
FOUND=true
break
else
echo "Tests failed for translator commit $cid"
echo -e "cid: ${cid}:\n$(echo "$test_out" | grep '^FAILED')\n" >> "$3"
fi
done

Expand Down
2 changes: 1 addition & 1 deletion scripts/compile-triton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ build_triton() {

cd python
# Install triton and its dependencies.
pip install -vvv -e '.[build,tests]'
pip install -v -e '.[build,tests]'

# Copy compile_commands.json in the build directory (so that cland vscode plugin can find it).
cp $(find $TRITON_PROJ_BUILD -name compile_commands.json) $TRITON_PROJ/
Expand Down

0 comments on commit 01b1aef

Please sign in to comment.