{ "cells": [ { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "view-in-github" }, "source": [ "" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting environment information...\n", "PyTorch version: 2.1.2+cu121\n", "Is debug build: False\n", "CUDA used to build PyTorch: 12.1\n", "ROCM used to build PyTorch: N/A\n", "\n", "OS: Microsoft Windows 11 Home\n", "GCC version: Could not collect\n", "Clang version: Could not collect\n", "CMake version: Could not collect\n", "Libc version: N/A\n", "\n", "Python version: 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)\n", "Python platform: Windows-10-10.0.22621-SP0\n", "Is CUDA available: True\n", "CUDA runtime version: 12.3.107\n", "\n", "CUDA_MODULE_LOADING set to: LAZY\n", "GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3080 Ti\n", "Nvidia driver version: 551.23\n", "cuDNN version: C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.3\\bin\\cudnn_ops_train64_8.dll\n", "HIP runtime version: N/A\n", "MIOpen runtime version: N/A\n", "Is XNNPACK available: True\n", "\n", "CPU:\n", "Architecture=9\n", "\n", "\n", "CurrentClockSpeed=3504\n", "\n", "\n", "DeviceID=CPU0\n", "\n", "\n", "Family=207\n", "\n", "\n", "L2CacheSize=4096\n", "\n", "\n", "L2CacheSpeed=\n", "\n", "\n", "Manufacturer=GenuineIntel\n", "\n", "\n", "MaxClockSpeed=3504\n", "\n", "\n", "Name=11th Gen Intel(R) Core(TM) i9-11900KF @ 3.50GHz\n", "\n", "\n", "ProcessorType=3\n", "\n", "\n", "Revision=\n", "\n", "Versions of relevant libraries:\n", "[pip3] numpy==1.26.3\n", "[pip3] torch==2.1.2+cu121\n", "[pip3] torchaudio==2.1.2\n", "[pip3] torchvision==0.16.2\n", "[conda] blas 1.0 mkl \n", "[conda] cudatoolkit 11.3.1 h59b6b97_2 \n", "[conda] mkl 2023.1.0 h6b88ed4_46358 \n", "[conda] mkl-service 2.4.0 py39h2bbff1b_1 \n", "[conda] mkl_fft 1.3.8 py39h2bbff1b_0 \n", "[conda] mkl_random 1.2.4 py39h59b6b97_0 \n", "[conda] numpy 1.26.3 py39h055cbcc_0 \n", "[conda] numpy-base 1.26.3 py39h65a83cf_0 \n", "[conda] pytorch-cuda 12.1 hde6ce7c_5 pytorch\n", "[conda] pytorch-mutex 1.0 cpu pytorch\n", "[conda] torch 2.1.2+cu121 pypi_0 pypi\n", "[conda] torchaudio 2.1.2 py39_cpu pytorch\n", "[conda] torchvision 0.16.2 py39_cpu pytorch\n" ] } ], "source": [ "!python -m torch.utils.collect_env" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "import torch" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "a=torch.cuda.FloatTensor()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "# !pip uninstall torch" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "iobAOGDyff7W", "outputId": "b256e5a4-a406-46f5-fd61-0b46f61afc2a" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: accelerate in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (0.27.2)\n", "Requirement already satisfied: numpy>=1.17 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (1.26.3)\n", "Requirement already satisfied: packaging>=20.0 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (23.1)\n", "Requirement already satisfied: psutil in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (5.9.0)\n", "Requirement already satisfied: pyyaml in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (6.0.1)\n", "Requirement already satisfied: torch>=1.10.0 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (2.1.2+cu121)\n", "Requirement already satisfied: huggingface-hub in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (0.20.2)\n", "Requirement already satisfied: safetensors>=0.3.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from accelerate) (0.4.1)\n", "Requirement already satisfied: filelock in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (3.13.1)\n", "Requirement already satisfied: typing-extensions in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (4.9.0)\n", "Requirement already satisfied: sympy in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (1.12)\n", "Requirement already satisfied: networkx in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (3.1)\n", "Requirement already satisfied: jinja2 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (3.1.2)\n", "Requirement already satisfied: fsspec in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from torch>=1.10.0->accelerate) (2023.10.0)\n", "Requirement already satisfied: requests in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from huggingface-hub->accelerate) (2.31.0)\n", "Requirement already satisfied: tqdm>=4.42.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from huggingface-hub->accelerate) (4.66.1)\n", "Requirement already satisfied: colorama in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from tqdm>=4.42.1->huggingface-hub->accelerate) (0.4.6)\n", "Requirement already satisfied: MarkupSafe>=2.0 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.3)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->huggingface-hub->accelerate) (2.0.4)\n", "Requirement already satisfied: idna<4,>=2.5 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->huggingface-hub->accelerate) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->huggingface-hub->accelerate) (2.1.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->huggingface-hub->accelerate) (2023.11.17)\n", "Requirement already satisfied: mpmath>=0.19 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0)\n", "Requirement already satisfied: transformers in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (4.37.2)\n", "Requirement already satisfied: filelock in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (3.13.1)\n", "Requirement already satisfied: huggingface-hub<1.0,>=0.19.3 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (0.20.2)\n", "Requirement already satisfied: numpy>=1.17 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (1.26.3)\n", "Requirement already satisfied: packaging>=20.0 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (23.1)\n", "Requirement already satisfied: pyyaml>=5.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (6.0.1)\n", "Requirement already satisfied: regex!=2019.12.17 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (2023.12.25)\n", "Requirement already satisfied: requests in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (2.31.0)\n", "Requirement already satisfied: tokenizers<0.19,>=0.14 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (0.15.0)\n", "Requirement already satisfied: safetensors>=0.4.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (0.4.1)\n", "Requirement already satisfied: tqdm>=4.27 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from transformers) (4.66.1)\n", "Requirement already satisfied: fsspec>=2023.5.0 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from huggingface-hub<1.0,>=0.19.3->transformers) (2023.10.0)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from huggingface-hub<1.0,>=0.19.3->transformers) (4.9.0)\n", "Requirement already satisfied: colorama in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from tqdm>=4.27->transformers) (0.4.6)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->transformers) (2.0.4)\n", "Requirement already satisfied: idna<4,>=2.5 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->transformers) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->transformers) (2.1.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\rogbeast\\anaconda3\\envs\\hugging_face\\lib\\site-packages (from requests->transformers) (2023.11.17)\n" ] } ], "source": [ "!pip install -q transformers datasets segments-ai evaluate\n", "!pip install -U accelerate\n", "!pip install -U transformers" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "# !pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n" ] } ], "source": [ "print(torch.backends.cudnn.enabled)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n" ] } ], "source": [ "print(torch.cuda.is_available())" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Available CUDA Devices:\n", "Device 0: NVIDIA GeForce RTX 3080 Ti\n", "CUDA_VISIBLE_DEVICES: Not set (All GPUs are visible)\n" ] } ], "source": [ "import torch\n", "\n", "# List all available GPUs\n", "if torch.cuda.is_available():\n", " print(\"Available CUDA Devices:\")\n", " for i in range(torch.cuda.device_count()):\n", " print(f\"Device {i}: {torch.cuda.get_device_name(i)}\")\n", "else:\n", " print(\"No CUDA devices are available\")\n", "\n", "# Check CUDA_VISIBLE_DEVICES environment variable\n", "import os\n", "cuda_visible_devices = os.getenv('CUDA_VISIBLE_DEVICES')\n", "print(\"CUDA_VISIBLE_DEVICES:\", cuda_visible_devices if cuda_visible_devices is not None else \"Not set (All GPUs are visible)\")\n" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 145, "referenced_widgets": [ "8d90aa42c48d4172b040253e980b52a9", "79daa4b480e54dcf8856407c85c65f16", "9b760908da26488aa1fb961aacb8f5ef", "287bfe09367f4253a1566b026c36ad74", "a88e4591259a405b9676fc7446e4625f", "632bb774dbac423e86f9ae4d803e080c", "db0dca9600cc4b1181d00ccd31510d16", "37f202b56e8a4b50ad00bf8d82ac3204", "6347558ca6214490a2de105c9c53edfd", "d96edc8b0bb8422abde7dd63edea1c7f", "22bc3403d15649e48934ada0e462a95a", "ec882c565c89456a97652611d7fc4fb0", "e6427564f5694a65890b06dce89c83f6", "251e600b28934e7d8fc7150c1e293912", "86480f72044b4250af1788dee3bbbb11", "8ebfcb2835664461959c24a642bfc16c", "c16da0793fb9493193b6474650fb7510", "033ce4defe4540cb9b251d2ce1c8d80c", "ee9ba91f11bf4527bc9ea5044b5d7469", "79bce1c28005482fabc4eee0d9871ca7", "0b4ac6328e7840e0b04375152e4cff5f", "4df24038fd64437faefd38f087e8d8a6", "c77d147d149a428c9251a086e068f7c0", "eff45d541581479682d9f448746c82a4", "e7a7df4c1862415799c131fea102087b", "8151bdec05a34ea9bca0634b529814ee", "4de89176ac3946ad870e27a40e04b638", "c99eb0c52f6341cca6c14d611b1eae09", "09fd23cf33ab4ea6b9fb25a97b4b371d", "a00c758a1b0b4f3db31d9dbfa7b50f77", "ccddcb21092644a5a2b586be5db09b86", "41dc48fff7054bfd903dc976a0263684" ] }, "id": "WT2jsBUffigw", "outputId": "07fe7e41-3c4d-4ba3-a312-3084e8c43a12" }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "babf77d7da6a454996bbc87bbe6b73b0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='