"...git@developer.sourcefind.cn:jerrrrry/infinicore.git" did not exist on "784139b9aa59c2a9381e30e152c1555f3b542840"
Unverified Commit a0f00654 authored by Tim Moon's avatar Tim Moon Committed by GitHub
Browse files

GitHub actions for JAX and TensorFlow (#104)



* GitHub actions for linting JAX code

Pylint is disabled since JAX container is not publicly available.
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

* GitHub action for building JAX code

Disabled since JAX container is not publicly available.
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

* Add GitHub actions for TensorFlow and license checking
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

* Debug GitHub action for license checking
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

* Use TensorFlow container for GitHub JAX tests
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>

---------
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>
parent a2e19b7a
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
# See LICENSE for license information. # See LICENSE for license information.
# A workflow to trigger TE build on GitHub # A workflow to trigger TE build on GitHub
name: 'Test build' name: 'Build'
on: on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
pyTorch: pytorch:
name: 'pyTorch build' name: 'PyTorch'
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: nvcr.io/nvidia/pytorch:22.09-py3 image: nvcr.io/nvidia/pytorch:23.03-py3
options: --user root options: --user root
steps: steps:
- name: 'Checkout' - name: 'Checkout'
...@@ -20,29 +20,57 @@ jobs: ...@@ -20,29 +20,57 @@ jobs:
- name: 'Build' - name: 'Build'
run: | run: |
mkdir -p wheelhouse && \ mkdir -p wheelhouse && \
pip wheel -w wheelhouse . -v NVTE_FRAMEWORK=pytorch pip wheel -w wheelhouse . -v
- name: 'Upload wheel' - name: 'Upload wheel'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: te_wheel name: te_wheel_pyt
path: wheelhouse/transformer_engine*.whl path: wheelhouse/transformer_engine*.whl
retention-days: 7 retention-days: 7
- name: 'Install' - name: 'Install'
run: pip install --no-cache-dir wheelhouse/transformer_engine*.whl run: pip install --no-cache-dir wheelhouse/transformer_engine*.whl
- name: 'Sanity check' - name: 'Sanity check'
run: python tests/pytorch/test_sanity_import.py run: python tests/pytorch/test_sanity_import.py
TensorFlow: jax:
name: 'TensorFlow build' name: 'JAX'
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: nvcr.io/nvidia/tensorflow:23.02-tf2-py3 #image: nvcr.io/nvidia/jax:XX.XX-py3 # Not yet available
image: nvcr.io/nvidia/tensorflow:23.03-tf2-py3
options: --user root options: --user root
steps: steps:
- name: 'Checkout' - name: 'Checkout'
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: 'Build' - name: 'Build'
run: | run: |
apt-get update && apt-get install -y ninja-build pybind11-dev apt-get -y update && \
apt -y install ninja-build pybind11-dev && \
pip install --upgrade "jax[cuda12_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html && \
mkdir -p wheelhouse && \
NVTE_FRAMEWORK=jax pip wheel -w wheelhouse . -v
- name: 'Upload wheel'
uses: actions/upload-artifact@v3
with:
name: te_wheel_jax
path: wheelhouse/transformer_engine*.whl
retention-days: 7
- name: 'Install'
run: pip install --no-cache-dir wheelhouse/transformer_engine*.whl
- name: 'Sanity check'
run: python tests/jax/test_sanity_import.py
tensorflow:
name: 'TensorFlow'
runs-on: ubuntu-latest
container:
image: nvcr.io/nvidia/tensorflow:23.03-tf2-py3
options: --user root
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Build'
run: |
apt-get -y update && \
apt -y install ninja-build pybind11-dev && \
mkdir -p wheelhouse && \ mkdir -p wheelhouse && \
NVTE_FRAMEWORK=tensorflow pip wheel -w wheelhouse . -v NVTE_FRAMEWORK=tensorflow pip wheel -w wheelhouse . -v
- name: 'Upload wheel' - name: 'Upload wheel'
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
# See LICENSE for license information. # See LICENSE for license information.
# A workflow to trigger the build of TE documentation on GitHub # A workflow to trigger the build of TE documentation on GitHub
name: 'Build documentation' name: 'Documentation'
on: on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
workflow_call: workflow_call:
jobs: jobs:
build_docs: build_docs:
name: 'Build'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Checkout' - name: 'Checkout'
......
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.
# A workflow to trigger the TE license check on GitHub
name: 'License'
on:
pull_request:
workflow_dispatch:
jobs:
check:
name: 'Check'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Check License'
run: |
export TE_PATH=.
bash ./qa/L0_license/test.sh
...@@ -2,37 +2,87 @@ ...@@ -2,37 +2,87 @@
# #
# See LICENSE for license information. # See LICENSE for license information.
# A workflow to trigger C++ lint test on GitHub # A workflow to trigger lint tests on GitHub
name: 'Lint test' name: 'Lint'
on: on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
cpplint: pytorch_cpplint:
name: C++ name: 'PyTorch C++'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Lint - name: 'Lint'
run: | run: |
cp qa/L0_lint/CPPLINT.cfg .
export CPP_ONLY=1 export CPP_ONLY=1
export TE_PATH=. export TE_PATH=.
bash ./qa/L0_lint/test.sh bash ./qa/L0_lint/test.sh
pylint: pytorch_pylint:
name: Python name: 'PyTorch Python'
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: nvcr.io/nvidia/pytorch:22.09-py3 image: nvcr.io/nvidia/pytorch:23.03-py3
options: --user root options: --user root
steps: steps:
- name: Checkout - name: 'Checkout'
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Lint - name: 'Lint'
run: | run: |
cp qa/L0_lint/pylintrc .
export PYTHON_ONLY=1 export PYTHON_ONLY=1
export TE_PATH=. export TE_PATH=.
bash ./qa/L0_lint/test.sh bash ./qa/L0_lint/test.sh
jax_cpplint:
name: 'JAX C++'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Lint'
run: |
export CPP_ONLY=1
export TE_PATH=.
bash ./qa/L0_jax_lint/test.sh
jax_pylint:
name: 'JAX Python'
runs-on: ubuntu-latest
container:
#image: nvcr.io/nvidia/jax:XX.XX-py3 # Not yet available
image: nvcr.io/nvidia/tensorflow:23.03-tf2-py3
options: --user root
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Lint'
run: |
pip install --upgrade "jax[cuda12_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
pip install flax
export PYTHON_ONLY=1
export TE_PATH=.
bash ./qa/L0_jax_lint/test.sh
tensorflow_cpplint:
name: 'TensorFlow C++'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Lint'
run: |
export CPP_ONLY=1
export TE_PATH=.
bash ./qa/L0_tensorflow_lint/test.sh
tensorflow_pylint:
name: 'TensorFlow Python'
runs-on: ubuntu-latest
container:
image: nvcr.io/nvidia/tensorflow:23.03-tf2-py3
options: --user root
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Lint'
run: |
export PYTHON_ONLY=1
export TE_PATH=.
bash ./qa/L0_tensorflow_lint/test.sh
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.
try:
import transformer_engine.jax
te_imported = True
except:
te_imported = False
assert te_imported, 'transformer_engine import failed'
print("OK")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment