@@ -16,7 +16,7 @@ CXXFLAGS=-std=c++17 -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I. -Iunittest_l
16
16
CFLAGS =-Ofast -march=native -I. -Iunittest_llmc
17
17
# CFLAGS=-O2 -march=native -I. -Iunittest_llmc
18
18
19
- LDFLAGS =$(STDLIB ) -L$(GPUCPP ) /third_party/lib -ldl -ldawn
19
+ LDFLAGS =$(STDLIB ) -L$(GPUCPP ) /third_party/lib -ldl -ldawn -fsanitize=address
20
20
FLAGS =$(CXXFLAGS ) $(LDFLAGS )
21
21
22
22
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
103
103
mkdir -p build
104
104
$(CC ) $(CXXFLAGS ) -Illm.c $(LDFLAGS ) -o $@ gpt2_webgpu.cpp ops.cpp
105
105
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
+
106
110
build/gpt2_webgpu.html : check-emsdk gpt2_webgpu.cpp term.html llm.c
107
111
em++ gpt2_webgpu.cpp ops.cpp \
108
112
--preload-file gpt2_tokenizer.bin@/gpt2_tokenizer.bin \
@@ -120,8 +124,8 @@ watch-web:
120
124
watch-native :
121
125
ls * .cpp * .c * .hpp * .h | entr -s " rm -f build/gpt2_webgpu && rm -f build/ops.o && make build/gpt2_webgpu"
122
126
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
125
129
126
130
# server: build/train_gpt2.html build/test_gpt2.html build/gpt2_gpucpp.html
127
131
server : build/gpt2_webgpu.html
0 commit comments