Skip to content

Commit

Permalink
add ccache debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed May 1, 2024
1 parent e760778 commit 8e24208
Showing 1 changed file with 40 additions and 27 deletions.
67 changes: 40 additions & 27 deletions .github/workflows/amd-aie-distro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ jobs:

steps:

- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: .github/workflows/amd_aie_releases
# Turning off cone mode ensures that files in the project root are not included during checkout
sparse-checkout-cone-mode: false

- uses: makslevental/mlir-wheels/actions/setup_base@b3d5c60b3c6f51e9ce9015e5c3529efc07919f21
id: setup_base
with:
Expand All @@ -195,13 +202,6 @@ jobs:
MATRIX_ARCH: ${{ matrix.ARCH }}
WORKSPACE_ROOT: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}

- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: .github/workflows/amd_aie_releases
# Turning off cone mode ensures that files in the project root are not included during checkout
sparse-checkout-cone-mode: false

# This step is needed because action/checkout does not support paths.
- name: Copy stuff to workspace_root
run: |
Expand Down Expand Up @@ -247,6 +247,13 @@ jobs:
echo "HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"" >> $GITHUB_ENV
echo "PARALLEL_LEVEL=2" >> $GITHUB_ENV
echo "PIP_FIND_LINKS=https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest" >> $GITHUB_ENV
echo "CCACHE_DEBUG=1" >> $GITHUB_ENV
WORKSPACE_ROOT="${{ steps.setup_base.outputs.WORKSPACE_ROOT }}"
if [[ "${{ matrix.OS }}" == *"windows"* ]]; then
WORKSPACE_ROOT=$(cygpath -u $WORKSPACE_ROOT)
fi
echo "CCACHE_DEBUGDIR=$WORKSPACE_ROOT/ccache-debug" >> $GITHUB_ENV
# build

Expand All @@ -267,24 +274,6 @@ jobs:
export RUN_TESTS=0
pip wheel . -v -w wheelhouse
- name: Download cache from container ubuntu
if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'x86_64') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache -s
rm -rf $HOST_CCACHE_DIR
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- name: Reset datetime ccache
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache --print-stats
find $HOST_CCACHE_DIR -exec touch -a -m -t "${{ needs.settings.outputs.DATETIME }}00" {} \;
- name: Clean llvm-aie
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
Expand All @@ -293,7 +282,7 @@ jobs:
rm -rf build
- name: Docker prune
if: contains(matrix.OS, 'ubuntu')
if: contains(inputs.MATRIX_OS, 'ubuntu')
run: |
docker system prune -a -f
Expand All @@ -305,6 +294,24 @@ jobs:
WHL=$(ls wheelhouse/llvm_aie-*whl)
echo "LLVM_AIE_WHEEL_VERSION=$(python -c "import pkginfo; w = pkginfo.Wheel('$WHL'); print(w.version.split('+')[0] + '+' + w.version.split('+')[1].rsplit('.', 1)[-1])")" | tee -a $GITHUB_OUTPUT
- name: Download cache from container ubuntu
if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'x86_64') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache -s
rm -rf $HOST_CCACHE_DIR
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- name: Reset datetime ccache
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache --print-stats
find $HOST_CCACHE_DIR -exec touch -a -m -t "${{ needs.settings.outputs.DATETIME }}00" {} \;
# git-bash doesn't have rename
- name: rename non-windows
if: contains(matrix.OS, 'ubuntu') || contains(matrix.OS, 'macos')
Expand Down Expand Up @@ -352,7 +359,7 @@ jobs:
pushd native_tools
LLVM_AIE_WHEEL_VERSION=${{ steps.get_wheel_version.outputs.LLVM_AIE_WHEEL_VERSION }} \
python setup.py bdist_wheel --dist-dir ../wheelhouse --plat $PLAT
python setup.py bdist_wheel --dist-dir ../wheelhouse --plat $PLAT
popd
Expand All @@ -365,6 +372,12 @@ jobs:
path: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}/wheelhouse/*.whl
name: build_artifact

- name: Upload ccache debug log
uses: actions/upload-artifact@v3
with:
path: ${{ env.CCACHE_DEBUGDIR }}
name: ccache_debugdir

upload_distro_wheels:

if: needs.settings.outputs.UPLOAD_ARTIFACTS == 'true'
Expand Down

0 comments on commit 8e24208

Please sign in to comment.