Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 | |
import torch.nn.functional as F | |
from torch.nn.attention.flex_attention import flex_attention, create_block_mask | |
import torch | |
head_num = 16 | |
dim = 128 | |
seq_len = 100 | |
chunk_size = 5 | |
batch_size = 1 |
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
# train_grpo.py | |
import re | |
import torch | |
from datasets import load_dataset, Dataset | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from peft import LoraConfig | |
from trl import GRPOConfig, GRPOTrainer | |
# Load and prep dataset |
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
from glob import glob | |
from tqdm import tqdm | |
from multiprocess import Pool | |
import itertools | |
import zipfile | |
import os | |
def chunks(l, n): | |
for i in range(0, len(l), n): | |
yield (l[i: i + n], i // n) |
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
import json | |
import requests | |
import os | |
import boto3 | |
import shutil | |
from tqdm import tqdm | |
client = boto3.client( | |
'bedrock-runtime', | |
region_name='us-west-2', |
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
git clone https://github.com/nvidia/nccl-tests && cd nccl-tests | |
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev -y | |
make MPI=1 MPI_HOME=/usr/lib/x86_64-linux-gnu/openmpi | |
./build/all_reduce_perf -b 8 -e 128M -f 2 -g 4 | |
mpirun -np 10 -H 10.224.0.47,10.224.0.70 ./build/all_reduce_perf -b 8 -e 128M -f 2 -g 4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder