Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(train): tpu support #302

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 11 additions & 28 deletions notebooks/so-vits-svc-fork-4.0.ipynb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Before training\n",
"\n",
"This program saves the last 3 generations of models to Google Drive. Since 1 generation of models is >1GB, you should have at least 3GB of free space in Google Drive. If you do not have such free space, it is recommended to create another Google Account.\n",
"\n",
"Training requires >10GB VRAM. (T4 should be enough) Inference does not require such a lot of VRAM."
"This program saves the last 3 generations of models to Google Drive. Since 1 generation of models is >1GB, you should have at least 3GB of free space in Google Drive. If you do not have such free space, it is recommended to create another Google Account."
]
},
{
Expand All @@ -18,16 +17,6 @@
"## Installation"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#@title Check GPU\n",
"!nvidia-smi"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -52,9 +41,13 @@
"\n",
"#@markdown Branch (for development)\n",
"BRANCH = \"none\" #@param {\"type\": \"string\"}\n",
"TPU = True #@param {\"type\": \"boolean\"}\n",
"if TPU:\n",
" %pip install cloud-tpu-client==0.10 torch==2.0.0 torchvision==0.15.1 https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-2.0-cp39-cp39-linux_x86_64.whl\n",
"if BRANCH == \"none\":\n",
" %pip install -U so-vits-svc-fork\n",
"else:\n",
" %pip uninstall -y so-vits-svc-fork\n",
" %pip install -U git+https://github.com/34j/so-vits-svc-fork.git@{BRANCH}"
]
},
Expand Down Expand Up @@ -94,7 +87,7 @@
"#@title Copy your dataset\n",
"#@markdown **We assume that your dataset is in your Google Drive's `so-vits-svc-fork/dataset/(speaker_name)` directory.**\n",
"DATASET_NAME = \"kiritan\" #@param {type: \"string\"}\n",
"!cp -R /content/drive/MyDrive/so-vits-svc-fork/dataset/{DATASET_NAME}/ -t \"dataset_raw/\""
"!cp -R /content/drive/MyDrive/so-vits-svc-fork/dataset_raw_raw/{DATASET_NAME}/ -t \"dataset_raw/\""
]
},
{
Expand All @@ -119,16 +112,7 @@
"outputs": [],
"source": [
"#@title Automatic preprocessing\n",
"!svc pre-resample"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!svc pre-config"
"!svc pre-resample -o \"drive/MyDrive/so-vits-svc-fork/dataset_raw\""
]
},
{
Expand All @@ -137,8 +121,7 @@
"metadata": {},
"outputs": [],
"source": [
"#@title Copy configs file\n",
"!cp configs/44k/config.json drive/MyDrive/so-vits-svc-fork"
"!svc pre-config -i \"drive/MyDrive/so-vits-svc-fork/dataset_raw\" -o \"drive/MyDrive/so-vits-svc-fork/configs/44k\""
]
},
{
Expand All @@ -148,7 +131,7 @@
"outputs": [],
"source": [
"F0_METHOD = \"dio\" #@param [\"crepe\", \"crepe-tiny\", \"parselmouth\", \"dio\", \"harvest\"]\n",
"!svc pre-hubert -fm {F0_METHOD}"
"!svc pre-hubert -fm {F0_METHOD} -i \"drive/MyDrive/so-vits-svc-fork/dataset\" -c \"drive/MyDrive/so-vits-svc-fork/configs/44k\""
]
},
{
Expand All @@ -160,7 +143,7 @@
"#@title Train\n",
"%load_ext tensorboard\n",
"%tensorboard --logdir drive/MyDrive/so-vits-svc-fork/logs/44k\n",
"!svc train --model-path drive/MyDrive/so-vits-svc-fork/logs/44k"
"!svc train -m \"drive/MyDrive/so-vits-svc-fork/logs/44k\" -c \"drive/MyDrive/so-vits-svc-fork/configs/44k\""
]
},
{
Expand Down