Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Zenzai and CoreML #115

Open
1 of 4 tasks
ensan-hcl opened this issue Aug 3, 2024 · 0 comments
Open
1 of 4 tasks

[Feature Request] Zenzai and CoreML #115

ensan-hcl opened this issue Aug 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ensan-hcl
Copy link
Owner

背景

Zenzaiは現在llama.cppを推論ランタイムとして動いている。llama.cppはプラットフォーム間の移植が容易である利点がある一方で、Apple PlatformsにおいてはNPU(Neural Engine)を利用できないため、効率においてCoreMLに劣る可能性がある。
そこで、CoreMLを用いたZenzaiの実装を実現し、llama.cppを上回る推論パフォーマンスを得たい。

現在の状況

@Skyline-23 さんによるzenzモデルのCoreML版が存在する。
https://github.com/Skyline-23/zenz-CoreML

これを用いて推論を行う実装が以下であり、現在logitの取得までは達成できている。しかし推論時間はllama.cppの1.4倍程度遅く、またNPUが適切に使えていないと見られる挙動を示す。

https://github.com/ensan-hcl/swift-zenz-coreml

やりたいこと

以上を踏まえ、以下を行ってllama.cppを超える性能を得たい。これが実現できれば、原理的にはApple PlatformにおいてCoreMLを利用した高速化が得られることになる。

  • zenz-v2(無改造のGPT-2)をCoreMLで動かし、入力に対するlogitを得る
  • Quantization, Palletizationをかけてモデルを圧縮する
  • KV-Cachingを有効にする
  • llama.cppよりも高速な推論性能を得る
@ensan-hcl ensan-hcl added the enhancement New feature or request label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant