Skip to content

Initial ET backend #24179

Merged
taronaeo merged 289 commits into
ggml-org:masterfrom
marty1885:et-backend-n-way-merge
Jul 10, 2026
Merged

Initial ET backend #24179
taronaeo merged 289 commits into
ggml-org:masterfrom
marty1885:et-backend-n-way-merge

Conversation

@marty1885

@marty1885 marty1885 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR is developed by AINekko and by members of AIFoundry (AINekko's OSS community) and adds the ET backend that supports the ET-SOC-1 processor. ET-SOC-1 was originally created by Esperanto Technologies which AINekko later open sourced under Apache 2.0 and would like to upstream the llama.cpp backend we developed for it as a way to integrate open source hardware into the open source inference ecosystem.

The the ET processor core documentation and RTL can be found at the following links

  • CORE-ET RTL (compute, unfortunately NoC/memory/PCIe are not open)
  • et-platform SDK and driver

As ET-SOC-1 is an older low power processor, the absolute performance is not impressive compared to even CPUs. But it still provides better performance per watt then my ARM R7 7700 development machine can do. Please refer to the following table for concrete performance number

image

The backend supports most smaller language models, passes llama.cpp unit testing (with minimal modification to loosen bounds a bit). And we consider Uberkernel (the in-kernel version of device side dispatch) experimental and good-to-have if the model supports it.

image

If CI is needed for the backend being accepted, please let me know and I can setup CI rigs or provide card access. AINekko is planning on making the ET-SOC-1 publicly available in card form. But manufacturing needs significant de-risking and we feel it's right to upstream as in principle it is viable to construct an FPGA or even tape out using the open source RTL.

Also if desirable, I am willing to be the maintainer of the ET backend and find others so bus factor > 1. Please let me know what is required and I will handle it from my side.

(As a side node. People might recall me working on llama.cpp integration for Tenstorrent, I no longer work there but the Tenstorrent community and me are still working on that integration gradually)

(Also side note, the PR was supposed to go through AIFoundry's repo, but due to timing and other reasons, the PR is created via my personal github repo).

Additional information

Some existing OSS discussions and material on ET-SOC-1

Posts:

FOSDEM:

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. Some kernel optimization strategies are explored by AI. Potentially also usage by community members. But I have personally ensure we are capable of hand writing and reason through. As well as some implementation tests.

@marty1885 marty1885 requested a review from ggerganov as a code owner June 5, 2026 11:57
@github-actions github-actions Bot added documentation Improvements or additions to documentation testing Everything test related examples python python script changes server ggml changes relating to the ggml tensor library for machine learning labels Jun 5, 2026
@ggml-gh-bot

ggml-gh-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

Hi @marty1885, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Large PR: Large changes require prior discussion (e.g. an issue or RFC) and maintainers may not be able to review this PR as-is. Consider splitting it into smaller, focused PRs.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@marty1885 marty1885 force-pushed the et-backend-n-way-merge branch from a50a88b to 7e61d6f Compare June 5, 2026 12:11

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you refactor this PR such that it only focuses on the ET backend? Leave things like tests/test-backend-ops.cpp to another PR so that its easier to review.

@taronaeo taronaeo self-assigned this Jun 5, 2026
@marty1885

Copy link
Copy Markdown
Contributor Author

@taronaeo Yes and done. Changes in test-backend-ops were needed for stability and finishing perf tests in a reasonable amount of time. And change in ggml-backend.cpp was needed to get the llama-tts working on ET backend. I will separate them into their own PR.

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't read through everything. In general, please clang-format your codebase so that the indents are consistent. Follow the contributing guidelines too.

Comment thread ggml/src/ggml-et/ggml-et.cpp Outdated
Comment thread ggml/src/ggml-et/ggml-et.cpp
Comment thread ggml/src/ggml-et/ggml-et.cpp Outdated
Comment thread ggml/src/ggml-et/ggml-et.cpp
@ubergarm

ubergarm commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@marty1885 great seeing you pull all the hard work by ainekko/aifoundry crew together here!

Since I still have some access to a rig with multiple ET-SoC-1 PCIe cards I just gave it a try. Got it running with the latest google/gemma-4-E2B-it-qat-q4_0-gguf and also tried older Qwen3-0.6B with and without UBERKERNEL successfully!

👈 Details
# build riscv-gnu-toolchain and et-platform using ET.md docs
# https://github.com/marty1885/llama.cpp/blob/et-backend-n-way-merge/docs/backend/ET.md#build
# https://github.com/aifoundry-org/et-platform#how-to-build-et-platform

# get PR code
$ git fetch marty1885
$ git checkout et-backend-n-way-merge
$ git rev-parse --short HEAD
35e190acd

# build for ET backend
$ cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_ET=ON -DGGML_ET_SYSEMU=OFF
$ cmake --build build --config Release -j $(nproc)

# run the latest official Gemma-4 QAT Q4_0 on single ET-SoC-1 device
model=/models/google/gemma-4-E2B-it-qat-q4_0-gguf/gemma-4-E2B_q4_0-it.gguf
GGML_ET_UBERKERNEL=0 \
./build/bin/llama-cli \
    --model "$model" \
    --device ET0 \
    -fa on \
    --parallel 1 \
    --ctx-size 8192 \
    -ngl 999 \
    -t 1 \
    --single-turn \
    -p "Count from 1 to 3 in French."

...

[ Prompt: 32.0 t/s | Generation: 5.1 t/s ]

# Now run ggml-org/Qwen3-0.6B-GGUF/Qwen3-0.6B-Q8_0.gguf
# with and without GGML_ET_UBERKERNEL

# UK=0
[ Prompt: 79.7 t/s | Generation: 10.0 t/s ]

# UK=1
[ Prompt: 86.6 t/s | Generation: 19.1 t/s ]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll be great if you can have this script be in cpp so we won't introduce python to the build process, like we have in the Vulkan backend.
Avoiding python means the build process has fewer dependencies and users will have fewer issues with it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported the code into CMake to simplify the build graph since the only build system now. Hope that's fine, I can make it C if desired.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this script in CMake is even better, let's keep that

Comment thread ggml/src/ggml-et/CMakeLists.txt Outdated

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Same comments as all *.in files
  2. Can the scripts sit in its own scripts directory?

Comment thread ggml/src/ggml-et/cmake/ggml-et-kernels-embed.cpp.in
Comment thread ggml/src/ggml-et/et-kernels/src/ggml_tensor.h
Comment thread ggml/src/ggml-et/et-kernels/src/quants.h

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase with upstream/master and regenerate docs/ops.md. I think we should be good to go after that.

Comment on lines +3 to +4
#ifndef GGML_TENSOR_H
#define GGML_TENSOR_H

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef GGML_TENSOR_H
#define GGML_TENSOR_H
#ifndef GGML_ET_TENSOR_H
#define GGML_ET_TENSOR_H

Comment thread ggml/src/ggml-et/et-kernels/src/ggml_tensor.h
@marty1885

Copy link
Copy Markdown
Contributor Author

Sorry for the lack of progress - my computer(s) broken due to an accident and wasn't able to produce patches. It is working again. Will supply update soon

@marty1885 marty1885 force-pushed the et-backend-n-way-merge branch from 92283b8 to e881fe8 Compare June 30, 2026 13:11
@marty1885

Copy link
Copy Markdown
Contributor Author

@taronaeo please sorry for the delay. Please review when you are avaliable

@taronaeo

taronaeo commented Jul 2, 2026

Copy link
Copy Markdown
Member

Sorry for the delay. I'll review this by the end of this week.

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add yourself to CODEOWNERS

Comment thread ggml/src/ggml-backend-reg.cpp Outdated
Comment thread AGENTS.md
Comment thread ggml/src/ggml-et/ggml-et.cpp Outdated
Comment thread ggml/src/ggml-et/ggml-et.cpp
Comment thread ggml/src/ggml-et/ggml-et.cpp
@marty1885 marty1885 requested a review from a team as a code owner July 7, 2026 17:44
@marty1885

Copy link
Copy Markdown
Contributor Author

Oh crap... Sorry for the trigger. I was merging to resolve the conflict in docs/ops.md and did not realize how GGML's notification system works. Rebasing was possible but a long fight that I wish to avoid.

Will push a new one soon. Sorry!

@marty1885 marty1885 force-pushed the et-backend-n-way-merge branch from af7e585 to 1fb874e Compare July 7, 2026 17:49
@marty1885 marty1885 force-pushed the et-backend-n-way-merge branch from 1fb874e to 0944c7e Compare July 7, 2026 18:54
@taronaeo taronaeo removed the request for review from a team July 9, 2026 15:56

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor changes and we're good to go :)

Comment thread CODEOWNERS Outdated
Comment thread tests/test-backend-ops.cpp Outdated
@taronaeo

taronaeo commented Jul 9, 2026

Copy link
Copy Markdown
Member

@ggml-org/maintainers Another review please.

@pwilkin

pwilkin commented Jul 9, 2026

Copy link
Copy Markdown
Member

No way :P
image

@marty1885

Copy link
Copy Markdown
Contributor Author

Praying this works :)

@pwilkin

pwilkin commented Jul 9, 2026

Copy link
Copy Markdown
Member
image

@taronaeo taronaeo merged commit 082b326 into ggml-org:master Jul 10, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples ggml changes relating to the ggml tensor library for machine learning Hexagon python python script changes server testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants