Skip to content

Commit

Permalink
[ layer ] Enable mha gtest and match version
Browse files Browse the repository at this point in the history
- Current mha layer at nntrainer/layer is not for general use, but implemented solely for LLaMA support.
- In order to run unittest for mha layer, return to previous version of mha layer, and move current implementation under Application/LLaMA

**Self evaluation:**
1. Build test:     [X]Passed [ ]Failed [ ]Skipped
2. Run test:     [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: skykongkong8 <[email protected]>
  • Loading branch information
skykongkong8 committed Jun 3, 2024
1 parent d50487a commit f7055eb
Show file tree
Hide file tree
Showing 8 changed files with 1,938 additions and 640 deletions.
22 changes: 21 additions & 1 deletion Applications/LLaMA/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ LOCAL_C_INCLUDES += $(NNTRAINER_INCLUDES)

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_ARM_NEON := true
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib -DENABLE_FP16=1 -DUSE__FP16=1
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti -DENABLE_FP16=1 -DUSE__FP16=1
LOCAL_CFLAGS += -pthread -fexceptions -fopenmp -static-openmp -DENABLE_FP16=1 -DUSE__FP16=1
LOCAL_LDFLAGS += -fexceptions -fopenmp -static-openmp -DENABLE_FP16=1 -DUSE__FP16=1
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := custom_multi_head_attention_layer
LOCAL_LDLIBS := -llog -landroid -fopenmp -static-openmp -DENABLE_FP16=1 -DUSE__FP16=1

LOCAL_SRC_FILES := custom_multi_head_attention_layer.cpp

LOCAL_SHARED_LIBRARIES := nntrainer ccapi-nntrainer

LOCAL_C_INCLUDES += $(NNTRAINER_INCLUDES)

include $(BUILD_SHARED_LIBRARY)


include $(CLEAR_VARS)
Expand All @@ -96,7 +116,7 @@ LOCAL_LDLIBS := -llog -landroid -fopenmp -static-openmp -DENABLE_FP16=1 -DUSE__F

LOCAL_SRC_FILES := main.cpp

LOCAL_SHARED_LIBRARIES := nntrainer ccapi-nntrainer rms_norm_layer swiglu_layer
LOCAL_SHARED_LIBRARIES := nntrainer ccapi-nntrainer rms_norm_layer swiglu_layer custom_multi_head_attention_layer

LOCAL_C_INCLUDES += $(NNTRAINER_INCLUDES)

Expand Down
Loading

0 comments on commit f7055eb

Please sign in to comment.