A descriptio of all the steps to be able to debug Zed using Zed. This is useful if you want to add features and fix errors within the Zed codebase using Zed itself.
First you need to download and compile the debugger branch:
import math | |
def compute_cost(num_nodes, gpus_per_node, cost_per_gpu_hour, days): | |
""" | |
Computes the cost of running a certain setup (num_nodes, gpus_per_node) | |
for a specified number of days at a particular cost_per_gpu_hour. | |
:param num_nodes: Number of nodes | |
:param gpus_per_node: Number of GPUs in each node | |
:param cost_per_gpu_hour: Cost per GPU-hour in USD |
from tqdm.auto import tqdm | |
import asyncio | |
import aiohttp | |
import json | |
import time | |
import os | |
import textwrap | |
TOGETHER_API_TOKEN = os.environ['TOGETHER_API_TOKEN'] |
# Example usage: | |
# python merge_peft.py --base_model=meta-llama/Llama-2-7b-hf --peft_model=./qlora-out --hub_id=alpaca-qlora | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
from peft import PeftModel | |
import torch | |
import argparse | |
def get_args(): |
# from: https://stackoverflow.com/a/54088479/121687 | |
import json | |
import requests | |
def get_ngrok_url(): | |
url = "http://localhost:4040/api/tunnels/" | |
res = requests.get(url) | |
res_unicode = res.content.decode("utf-8") | |
res_json = json.loads(res_unicode) |
from graphviz import Digraph | |
import torch | |
from torch.autograd import Variable, Function | |
def iter_graph(root, callback): | |
queue = [root] | |
seen = set() | |
while queue: | |
fn = queue.pop() | |
if fn in seen: |