-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bde637d
commit db3c19f
Showing
49 changed files
with
266 additions
and
175 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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
workspace | ||
*__pycache__ | ||
build/COPY_ROOT_EXTRA/ | ||
config/authorized_keys | ||
config/rclone | ||
tpdocs | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
#!/bin/false | ||
|
||
build_amd_main() { | ||
build_amd_install_deps | ||
build_common_run_tests | ||
} | ||
|
||
build_amd_install_deps() { | ||
"$WEBUI_VENV_PIP" install --no-cache-dir \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
--extra-index-url=https://download.pytorch.org/whl/rocm${ROCM_VERSION} | ||
} | ||
|
||
build_amd_main "$@" |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/false | ||
|
||
source /opt/ai-dock/etc/environment.sh | ||
|
||
build_common_main() { | ||
build_common_create_venv | ||
} | ||
|
||
build_common_create_venv() { | ||
apt-get update | ||
$APT_INSTALL \ | ||
"python${PYTHON_VERSION}" \ | ||
"python${PYTHON_VERSION}-dev" \ | ||
"python${PYTHON_VERSION}-venv" | ||
|
||
"python${PYTHON_VERSION}" -m venv "$WEBUI_VENV" | ||
"$WEBUI_VENV_PIP" install --no-cache-dir \ | ||
ipykernel \ | ||
ipywidgets | ||
"$WEBUI_VENV_PYTHON" -m ipykernel install \ | ||
--name="webui" \ | ||
--display-name="Python${PYTHON_VERSION} (webui)" | ||
# Add the default Jupyter kernel as an alias of webui | ||
"$WEBUI_VENV_PYTHON" -m ipykernel install \ | ||
--name="python3" \ | ||
--display-name="Python3 (ipykernel)" | ||
} | ||
|
||
|
||
build_common_run_tests() { | ||
installed_pytorch_version=$("$WEBUI_VENV_PYTHON" -c "import torch; print(torch.__version__)") | ||
if [[ "$installed_pytorch_version" != "$PYTORCH_VERSION"* ]]; then | ||
echo "Expected PyTorch ${PYTORCH_VERSION} but found ${installed_pytorch_version}\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
build_common_main "$@" |
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,16 @@ | ||
#!/bin/false | ||
|
||
build_cpu_main() { | ||
build_cpu_install_deps | ||
build_common_run_tests | ||
} | ||
|
||
build_cpu_install_deps() { | ||
"$WEBUI_VENV_PIP" install --no-cache-dir \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
--extra-index-url=https://download.pytorch.org/whl/cpu | ||
} | ||
|
||
build_cpu_main "$@" |
File renamed without changes.
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,28 @@ | ||
#!/bin/false | ||
|
||
build_nvidia_main() { | ||
build_nvidia_install_deps | ||
build_common_run_tests | ||
build_nvidia_run_tests | ||
} | ||
|
||
build_nvidia_install_deps() { | ||
short_cuda_version="cu$(cut -d '.' -f 1,2 <<< "${CUDA_VERSION}" | tr -d '.')" | ||
"$WEBUI_VENV_PIP" install --no-cache-dir \ | ||
nvidia-ml-py3 \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
xformers \ | ||
--extra-index-url=https://download.pytorch.org/whl/$short_cuda_version | ||
} | ||
|
||
build_nvidia_run_tests() { | ||
installed_pytorch_cuda_version=$("$WEBUI_VENV_PYTHON" -c "import torch; print(torch.version.cuda)") | ||
if [[ "$CUDA_VERSION" != "$installed_pytorch_cuda"* ]]; then | ||
echo "Expected PyTorch CUDA ${CUDA_VERSION} but found ${installed_pytorch_cuda}\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
build_nvidia_main "$@" |
File renamed without changes.
File renamed without changes.
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,36 @@ | ||
#!/bin/false | ||
|
||
build_amd_main() { | ||
build_amd_install_bitsandbytes | ||
build_amd_install_webui | ||
build_common_run_tests | ||
} | ||
|
||
build_amd_install_bitsandbytes() { | ||
# TODO - This really needs moving to a separate, external build step | ||
# https://github.com/ROCm/bitsandbytes | ||
DEV_PACKAGES="rocm-dev hipblas-dev hipblaslt-dev hipcub-dev hiprand-dev hipsparse-dev rocblas-dev rocthrust-dev" | ||
if [[ $ROCM_LEVEL != "devel" ]]; then | ||
$APT_INSTALL $DEV_PACKAGES | ||
fi | ||
cd /tmp | ||
git clone --recurse https://github.com/ROCm/bitsandbytes | ||
cd bitsandbytes | ||
git checkout rocm_enabled | ||
"$WEBUI_VENV_PIP" install --no-cache-dir -r requirements-dev.txt | ||
cmake -DCOMPUTE_BACKEND=hip -S . #Use -DBNB_ROCM_ARCH="gfx90a;gfx942" to target specific gpu arch | ||
make | ||
"$WEBUI_VENV_PIP" install --no-cache-dir . | ||
cd /tmp | ||
rm -rf /tmp/bitsandbytes | ||
if [[ $ROCM_LEVEL != "devel" ]]; then | ||
apt-get remove -y $DEV_PACKAGES | ||
apt-get autoremove -y | ||
fi | ||
} | ||
|
||
build_amd_install_webui() { | ||
build_common_install_webui | ||
} | ||
|
||
build_amd_main "$@" |
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,8 @@ | ||
#!/bin/false | ||
|
||
# Tidy up and keep image small | ||
apt-get clean -y | ||
|
||
fix-permissions.sh -o container | ||
rm /etc/ld.so.cache | ||
ldconfig |
Oops, something went wrong.