mit-han-lab / TinyChatEngine

TinyChatEngine: On-Device LLM Inference Library

Home Page:https://mit-han-lab.github.io/TinyChatEngine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to deploy models in Android

sqzhang-jeremy opened this issue · comments

Hi team,

Thanks for your amazing work.

I met a problem while deploying models in my Google Pixel 8 Pro(ARM).

  • Accelerate/Accelerate.h, which is typically found in the Accelerate framework and available on Apple platforms.
  • Gelu.cc

`../kernels/neon/matmul_neon_fp32.cc:6:10: fatal error: Accelerate/Accelerate.h: No such file or directory

6 | #include <Accelerate/Accelerate.h>

| ^~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

make: *** [Makefile:181: build/transformer/../kernels/neon/matmul_neon_fp32.o] Error 1

make: *** Waiting for unfinished jobs....

../kernels/neon/matmul_neon_int8_int4.cc:7:10: fatal error: Accelerate/Accelerate.h: No such file or directory

7 | #include <Accelerate/Accelerate.h>

| ^~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

make: *** [Makefile:181: build/transformer/../kernels/neon/matmul_neon_int8_int4.o] Error 1

src/ops/Gelu.cc: In function ‘float Gelu_imp(float)’:

src/ops/Gelu.cc:10:31: error: ‘tanhf’ was not declared in this scope

10 | return 0.5f x (1.0f + tanhf(SQRT_2_OVER_PI x (1.0f + GELU_COEF_A x x)));

| ^~~~~

src/ops/Gelu.cc: In function ‘float Gelu_quick_imp(float)’:

src/ops/Gelu.cc:20:32: error: ‘expf’ was not declared in this scope

20 | return x (1.0f / (1.0f + expf(GELU_QUICK_COEF x)));

| ^~~~

make: *** [Makefile:181: build/transformer/src/ops/Gelu.o] Error 1`

Could you help me fix the bugs? Thanks

Cheers,
Jeremy

  • For the second question, I added #include <cmath> at the beginning of Gelu.cc, which fixed the bug.
  • For the first question, I tried to use NNAPCK to fix the acceleration problem. However, I could not locate the CMakeList.txt in TinyChatEngine when I built the whole NNAPCK. Lol. I am not sure this is the correct way.

Thank you. Bugs was fixed through the latest version.
TinyChatEngine