Skip to content

Instantly share code, notes, and snippets.

#include "sdspi/emmcdrv.h"
#include "xparameters.h"
#include "xstatus.h"
#include "xpm_counter.h"
#include <stdio.h>
#include "xil_cache.h"
#include "pl_dma.h"
#define SDIO_BASE_ADDR XPAR_SDIO_TOP_0_BASEADDR
#define SDIO_DMA
#!/usr/bin/env python
"""
Calculate KL-divergence of two models output logits on data set.
First call the program with write_path and text_path using fp16 model.
./llama_kl.py -m <fp16 model> -t <wiki.test.raw> -w <logits.gz>
This writes logits to file. Then call the program with quantized model with read path
./llama_kl.py -m <quantized model> -r <logits.gz>
KL-divergence to the first run is calculated.
See ./llama_kl.py --help for more options.
"""
@Ttl
Ttl / download_tcec_evals.py
Last active April 10, 2020 15:31
lc0 q to cp eval fitting
#!/usr/bin/python3
from os import path
import urllib.request
base_url = 'https://www.tcec-chess.com/json/TCEC_Season_17_-_Superfinal_{}.pgjson'
games = list(range(1, 17+1))
for game in games:
url = base_url.format(game)
basename = url.split('/')[-1]