Skip to content

Commit

Permalink
Re-organize the OSS workflows (#2209)
Browse files Browse the repository at this point in the history
Summary:
- Re-organize the OSS workflows to de-duplicate jobs

Pull Request resolved: #2209

Reviewed By: spcyppt

Differential Revision: D52102704

Pulled By: q10

fbshipit-source-id: 6eca3b0c05cdcfb80d06e9e2fad0a96b851d8879
  • Loading branch information
q10 authored and facebook-github-bot committed Dec 13, 2023
1 parent 6c5d308 commit 157f935
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 110 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/fbgemm_gpu_ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

name: FBGEMM_GPU-CPU Nightly Build
# This workflow is used for FBGEMM_GPU-CPU CI as well as nightly builds of
# FBGEMM_GPU-CPU against PyTorch-CPU Nightly.
name: FBGEMM_GPU-CPU CI

on:
# PR Trigger (enabled for regression checks and debugging)
Expand Down Expand Up @@ -103,7 +105,7 @@ jobs:
- name: Prepare FBGEMM_GPU Build
run: . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV

- name: Build FBGEMM_GPU Nightly (CPU version)
- name: Build FBGEMM_GPU Wheel
run: . $PRELUDE; cd fbgemm_gpu; build_fbgemm_gpu_package $BUILD_ENV nightly cpu

- name: Upload Built Wheel as GHA Artifact
Expand Down Expand Up @@ -175,7 +177,7 @@ jobs:
- name: Prepare FBGEMM_GPU Build
run: . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV

- name: Install FBGEMM_GPU Nightly (CPU version)
- name: Install FBGEMM_GPU Wheel
run: |
. $PRELUDE
pwd; ls -la .
Expand All @@ -185,8 +187,74 @@ jobs:
timeout-minutes: 15
run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV cpu

- name: Push FBGEMM_GPU Nightly (CPU version) Binary to PYPI
- name: Push Wheel to PyPI
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'true') }}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: . $PRELUDE; publish_to_pypi $BUILD_ENV fbgemm_gpu_nightly_cpu-*.whl "$PYPI_TOKEN"


build_and_test_ubuntu:
runs-on: ${{ matrix.host-machine.instance }}
container:
image: ${{ matrix.container-image }}
options: --user root
defaults:
run:
shell: bash
env:
PRELUDE: .github/scripts/setup_env.bash
BUILD_ENV: build_binary
strategy:
fail-fast: false
matrix:
host-machine: [
{ arch: x86, instance: "linux.4xlarge" },
{ arch: arm, instance: "linux.arm64.2xlarge" },
]
container-image: [ "ubuntu:20.04", "ubuntu:22.04" ]
python-version: [ "3.11" ]

steps:
- name: Setup Build Container
run: |
apt update -y
apt install -y binutils build-essential git pciutils sudo wget
git config --global --add safe.directory '*'
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: true

- name: Display System Info
run: . $PRELUDE; print_system_info

- name: Display GPU Info
run: . $PRELUDE; print_gpu_info

- name: Setup Miniconda
run: . $PRELUDE; setup_miniconda $HOME/miniconda

- name: Create Conda Environment
run: . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }}

- name: Install Build Tools
run: . $PRELUDE; install_build_tools $BUILD_ENV

- name: Install PyTorch
run: . $PRELUDE; install_pytorch_pip $BUILD_ENV nightly cpu

- name: Collect PyTorch Environment Info
if: ${{ success() || failure() }}
run: . $PRELUDE; collect_pytorch_env_info $BUILD_ENV

- name: Prepare FBGEMM_GPU Build
run: . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV

- name: Build + Install FBGEMM_GPU (CPU version)
run: . $PRELUDE; cd fbgemm_gpu; build_fbgemm_gpu_install $BUILD_ENV cpu

- name: Test FBGEMM_GPU-CPU Nightly Installation
timeout-minutes: 15
run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV cpu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

name: FBGEMM_GPU-CUDA Nightly Build
# This workflow is used for FBGEMM_GPU-CUDA CI as well as nightly builds of
# FBGEMM_GPU-CUDA against PyTorch-CUDA Nightly.
name: FBGEMM_GPU-CUDA CI

on:
# PR Trigger (enabled for regression checks and debugging)
Expand Down Expand Up @@ -109,7 +111,7 @@ jobs:
- name: Prepare FBGEMM_GPU Build
run: . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV

- name: Build FBGEMM_GPU Nightly
- name: Build FBGEMM_GPU Wheel
run: . $PRELUDE; cd fbgemm_gpu; build_fbgemm_gpu_package $BUILD_ENV nightly cuda

- name: Upload Built Wheel as GHA Artifact
Expand Down Expand Up @@ -185,14 +187,14 @@ jobs:
- name: Prepare FBGEMM_GPU Build
run: . $PRELUDE; cd fbgemm_gpu; prepare_fbgemm_gpu_build $BUILD_ENV

- name: Install FBGEMM_GPU Nightly
- name: Install FBGEMM_GPU Wheel
run: . $PRELUDE; install_fbgemm_gpu_wheel $BUILD_ENV *.whl

- name: Test with PyTest
timeout-minutes: 15
run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV

- name: Push FBGEMM_GPU Nightly Binary to PYPI
- name: Push Wheel to PyPI
if: ${{ (github.event_name == 'schedule' && matrix.cuda-version == matrix.cuda-version-publish) || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'true' && matrix.cuda-version == matrix.cuda-version-publish) }}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# This workflow is used for both CI as well as nightly builds against
# PyTorch-ROCm Nightly.
# This workflow is used for FBGEMM_GPU-ROCm CI as well as nightly builds of
# FBGEMM_GPU-ROCm against PyTorch-ROCm Nightly.
name: FBGEMM_GPU-ROCm CI

on:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/fbgemm_gpu_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# This workflow is used for testing the download and installation of FBGEMM_GPU
# nightly releases published to PyTorch PyPI.
name: FBGEMM_GPU PIP Install + Test

on:
Expand Down Expand Up @@ -179,8 +181,8 @@ jobs:
host-machine: [
{ instance: "rocm" },
]
# ROCm machines are limited, so we only test against Python 3.10
python-version: [ "3.10" ]
# ROCm machines are limited, so we only test a subset of Python versions
python-version: [ "3.11", "3.12" ]
rocm-version: [ "5.7" ]

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# This workflow is used for building and publishing FBGEMM_GPU-CPU release
# builds against PyTorch-CPU Release to public PyPI.
name: FBGEMM_GPU-CPU Release Build

on:
# PR Trigger (enabled for regression checks and debugging)
#
pull_request:
branches:
- main
- ^v([0-9]+)\.([0-9]+)\.([0-9]+)-release

# Push Trigger (enable to catch errors coming out of multiple merges)
#
push:
branches:
- main
- ^v([0-9]+)\.([0-9]+)\.([0-9]+)-release

# Manual Trigger
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# This workflow is used for building and publishing FBGEMM_GPU-CUDA release
# builds against PyTorch-CUDA Release to public PyPI.
name: FBGEMM_GPU-CUDA Release Build

on:
# PR Trigger (enabled for regression checks and debugging)
#
pull_request:
branches:
- main
- ^v([0-9]+)\.([0-9]+)\.([0-9]+)-release

# Push Trigger (enable to catch errors coming out of multiple merges)
#
push:
branches:
- main
- ^v([0-9]+)\.([0-9]+)\.([0-9]+)-release

# Manual Trigger
#
Expand Down

0 comments on commit 157f935

Please sign in to comment.