Skip to content

Commit 28c7062

Browse files
authored
Merge pull request #70 from junjihashimoto/feature/aot
Add the ops of AoT
2 parents c9b7018 + f629a33 commit 28c7062

File tree

4 files changed

+1572
-3
lines changed

4 files changed

+1572
-3
lines changed

experimental/kernels/Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CXXFLAGS=-std=c++17 -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I. -Iunittest_l
1616
CFLAGS=-Ofast -march=native -I. -Iunittest_llmc
1717
# CFLAGS=-O2 -march=native -I. -Iunittest_llmc
1818

19-
LDFLAGS=$(STDLIB) -L$(GPUCPP)/third_party/lib -ldl -ldawn
19+
LDFLAGS=$(STDLIB) -L$(GPUCPP)/third_party/lib -ldl -ldawn -fsanitize=address
2020
FLAGS=$(CXXFLAGS) $(LDFLAGS)
2121

2222
ifeq ($(shell [ -d /opt/homebrew/opt/libomp/lib ] && echo "exists"), exists)
@@ -103,6 +103,10 @@ build/gpt2_webgpu: llm.c gpt2_124M.bin llm.c gpt2_webgpu.cpp ops.cpp
103103
mkdir -p build
104104
$(CC) $(CXXFLAGS) -Illm.c $(LDFLAGS) -o $@ gpt2_webgpu.cpp ops.cpp
105105

106+
build/gpt2_webgpu_aot: llm.c gpt2_124M.bin llm.c gpt2_webgpu_aot.cpp ops_aot.cpp
107+
mkdir -p build
108+
$(CC) $(CXXFLAGS) -Illm.c $(LDFLAGS) -o $@ gpt2_webgpu_aot.cpp ops_aot.cpp -g
109+
106110
build/gpt2_webgpu.html: check-emsdk gpt2_webgpu.cpp term.html llm.c
107111
em++ gpt2_webgpu.cpp ops.cpp \
108112
--preload-file gpt2_tokenizer.bin@/gpt2_tokenizer.bin \
@@ -120,8 +124,8 @@ watch-web:
120124
watch-native:
121125
ls *.cpp *.c *.hpp *.h | entr -s "rm -f build/gpt2_webgpu && rm -f build/ops.o && make build/gpt2_webgpu"
122126

123-
run-native: build/gpt2_webgpu
124-
. $(GPUCPP)/source && ./build/gpt2_webgpu
127+
run-native: build/gpt2_webgpu_aot
128+
. $(GPUCPP)/source && ./build/gpt2_webgpu_aot
125129

126130
# server: build/train_gpt2.html build/test_gpt2.html build/gpt2_gpucpp.html
127131
server: build/gpt2_webgpu.html

0 commit comments

Comments
 (0)