Last active
May 29, 2023 01:44
-
-
Save djinn/6ef35b823fa60becaee65cd99d3fcc38 to your computer and use it in GitHub Desktop.
Running LLM on AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The cheapest CUDA instance on AWS is Graviton2 based g5g instances | |
# 1) Install right CUDA Drivers on the system. Whilst this script has been tested on Ubuntu 22.04. It should work on others | |
# 2) Install torch with GPU support. Compiling from source works the best | |
# 3) Preferably Quantize the models - https://huggingface.co/docs/transformers/main/en/main_classes/quantization | |
# | |
# Author: Supreet Sethi <[email protected]> | |
# Web: https://www.linkedin.com/in/djinn | |
# | |
# Step 1) is here | |
ARCH='sbsa' | |
NAME='ubuntu' | |
REL=`lsb_release -rs|tr -d '.'` | |
RELEASE="${NAME}${REL}" | |
DEVICE=`lspci |grep -i nvidia|cut -d':' -f 3` | |
sudo apt install -y linux-headers-$(uname -r) | |
wget https://developer.download.nvidia.com/compute/cuda/repos/${RELEASE}/${ARCH}/cuda-keyring_1.0-1_all.deb && sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
sudo echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/${RELEASE}/${ARCH}/ /" | sudo tee /etc/apt/sources.list.d/cuda-${RELEASE}-${ARCH}.list | |
wget https://developer.download.nvidia.com/compute/cuda/repos/${RELEASE}/${ARCH}/cuda-${RELEASE}.pin | |
sudo mv cuda-${RELEASE}.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
sudo apt update && sudo apt -y install cuda nvidia-cuda-toolkit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment