This file contains hidden or 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/bash | |
| # Name of the input file containing commands | |
| input_file="cmd_lines.sh" | |
| # Read the input file line by line | |
| while IFS= read -r line; do | |
| # Skip empty lines and comments | |
| if [[ -z "$line" ]] || [[ "$line" =~ ^# ]]; then | |
| continue |
This file contains hidden or 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
| # The library contains bug; do not use | |
| cd $(mktemp -d) | |
| git clone --recursive https://github.com/ROCmSoftwarePlatform/flash-attention.git | |
| export GPU_ARCHS="gfx90a" | |
| cd flash-attention | |
| export PYTHON_SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])') | |
| patch "${PYTHON_SITE_PACKAGES}/torch/utils/hipify/hipify_python.py" hipify_patch.patch | |
| pip install . |
This file contains hidden or 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
| import torch | |
| ngpus = torch.cuda.device_count() | |
| N, M, K = 1280, 2560, 5120 | |
| def matmul(): | |
| A = [] | |
| B = torch.randn(M, K, device='cuda:0') | |
| for i in range(ngpus): |
This file contains hidden or 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
| sudo apt-get install -y wget gpg ; wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg | |
| sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg | |
| sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' | |
| rm -f packages.microsoft.gpg | |
| sudo apt install -y apt-transport-https ; sudo apt update ; sudo apt install -y code ; code tunnel --accept-server-license-terms |
This file contains hidden or 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
| import openai | |
| import asyncio | |
| from typing import Any | |
| async def dispatch_openai_requests( | |
| messages_list: list[list[dict[str,Any]]], | |
| model: str, | |
| temperature: float, | |
| max_tokens: int, | |
| top_p: float, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| ##################### | |
| # | |
| # Use this with or without the .gitattributes snippet with this Gist | |
| # create a fixle.sh file, paste this in and run it. | |
| # Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
| # This Gist normalizes handling by forcing everything to use Unix style. | |
| ##################### | |
| # Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
This file contains hidden or 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
| sudo apt-get -y install \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| gnupg-agent \ | |
| software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo apt-key fingerprint 0EBFCD88 | |
| sudo add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
This file contains hidden or 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
| ## docker | |
| ```bash | |
| alias=`whoami | cut -d'.' -f2`; sudo docker run -it --rm --runtime=nvidia --ipc=host --privileged -v /home/${alias}:/home/${alias} -v /mnt/data:/mnt/data pytorch/pytorch:1.1.0-cuda10.0-cudnn7.5-devel bash | |
| ``` | |
| ## docker setup | |
| ```bash | |
| apt-get update | |
| apt-get install -y vim wget ssh |
This file contains hidden or 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
| # install XML::DOM plugin, instructions https://web.archive.org/web/20171107220839/www.summarizerman.com/post/42675198985/figuring-out-rouge | |
| cpan App::cpanminus | |
| cpanm XML::DOM | |
| # test fails with XLM::Parser missing error, install it | |
| sudo apt-get install libexpat1-dev | |
| cpanm XML::Parser | |
| cd /mnt/data/ | |
| git clone https://github.com/andersjo/pyrouge.git |
NewerOlder