Skip to content

Commit

Permalink
Merge branch 'unifyai:main' into add_unique
Browse files Browse the repository at this point in the history
  • Loading branch information
bilal-aamer authored Aug 23, 2023
2 parents 5ece37f + 27636cc commit 8be1b4d
Show file tree
Hide file tree
Showing 322 changed files with 9,378 additions and 4,878 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/array-api-det-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
destination-repository-name: 'Mapping'
user-email: rashul.chutani@gmail.com
commit-message: Update Array API Tests Mapping
target-branch: master
target-branch: main
2 changes: 1 addition & 1 deletion .github/workflows/array-api-intelligent-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Determine Tests
run: |
git clone -b master https://github.com/unifyai/Mapping.git --depth 1
git clone -b main https://github.com/unifyai/Mapping.git --depth 1
pip install pydriller
cp Mapping/tests.pbz2 ivy/
cd ivy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/array-api-intelligent-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
source ./ivy/clone_mapping.sh master
source ./ivy/clone_mapping.sh main
pip install pydriller pymongo
cp Mapping/tests.pbz2 ivy/
cd ivy
Expand All @@ -39,7 +39,7 @@ jobs:
cd Mapping
git add .
git commit -m "Update Mapping"
git push origin master
git push origin main
continue-on-error: true

- name: Run Tests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/det-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: determine-test-coverage
name: Determine Test Coverage
on:
workflow_dispatch:
schedule:
- cron: "30 20 * * 6"

permissions:
actions: read
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dockerfile-multicuda-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dockerfile MultiCUDA Push

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest-4-cores

steps:
- name: Checkout 🛎 Ivy
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}


- name: Build and push Dockerfile
run: |
docker build --progress=plain --no-cache -t unifyai/multicuda:base_and_requirements -f docker/DockerfileGPUMultiCuda .
docker push unifyai/multicuda:base_and_requirements
20 changes: 0 additions & 20 deletions .github/workflows/dockerfilegpu-image.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/dockerfilegpu-push.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: pypi
on:
push:
workflow_call:
jobs:
upload-if-tagged-commit:
Expand All @@ -19,7 +18,12 @@ jobs:
python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine
- name: Upload to Pypi
- name: Add Tag to Version
run: |
cd ivy
echo "__version__ = '${{ github.ref_name }}'" > ivy/_version.py
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags')
env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ivy-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ jobs:
continue-on-error: true

- name: Install Mongo Python Client
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: BSFishy/pip-action@v1
with:
packages: |
pymongo[srv]
- name: Update Database
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
env:
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ivy-experimental-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ jobs:
continue-on-error: true

- name: Install Mongo Python Client
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.check_file_changed.outputs.changed == 'True'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_file_changed.outputs.changed == 'True'
uses: BSFishy/pip-action@v1
with:
packages: |
pymongo[srv]
- name: Update Database
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.check_file_changed.outputs.changed == 'True'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_file_changed.outputs.changed == 'True'
env:
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ivy-experimental-nn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ jobs:
continue-on-error: true

- name: Install Mongo Python Client
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.check_file_changed.outputs.changed == 'True'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_file_changed.outputs.changed == 'True'
uses: BSFishy/pip-action@v1
with:
packages: |
pymongo[srv]
- name: Update Database
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.check_file_changed.outputs.changed == 'True'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_file_changed.outputs.changed == 'True'
env:
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ivy-nn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ jobs:
continue-on-error: true

- name: Install Mongo Python Client
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: BSFishy/pip-action@v1
with:
packages: |
pymongo[srv]
- name: Update Database
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
env:
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ivy-stateful.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ jobs:
continue-on-error: true

- name: Install Mongo Python Client
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: BSFishy/pip-action@v1
with:
packages: |
pymongo[srv]
- name: Update Database
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/master')
if: (steps.check_file_changed.outputs.changed == 'True' && github.event_name == 'push' && github.ref == 'refs/heads/main')
env:
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
run: |
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
language_version: python3
args:
- "--preview"
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
rev: v2.2.0
hooks:
- id: autoflake
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
exclude: ^.*__init__.py$
- repo: https://github.com/PyCQA/docformatter
rev: v1.6.3
rev: v1.7.5
hooks:
- id: docformatter
- repo: https://github.com/pycqa/pydocstyle
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
------------------------------------------------------------------------

Ivy is both an ML transpiler and a framework, currently supporting JAX,
TensorFlow, PyTorch and Numpy.
TensorFlow, PyTorch, and Numpy.

Ivy unifies all ML frameworks 💥 enabling you not only to **write code
that can be used with any of these frameworks as the backend**, but also
to **convert 🔄 any function, model or library written in any of them to
to **convert 🔄 any function, model, or library written in any of them to
your preferred framework!**

You can check out [Ivy as a transpiler](#ivy-as-a-transpiler) and [Ivy
Expand Down Expand Up @@ -211,7 +211,7 @@ All of the functionalities in Ivy are exposed through the
`Ivy functional API` and the `Ivy stateful API`. All functions in the
[Functional
API](https://unify.ai/docs/ivy/overview/design/building_blocks.html#ivy-functional-api)
are **Framework Agnostic Functions**, which mean that we can use them
are **Framework Agnostic Functions**, which means that we can use them
like this:

``` python
Expand Down Expand Up @@ -263,7 +263,7 @@ class Regressor(ivy.Module):

If we put it all together, we\'ll have something like this. This example
uses PyTorch as the backend, but this can easily be changed to your
favorite framework, such as TensorFlow, or JAX.
favorite frameworks, such as TensorFlow, or JAX.

``` python
import ivy
Expand Down Expand Up @@ -322,7 +322,7 @@ The model\'s output can be visualized as follows:
<img width="50%" class="dark-light" src="https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/regressor_lq.gif">
</div>

Last but not least, we are also working on specific extension totally
Last but not least, we are also working on specific extensions totally
written in Ivy and therefore usable within any framework, covering
topics like [Mechanics](https://github.com/unifyai/mech), [Computer
Vision](https://github.com/unifyai/vision),
Expand Down Expand Up @@ -1399,7 +1399,7 @@ out = np_loss(p, t)
</blockquote>
</details>

<h3>I'm using Ivy&ensp;<img class="dark-light" style="height: 1.75em; vertical-align:-40%" src="https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/logos/ivy_logo_only.svg"></h3>
<h3>I'm using Ivy&ensp;<img height="25px" width="25px" class="dark-light" src="https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/logos/ivy_logo_only.svg"></h3>

Or you can use Ivy as a framework, breaking yourself (and your code)
free from deciding which community to support, allowing anyone to run
Expand All @@ -1408,7 +1408,7 @@ your code in their framework of choice!
``` python
import ivy

# a simple image classification model
# A simple image classification model
class IvyNet(ivy.Module):
def __init__(
self,
Expand Down Expand Up @@ -1438,7 +1438,7 @@ class IvyNet(ivy.Module):
)

self.classifier = ivy.Sequential(
# since padding is "SAME", this would be image_height x image_width x output_channels
# Since the padding is "SAME", this would be image_height x image_width x output_channels
ivy.Linear(self.h_w[0] * self.h_w[1] * self.output_channels, 512),
ivy.GELU(),
ivy.Linear(512, self.num_classes),
Expand Down Expand Up @@ -1562,7 +1562,7 @@ def train(images, classes, epochs, model, device, num_classes=10, batch_size=32)
if device != "cpu":
xbatch, ybatch = xbatch.to_device("gpu:0"), ybatch.to_device("gpu:0")

# since the cross entropy function expects the target classes to be in one-hot encoded format
# Since the cross entropy function expects the target classes to be in one-hot encoded format
ybatch_encoded = ivy.one_hot(ybatch, num_classes)

# update model params
Expand Down
2 changes: 1 addition & 1 deletion deploy_pypi.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python3 -m build
python3 -m twine upload dist/* --repository testpypi -u "__token__" -p "$PYPI_PASSWORD_TEST" --verbose
python3 -m twine upload dist/* -u "__token__" -p "$PYPI_PASSWORD" --verbose
34 changes: 13 additions & 21 deletions docker/multicuda_framework_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,31 @@ def directory_generator(req, base="/opt/fw/"):
def install_pkg(path, pkg, base="fw/"):
if pkg.split("==")[0] if "==" in pkg else pkg == "torch":
subprocess.run(
(
f"yes |pip3 install --upgrade {pkg} --target"
f" {path} --default-timeout=100 --extra-index-url"
" https://download.pytorch.org/whl/cu118 --no-cache-dir"
),
f"yes |pip3 install --upgrade {pkg} --target"
f" {path} --default-timeout=100 --extra-index-url"
" https://download.pytorch.org/whl/cu118 --no-cache-dir",
shell=True,
)
elif pkg.split("==")[0] if "==" in pkg else pkg == "jax":
subprocess.run(
(
f"yes |pip install --upgrade --target {path} 'jax[cuda11_local]' -f"
" https://storage.googleapis.com/jax-releases/jax_cuda_releases.html "
" --no-cache-dir"
),
f"yes |pip install --upgrade --target {path} 'jax[cuda11_local]' -f"
" https://storage.googleapis.com/jax-releases/jax_cuda_releases.html "
" --no-cache-dir",
shell=True,
)
elif pkg.split("==")[0] if "==" in pkg else pkg == "paddle":
subprocess.run(
(
"yes |pip install "
f" paddlepaddle-gpu=={get_latest_package_version('paddlepaddle')}.post117"
f" --target {path} -f"
" https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html "
" --no-cache-dir"
),
"yes |pip install "
f" paddlepaddle-gpu=={get_latest_package_version('paddlepaddle')}.post117"
f" --target {path} -f"
" https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html "
" --no-cache-dir",
shell=True,
)
else:
subprocess.run(
(
f"yes |pip3 install --upgrade {pkg} --target"
f" {path} --default-timeout=100 --no-cache-dir"
),
f"yes |pip3 install --upgrade {pkg} --target"
f" {path} --default-timeout=100 --no-cache-dir",
shell=True,
)

Expand Down
Loading

0 comments on commit 8be1b4d

Please sign in to comment.