diff --git a/.github/workflows/amd-aie-distro.yml b/.github/workflows/amd-aie-distro.yml index 46abbb009379..d41b8cc5dd46 100644 --- a/.github/workflows/amd-aie-distro.yml +++ b/.github/workflows/amd-aie-distro.yml @@ -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: @@ -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: | @@ -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 @@ -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: | @@ -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 @@ -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 197001010000 {} \; + # git-bash doesn't have rename - name: rename non-windows if: contains(matrix.OS, 'ubuntu') || contains(matrix.OS, 'macos') @@ -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 @@ -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' diff --git a/.github/workflows/amd_aie_releases/setup.py b/.github/workflows/amd_aie_releases/setup.py index 194dac177aea..2b745d8a4900 100644 --- a/.github/workflows/amd_aie_releases/setup.py +++ b/.github/workflows/amd_aie_releases/setup.py @@ -241,6 +241,23 @@ def build_extension(self, ext: CMakeExtension) -> None: ) shutil.rmtree(install_dir / "python_packages", ignore_errors=True) + subprocess.run( + [ + "find", + ".", + "-exec", + "touch", + "-a", + "-m", + "-t", + "197001010000", + "{}", + ";", + ], + cwd=install_dir, + check=False, + ) + def check_env(build): return os.environ.get(build, 0) in {"1", "true", "True", "ON", "YES"}