- llm模型的cpp实现
- 作者Georgi Gerganov,开发者兼创业者
- https://ggml.ai
- GGML - AI at the edge
基础数据结构tensor库和计算图实现在ggml中。
基础数据结构tensor库和计算图实现在ggml中。
[toc]
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
export LLVM_BUILD_DIR=/project/xingjinglu/llvm-project/build
export PATH=/usr/local/nvidia/bin:$PATH
:%s/r//g 删除DOS方式的回车^M | |
:%s= *$== 删除行尾空白 | |
:%s/^(.*)n1/1$/ 删除重复行 | |
:%s/^.{-}pdf/new.pdf/ 只是删除第一个pdf | |
:%s/<!--_.{-}-->// 又是删除多行注释(咦?为什么要说「又」呢?) | |
:g/s*^$/d 删除所有空行 :这个好用有没有人用过还有其他的方法吗? |
#include <thread> | |
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void foo() | |
{ | |
string s = "thread1"; | |
char name[16]; |
jit-toy: jit-toy.cpp | |
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core) |
# Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 | |
# Run instrumented program, generate and write pgo data | |
./runIt | |
# Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 |
# INSTALL INSTRUCTIONS: save as ~/.gdbinit | |
# | |
# DESCRIPTION: A user-friendly gdb configuration file. | |
# | |
# REVISION : 7.3 (16/04/2010) | |
# | |
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit, | |
# truthix the cyberpunk, fG!, gln | |
# | |
# FEEDBACK: https://www.reverse-engineering.net |
GDB commands by function - simple guide | |
--------------------------------------- | |
More important commands have a (*) by them. | |
Startup | |
% gdb -help print startup help, show switches | |
*% gdb object normal debug | |
*% gdb object core core debug (must specify core file) | |
%% gdb object pid attach to running process | |
% gdb use file command to load object |
--- src/Makefile.original2015-02-27 10:53:53.130125907 -0500 | |
+++ src/Makefile 2015-02-27 10:53:24.674126798 -0500 | |
@@ -7,7 +7,7 @@ | |
PLAT= none | |
CC= gcc -std=gnu99 | |
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) | |
+CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC | |
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) | |
LIBS= -lm $(SYSLIBS) $(MYLIBS) |
--- lua-5.1.4/Makefile 2008-08-12 00:40:48.000000000 +0000 | |
+++ lua-5.1.4-shared-lib/Makefile 2009-01-13 22:01:33.000000000 +0000 | |
@@ -43,7 +43,7 @@ | |
# What to install. | |
TO_BIN= lua luac | |
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp | |
-TO_LIB= liblua.a | |
+TO_LIB= liblua.a liblua.so | |
TO_MAN= lua.1 luac.1 |