Skip to content

Commit

Permalink
Add TENSORBOARD_FLAGS var
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Jul 15, 2024
1 parent 6f44421 commit 058888f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/COPY_ROOT_0/opt/ai-dock/bin/build/layer0/amd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build_amd_install_torch() {
torch==${PYTORCH_VERSION} \
torchvision \
torchaudio \
--extra-index-url=https://download.pytorch.org/whl/rocm${ROCM_VERSION}
--index-url=https://download.pytorch.org/whl/rocm${ROCM_VERSION}
}

build_amd_main "$@"
4 changes: 2 additions & 2 deletions build/COPY_ROOT_0/opt/ai-dock/bin/build/layer0/nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ build_nvidia_main() {
build_nvidia_install_torch() {
short_cuda_version="cu$(cut -d '.' -f 1,2 <<< "${CUDA_VERSION}" | tr -d '.')"
"$KOHYA_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
--index-url=https://download.pytorch.org/whl/$short_cuda_version

}

build_nvidia_run_tests() {
Expand Down
3 changes: 3 additions & 0 deletions build/COPY_ROOT_1/opt/ai-dock/bin/preflight.d/10-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function preflight_main() {
preflight_configure_accelerate
preflight_update_kohya_ss
printf "%s" "${KOHYA_FLAGS}" > /etc/kohya_ss_flags.conf
export TENSORBOARD_FLAGS=${TENSORBOARD_FLAGS:-"--logdir /opt/kohya_ss/logs"}
env-store TENSORBOARD_FLAGS
printf "%s" "${TENSORBOARD_FLAGS}" > /etc/tensorboard_flags.conf
}

function preflight_configure_accelerate() {
Expand Down
5 changes: 3 additions & 2 deletions build/COPY_ROOT_1/opt/ai-dock/bin/supervisor-tensorboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ function start() {
printf "Starting %s...\n" "${SERVICE_NAME}"

source "$KOHYA_VENV/bin/activate"
FLAGS_COMBINED="$(cat /etc/tensorboard_flags.conf)"
LD_PRELOAD=libtcmalloc.so tensorboard \
--port ${LISTEN_PORT} \
--logdir /opt/kohya_ss/logs
$FLAGS_COMBINED \
--port ${LISTEN_PORT}
}

start 2>&1
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ services:
- SYNCTHING_UI_PORT_HOST=${SYNCTHING_UI_PORT_HOST:-8384}
- SYNCTHING_TRANSPORT_PORT_HOST=${SYNCTHING_TRANSPORT_PORT_HOST:-22999}
- SYNCTHING_URL=${SYNCTHING_URL:-}
- TENSORBOARD_FLAGS=${TENSORBOARD_FLAGS:-"--logdir /opt/kohya_ss/logs"}
- TENSORBOARD_PORT_HOST=${TENSORBOARD_PORT_HOST:-6006}
- TENSORBOARD_PORT_LOCAL=${TENSORBOARD_PORT_LOCAL:-16006}
- TENSORBOARD_METRICS_PORT=${TENSORBOARD_METRICS_PORT:-26006}
Expand Down

0 comments on commit 058888f

Please sign in to comment.