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 transformers import AutoModelForCausalLM, AutoTokenizer, StaticCache | |
import torch | |
import os | |
import torch_xla.core.xla_model as xm | |
from datetime import datetime | |
os.environ["PJRT_DEVICE"] = "TPU" | |
def dprint(*args, **kwargs): |
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
#!/usr/bin/python | |
# Mostly inspired from: | |
# https://twitter.com/reach_vb/status/1759716375033938291 | |
from transformers import AutoModelForCausalLM, AutoTokenizer, StaticCache | |
import torch | |
import time | |
import datetime |
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
/* I know this is no good, but I want to use strfry */ | |
#define _GNU_SOURCE | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#define SIZE 500000 | |
#define NTHREADS 4 |