Add hpu usage info in jupyter notebook files

This commit is contained in:
PiotrBLL 2024-11-06 00:47:12 +01:00
parent 6e66088bd0
commit 1be8041ede
2 changed files with 4276 additions and 4232 deletions

View File

@ -36,10 +36,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": null,
"metadata": {
"id": "3CqtR2Fi5-vP"
},
"outputs": [], "outputs": [],
"source": [ "source": [
"import os\n", "import os\n",
@ -56,10 +53,35 @@
"import torchaudio\n", "import torchaudio\n",
"\n", "\n",
"from tqdm.notebook import tqdm\n", "from tqdm.notebook import tqdm\n",
"\n", "\n"
"\n", ],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
"# Set the `DEVICE` based on available hardware\n",
"### If you're running on a machine with Intel Gaudi support, you can set the DEVICE to \"hpu\"\n",
"### This can be done by setting the device to \"hpu\" if Gaudi is available.\n",
"### Ensure you have the Habana PyTorch extension installed and properly configured."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"# DEVICE = \"hpu\"\n",
"DEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"" "DEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\""
] ],
"metadata": {
"collapsed": false
}
}, },
{ {
"cell_type": "code", "cell_type": "code",

File diff suppressed because one or more lines are too long