<jupyter_start><jupyter_text>**Pytorch Apex Builder****This notebook will help you build apex wheel for colaboratory runtime.**Built wheel will be automatically downloaded, and can be used with e.g. git, wget, and so on.* Made by <NAME>, in Yonsei University.* Github: https://github.com/kdha0727/colab-apex-builder/<jupyter_code>!lsb_release -a
gpu_info = !nvidia-smi
gpu_info = '\n'.join(gpu_info)
if gpu_info.find('failed') >= 0 or gpu_info.find('not found') >= 0:
    raise RuntimeError(
        'Select the Runtime > "Change runtime type" menu to enable a GPU accelerator, '
        'and then re-execute this cell.'
    )
else:
    print(gpu_info)
import torch
torch.__version__
%%shell
wget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub
apt-get update
apt-get install -qq cuda-toolkit-10-2 gcc-5 g++-5 -y
apt-get clean
ln -s /usr/bin/gcc-5 /usr/local/cuda/bin/gcc
ln -s /usr/bin/g++-5 /usr/local/cuda/bin/g++
/usr/local/cuda/bin/nvcc -V
export CUDA_HOME=/usr/local/cuda
%%shell
git clone https://github.com/NVIDIA/apex
pip wheel -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./apex
rm -rf apex/
from google.colab import files
wheel_dir = !find apex-*
assert len(wheel_dir) == 1
files.download(wheel_dir[0])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1564935064935065, 'fraction_numerical': 0.05519480519480519, 'mean_word_length': 3.861198738170347, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '253883', 'license': 'MIT', 'n_tokens_mistral': 665, 'n_tokens_neox': 603, 'n_words': 131, 'path': 'colab_apex_builder.ipynb', 'repo_name': 'kdha0727/colab-apex-builder', 'size': '1544'}