[Bug] Fix memory OOM in Genesis push_differentiable example #1264
Workflow file for this run
This file contains hidden or 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: Mac OS | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'release' }} | |
| jobs: | |
| build_mac_14_15: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| MAC_OS_VERSION: [15] | |
| PYTHON_VERSION: ['3.10', '3.11', '3.12', '3.13'] | |
| name: Mac OS Build | |
| runs-on: macos-${{ matrix.MAC_OS_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Python check | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.PYTHON_VERSION}} | |
| - name: Set Python CP version | |
| id: set_cp_version | |
| run: | | |
| pip install packaging | |
| cp=$(python -c "from packaging import tags; print(next(tags.sys_tags()).interpreter)") | |
| echo "PYTHON_CP_VERSION=${cp}" | |
| echo "PYTHON_CP_VERSION=${cp}" >> $GITHUB_OUTPUT | |
| - name: Mac OS X prerequisites | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/1_prerequisites.sh | |
| - name: Mac OS X build | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/2_build.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac_wheel_${{ matrix.MAC_OS_VERSION }}_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: dist/*.whl | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac_cpptests_${{ matrix.MAC_OS_VERSION }}_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: build/gstaichi_cpp_tests | |
| test: | |
| needs: build_mac_14_15 | |
| name: Test on Mac | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| MAC_OS_VERSION: [15] | |
| PYTHON_VERSION: ['3.10', '3.11', '3.12', '3.13'] | |
| include: | |
| - MAC_OS_VERSION: 14 | |
| PYTHON_VERSION: '3.10' | |
| runs-on: macos-${{ matrix.MAC_OS_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Python check | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.PYTHON_VERSION}} | |
| - name: Set Python CP version | |
| id: set_cp_version | |
| run: | | |
| pip install packaging | |
| cp=$(python -c "from packaging import tags; print(next(tags.sys_tags()).interpreter)") | |
| echo "PYTHON_CP_VERSION=${cp}" | |
| echo "PYTHON_CP_VERSION=${cp}" >> $GITHUB_OUTPUT | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: mac_wheel_15_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: mac_cpptests_15_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: build | |
| - name: Mac OS X install | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/3_install.sh | |
| - name: Mac OS X test | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/4_test.sh | |
| upload_to_storage: | |
| name: Mac wheel upload | |
| runs-on: ubuntu-22.04 | |
| needs: build_mac_14_15 | |
| strategy: | |
| matrix: | |
| MAC_OS_VERSION: [15] | |
| PYTHON_CP_VERSION: [cp310, cp311, cp312, cp313] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_STORAGE_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_STORAGE_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: mac_wheel_${{ matrix.MAC_OS_VERSION }}_${{ matrix.PYTHON_CP_VERSION }} | |
| - name: 'Upload wheel to aws s3 storage' | |
| run: | | |
| set -x | |
| ls -l *.whl | |
| mkdir -p dist | |
| mv *.whl dist/ | |
| aws s3 sync dist/ s3://genesis-ai-compiler/ci/gstaichi/${GITHUB_SHA:0:7}/mac-${{ matrix.MAC_OS_VERSION }}-${{ matrix.PYTHON_CP_VERSION }}/ | |
| publish_pypi: | |
| uses: ./.github/workflows/publish_pypi.yml | |
| if: github.event_name == 'release' | |
| needs: test | |
| permissions: | |
| id-token: write | |
| contents: read | |
| concurrency: | |
| # group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.PYTHON_CP_VERSION }}-${{ matrix.PYTHON_CP_VERSION != 'cp310' && 'all' || github.sha }}-test | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.PYTHON_CP_VERSION }}-test | |
| cancel-in-progress: true | |
| strategy: | |
| matrix: | |
| PYTHON_CP_VERSION: ["cp310", "cp311", "cp312", "cp313"] | |
| MAC_OS_VERSION: [15] | |
| fail-fast: false | |
| with: | |
| artifact_name: mac_wheel_${{ matrix.MAC_OS_VERSION }}_${{ matrix.PYTHON_CP_VERSION }} | |
| secrets: inherit |