Skip to content

Instantly share code, notes, and snippets.

View dadeba's full-sized avatar

N.Nakasato dadeba

  • University of Aizu
  • Japan
View GitHub Profile
@dadeba
dadeba / gist:6955b336969c2f3e2a568fe06f364232
Last active February 27, 2024 10:08
axolotl with ROCm
### 1. install bnb for ROCm
### 1.1
git clone --recurse https://github.com/ROCmSoftwarePlatform/bitsandbytes
cd bitsandbytes
git checkout rocm_enabled
### 1.2
edit Makefile & "ROCM_TARGET=gfx1100 make hip; python setup.py install"
diff --git a/Makefile b/Makefile
# build
git clone https://github.com/dadeba/ggml
cd ggml
git checkout gpt-neox
mkdir build
cd build
cmake ..
make
cd ..
CLI_ARGS=--model vicuna-13b --listen --auto-devices
@dadeba
dadeba / Dockerfile
Created July 14, 2022 08:11
Dockerfile
FROM ubuntu:18.04
#
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential && \
apt-get install -y software-properties-common && \
apt-get install -y curl git man unzip vim wget sudo zsh locales && \
apt-get install -y net-tools iputils-ping emacs
#
@dadeba
dadeba / run-aocl-docker
Last active July 14, 2022 08:07
script
#!/bin/bash
mkdir -p ./home/shared
shared=$(realpath ./home/shared)
sudo docker run \
-l fpga-docker --name fpga -h aoclfpga \
--rm --network host -v $shared:/home/$(whoami)/shared \
-v /usr/local/intelFPGA_pro:/usr/local/intelFPGA_pro \
-d -P aocl:devel
function FindProxyForURL(url, host) {
return "SOCKS localhost:8000";
}
@dadeba
dadeba / main_grav2.c
Last active June 27, 2019 01:41
g5: bare metal C code
extern float base0;
float sqrtf(float);
void grav_kernel(float *x, float *y, float *z, float *m,
float *ax, float *ay, float *az, float *pt, float *res,
int n);
int main(int argc, char * argv[])
{
@dadeba
dadeba / FPMUL.v
Last active December 8, 2018 10:31
pipelined FPMUL
module FPMUL( // @[:@3.2]
input clock, // @[:@4.4]
input reset, // @[:@5.4]
input [31:0] io_x, // @[:@6.4]
input [31:0] io_y, // @[:@6.4]
output [31:0] io_z // @[:@6.4]
);
wire [7:0] _T_12; // @[FPBASE.scala 16:27:@9.4]
wire _T_14; // @[FPBASE.scala 27:17:@10.4]
wire [31:0] _T_18; // @[FPBASE.scala 13:33:@15.6]
@dadeba
dadeba / yuv2png.py
Last active November 14, 2018 14:28
YUYV422 to PNG using OpenCV
#!/usr/bin/python3
from __future__ import print_function
import cv2
import numpy as np
import sys
import os.path
def c255(x):
return min(max(int(x),0),255)
+ def config_sync(self, size, direc):
+ with open(self.class_path + '/sync_size', mode='w') as f:
+ f.write(str(size))
+ with open(self.class_path + '/sync_direction', mode='w') as f:
+ f.write(str(direc))
+
+ def sync_for_cpu(self):
+ with open(self.class_path + '/sync_for_cpu', mode='w') as f:
+ f.write(str(1))
+