Bump third_party/lib_xud from 4dd7607
to 32dc9a2
#241
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: xmos-ai-tools-release-beta | |
on: | |
pull_request_target: | |
types: | |
- closed | |
branches: | |
- develop | |
env: | |
BAZEL_CACHE_URL: https://storage.googleapis.com/bazel_remote_cache_0/gh_actions | |
jobs: | |
macos-release-wheel: | |
if: github.event.pull_request.merged == true | |
name: Build release wheels for macOS | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: google-github-actions/auth@v0 | |
continue-on-error: true | |
with: | |
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }} | |
- name: Build macOS wheels | |
shell: bash | |
run: | | |
python --version | |
python -m pip install wheel setuptools setuptools-scm numpy six --no-cache-dir | |
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro | |
make patch | |
cd $GITHUB_WORKSPACE | |
make build | |
cd $GITHUB_WORKSPACE/experimental/xformer | |
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then | |
echo "using Google Cloud Storage cache" | |
echo -e 'build --remote_cache=${{ env.BAZEL_CACHE_URL }}/${{ runner.os }}-${{ runner.arch }}-python${{ matrix.python-version }}' >> .bazelrc.user | |
echo -e 'build --google_default_credentials' >> .bazelrc.user | |
fi | |
bazelisk build //:xcore-opt --copt=-fvisibility=hidden --copt=-mavx --copt=-mmacosx-version-min=10.13 --linkopt=-mmacosx-version-min=10.13 --linkopt=-dead_strip --distinct_host_configuration=false --//:disable_version_check | |
cd $GITHUB_WORKSPACE/python | |
python setup.py bdist_wheel --plat macosx_10_9_x86_64 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ runner.os }}-wheels | |
path: python/dist | |
macos-arm-release-wheel: | |
if: github.event.pull_request.merged == true | |
name: Build release wheels for macOS arm64 | |
runs-on: macos-11 | |
strategy: | |
matrix: | |
python-version: [3.8] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: google-github-actions/auth@v0 | |
continue-on-error: true | |
with: | |
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }} | |
- name: Build macOS arm wheels | |
env: | |
CMAKE_ENABLE_DARWIN_TARGET_ARM64: 1 | |
shell: bash | |
run: | | |
python --version | |
python -m pip install wheel setuptools setuptools-scm numpy six --no-cache-dir | |
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro | |
make patch | |
cd $GITHUB_WORKSPACE | |
make build | |
cd $GITHUB_WORKSPACE/experimental/xformer | |
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then | |
echo "using Google Cloud Storage cache" | |
echo -e 'build --remote_cache=${{ env.BAZEL_CACHE_URL }}/${{ runner.os }}-arm64-python${{ matrix.python-version }}' >> .bazelrc.user | |
echo -e 'build --google_default_credentials' >> .bazelrc.user | |
fi | |
bazelisk build //:xcore-opt --cpu=darwin_arm64 --copt=-fvisibility=hidden --copt=-mmacosx-version-min=11.0 --linkopt=-mmacosx-version-min=11.0 --linkopt=-dead_strip --//:disable_version_check | |
cd $GITHUB_WORKSPACE/python | |
python setup.py bdist_wheel --plat-name macosx_11_0_arm64 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ runner.os }}-arm-wheels | |
path: python/dist | |
manylinux-release-wheel: | |
if: github.event.pull_request.merged == true | |
name: Build release wheels for manylinux2014 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: google-github-actions/auth@v0 | |
continue-on-error: true | |
with: | |
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }} | |
- name: Build manylinux2014 wheels | |
# auditwheel requires patchelf and repairs the created wheel file to | |
# be compatible for manylinux. | |
run: | | |
pushd $GITHUB_WORKSPACE/experimental/xformer | |
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then | |
echo "using Google Cloud Storage cache" | |
echo -e 'build --remote_cache=${{ env.BAZEL_CACHE_URL }}/${{ runner.os }}-${{ runner.arch }}-python${{ matrix.python-version }}' >> .bazelrc.user | |
echo -e 'build --google_default_credentials' >> .bazelrc.user | |
fi | |
popd | |
docker run \ | |
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcloud-credentials.json \ | |
-v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/gcloud-credentials.json:ro \ | |
-v ${PWD}:/ai_tools -w /ai_tools \ | |
tensorflow/build:2.10-python${{ matrix.python-version }} \ | |
.github/scripts/build_linux_wheel.sh | |
sudo apt-get -y -qq install patchelf --no-install-recommends | |
python -m pip install auditwheel==5.2.0 --no-cache-dir | |
cd python | |
for f in dist/*.whl; do | |
auditwheel repair --plat manylinux2014_x86_64 $f | |
done | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ runner.os }}-wheels | |
# auditwheel creates the output wheel in the wheelhouse folder | |
path: python/wheelhouse | |
windows-release-wheel: | |
if: github.event.pull_request.merged == true | |
name: Build release wheels for windows | |
runs-on: windows-2019 | |
strategy: | |
matrix: | |
python-version: [3.8] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: google-github-actions/auth@v0 | |
continue-on-error: true | |
with: | |
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }} | |
- name: Configure pagefile | |
uses: al-cheb/[email protected] | |
with: | |
minimum-size: 10GB | |
maximum-size: 20GB | |
- name: Set up pagefile | |
shell: pwsh | |
run: | | |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize | |
- name: Build xcore-opt and xtflm-interpreter | |
shell: cmd | |
run: | | |
python --version | |
python -m pip install wheel setuptools setuptools-scm numpy six --no-cache-dir | |
python -c "import sys; print(sys.executable)" | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
cd %GITHUB_WORKSPACE%/third_party/lib_tflite_micro/lib_tflite_micro/submodules/tflite-micro | |
patch -p0 < ../../../patches/tflite-micro.patch | |
cd %GITHUB_WORKSPACE%/python/xmos_ai_tools/xinterpreters/host | |
mkdir -p build | |
cd build | |
cmake .. | |
cmake --build . -t install --parallel --config Release | |
cd %GITHUB_WORKSPACE%/experimental/xformer | |
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC | |
bazelisk build //:xcore-opt --local_ram_resources=5120 --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.8.10/x64/python.exe" --remote_cache=${{ env.BAZEL_CACHE_URL }}/${{ runner.os }}-${{ runner.arch }}-python${{ matrix.python-version }} --google_default_credentials --//:disable_version_check | |
- name: Build windows wheels | |
shell: cmd | |
run: | | |
cd python | |
python setup.py bdist_wheel | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ runner.os }}-wheels | |
path: python/dist | |
publish-wheels: | |
if: github.event.pull_request.merged == true | |
name: Publish wheels to PyPi | |
needs: [macos-release-wheel, macos-arm-release-wheel, manylinux-release-wheel, windows-release-wheel] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: macOS-wheels | |
path: macOS-wheels | |
if: ${{ needs.macos-release-wheel.result == 'success' }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: macOS-arm-wheels | |
path: macOS-arm-wheels | |
if: ${{ needs.macos-arm-release-wheel.result == 'success' }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Linux-wheels | |
path: Linux-wheels | |
if: ${{ needs.manylinux-release-wheel.result == 'success' }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Windows-wheels | |
path: Windows-wheels | |
if: ${{ needs.windows-release-wheel.result == 'success' }} | |
- run: | | |
set -x | |
mkdir -p dist | |
cp macOS-wheels/*.whl dist/ || true | |
cp macOS-arm-wheels/*.whl dist/ || true | |
cp Linux-wheels/*.whl dist/ || true | |
cp Windows-wheels/*.whl dist/ || true | |
ls -la dist/ | |
sha256sum dist/*.whl | |
- name: Publish packages to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |