forked from ivy-llc/ivy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multicuda changes as well as multiversion changes (ivy-llc#13061)
* multicuda changes as well as multiversion changes * multiversion framework directory changes --------- Co-authored-by: Rishabh Kumar <[email protected]>
- Loading branch information
1 parent
b36fed4
commit aa23e96
Showing
6 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM ubuntu:20.04 | ||
WORKDIR /ivy | ||
ARG cuda=["11.2"] | ||
|
||
COPY ../docker/multicuda_framework_directory.py . | ||
COPY ../docker/multicuda_requirements.txt . | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Europe/Moscow | ||
RUN \ | ||
apt-get -y update && \ | ||
apt-get install -y gnupg \ | ||
curl \ | ||
wget \ | ||
software-properties-common \ | ||
gcc \ | ||
nano \ | ||
pip && \ | ||
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ | ||
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ | ||
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \ | ||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ | ||
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list &&\ | ||
|
||
apt-get update && apt-get install -y nvidia-container-toolkit | ||
|
||
# don't install requirements immediately | ||
# pip3 install --upgrade pip && \ | ||
# pip3 install --no-cache-dir -r multicuda_requirements.txt &&\ | ||
# pip3 uninstall -y torch &&\ | ||
# pip3 uninstall -y tensorflow &&\ | ||
# pip3 uninstall -y numpy &&\ | ||
# pip3 uninstall -y jax | ||
|
||
## below code is for installing cuda directly through commandline ## | ||
#RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb &&\ | ||
# dpkg -i cuda-keyring_1.0-1_all.deb | ||
# | ||
#RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \ | ||
# mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 &&\ | ||
# apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\ | ||
# add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" | ||
# | ||
#RUN apt-get update && \ | ||
# for i in $cuda; do apt-get install -y cuda-$i; done | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker build --progress=plain --no-cache -t unifyai/multicuda:base -f DockerfileGPUMultiCuda .. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# flake8: noqa | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
|
||
def directory_generator(req, base="/fw/"): | ||
for versions in req: | ||
pkg, ver = versions.split("/") | ||
path = base + pkg + "/" + ver | ||
if not os.path.exists(path): | ||
install_pkg(path, pkg + "==" + ver) | ||
|
||
|
||
def install_pkg(path, pkg, base="fw/"): | ||
if pkg.split("==")[0] == "torch": | ||
subprocess.run( | ||
f"pip3 install {pkg} --default-timeout=100 --extra-index-url https://download.pytorch.org/whl/cu116 --no-cache-dir", | ||
shell=True, | ||
) | ||
elif pkg.split("==")[0] == "jaxlib": | ||
subprocess.run( | ||
f"pip3 install {pkg} --default-timeout=100 -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html --no-cache-dir", | ||
shell=True, | ||
) | ||
else: | ||
subprocess.run( | ||
f"pip3 install {pkg} --default-timeout=100 --no-cache-dir", shell=True | ||
) | ||
|
||
if __name__=="__main__": | ||
arg_lis=sys.argv | ||
directory_generator(arg_lis[1:],"") | ||
|
||
|
||
# torch_req = ["torch/1.13.1"] | ||
# tensorflow_req = [ | ||
# "tensorflow/2.11.0", | ||
# ] | ||
# jax_req = ["jax/0.4.6"] | ||
# jaxlib_req = ["jaxlib/0.4.6"] | ||
# numpy_req = ["numpy/1.24.2"] | ||
# | ||
# directory_generator(torch_req) | ||
# directory_generator(tensorflow_req) | ||
# directory_generator(jax_req) | ||
# directory_generator(numpy_req) | ||
# directory_generator(jaxlib_req) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
h5py | ||
pytest | ||
networkx | ||
hypothesis | ||
pymongo | ||
redis | ||
matplotlib | ||
opencv-python | ||
tensorflow-addons | ||
tensorflow-probability | ||
functorch | ||
scipy | ||
dm-haiku | ||
pydriller | ||
tqdm | ||
coverage | ||
einops | ||
psutil | ||
termcolor | ||
colorama | ||
packaging | ||
nvidia-ml-py | ||
paddle-bfloat |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ termcolor | |
colorama | ||
packaging | ||
nvidia-ml-py<=11.495.46 # mod_name=pynvml | ||
paddle-bfloat | ||
paddle-bfloat | ||
jsonpickle |