Skip to content

Instantly share code, notes, and snippets.

@arnav-ladkat
Created July 15, 2022 17:17
Show Gist options
  • Save arnav-ladkat/e6c2da956bcad617ea6313aa0c918aed to your computer and use it in GitHub Desktop.
Save arnav-ladkat/e6c2da956bcad617ea6313aa0c918aed to your computer and use it in GitHub Desktop.
BenchMark-Collab.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "BenchMark-Collab.ipynb",
"provenance": [],
"machine_shape": "hm",
"authorship_tag": "ABX9TyMJ1nUmZHe73kXDjU8XXiX7",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"gpuClass": "standard"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/Arnav-Ladkat/e6c2da956bcad617ea6313aa0c918aed/benchmark-collab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "HdDiruiy22-n",
"outputId": "f67d7d53-d62d-42d2-937d-2296ffa5aaf3"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Fri Jul 15 17:17:19 2022 \n",
"+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n",
"|-------------------------------+----------------------+----------------------+\n",
"| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n",
"| | | MIG M. |\n",
"|===============================+======================+======================|\n",
"| 0 Tesla P100-PCIE... Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 36C P0 26W / 250W | 0MiB / 16280MiB | 0% Default |\n",
"| | | N/A |\n",
"+-------------------------------+----------------------+----------------------+\n",
" \n",
"+-----------------------------------------------------------------------------+\n",
"| Processes: |\n",
"| GPU GI CI PID Type Process name GPU Memory |\n",
"| ID ID Usage |\n",
"|=============================================================================|\n",
"| No running processes found |\n",
"+-----------------------------------------------------------------------------+\n"
]
}
],
"source": [
"gpu_info = !nvidia-smi\n",
"gpu_info = '\\n'.join(gpu_info)\n",
"if gpu_info.find('failed') >= 0:\n",
" print('Select the Runtime > \"Change runtime type\" menu to enable a GPU accelerator, ')\n",
" print('and then re-execute this cell.')\n",
"else:\n",
" print(gpu_info)"
]
},
{
"cell_type": "code",
"source": [
"from psutil import virtual_memory\n",
"ram_gb = virtual_memory().total / 1e9\n",
"print('Your runtime has {:.1f} gigabytes of available RAM\\n'.format(ram_gb))\n",
"\n",
"if ram_gb < 20:\n",
" print('To enable a high-RAM runtime, select the Runtime > \"Change runtime type\"')\n",
" print('menu, and then select High-RAM in the Runtime shape dropdown. Then, ')\n",
" print('re-execute this cell.')\n",
"else:\n",
" print('You are using a high-RAM runtime!')"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "kNVrMvSn2_lP",
"outputId": "ab287b3b-0b54-4ef2-97c9-d22e07939a54"
},
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Your runtime has 27.3 gigabytes of available RAM\n",
"\n",
"You are using a high-RAM runtime!\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!lscpu"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "dVREiUJg3EZt",
"outputId": "b5bdfcdc-4f69-4a08-8610-d9a91fbbc293"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Architecture: x86_64\n",
"CPU op-mode(s): 32-bit, 64-bit\n",
"Byte Order: Little Endian\n",
"CPU(s): 4\n",
"On-line CPU(s) list: 0-3\n",
"Thread(s) per core: 2\n",
"Core(s) per socket: 2\n",
"Socket(s): 1\n",
"NUMA node(s): 1\n",
"Vendor ID: GenuineIntel\n",
"CPU family: 6\n",
"Model: 79\n",
"Model name: Intel(R) Xeon(R) CPU @ 2.20GHz\n",
"Stepping: 0\n",
"CPU MHz: 2199.998\n",
"BogoMIPS: 4399.99\n",
"Hypervisor vendor: KVM\n",
"Virtualization type: full\n",
"L1d cache: 32K\n",
"L1i cache: 32K\n",
"L2 cache: 256K\n",
"L3 cache: 56320K\n",
"NUMA node0 CPU(s): 0-3\n",
"Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear arch_capabilities\n"
]
}
]
},
{
"cell_type": "code",
"source": [
""
],
"metadata": {
"id": "OL5OWB3Q3H3h"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment