<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by ENERZAi on Medium]]></title>
        <description><![CDATA[Stories by ENERZAi on Medium]]></description>
        <link>https://medium.com/@enerzai?source=rss-ad004e8e11d5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GsXyOML9A7HLDQXFFAcK7w.jpeg</url>
            <title>Stories by ENERZAi on Medium</title>
            <link>https://medium.com/@enerzai?source=rss-ad004e8e11d5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:00:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@enerzai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Porting a Ternary STT Model to the Synaptics Torq NPU]]></title>
            <link>https://medium.com/@enerzai/porting-a-ternary-stt-model-to-the-synaptics-torq-npu-bf9f55a6910e?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf9f55a6910e</guid>
            <category><![CDATA[low-bit-quantization]]></category>
            <category><![CDATA[npu]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[enerzai]]></category>
            <category><![CDATA[compiler-optimization]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 06:19:47 GMT</pubDate>
            <atom:updated>2026-10-27T06:19:47.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello from ENERZAi! In our previous post, <em>Journey to Torq Compiler</em> (<a href="https://medium.com/@enerzai/optimizing-the-mlir-based-torq-npu-compiler-f5ea6628c95d">https://medium.com/@enerzai/optimizing-the-mlir-based-torq-npu-compiler-f5ea6628c95d</a>), we looked at the compiler architecture for the Synaptics Torq NPU and at where, and how, we reduced the hidden data-movement cost that comes with splitting an operation across two SLICEs for parallel execution.</p><p>This post picks up from there. It covers how we took an extremely quantized (ternary) model, a topic we have been researching for years, all the way onto a real NPU using the same Torq compiler. The key was keeping 2-bit packed weights from being unpacked too early during compilation, so that they stay in that form until just before computation and the storage and data-transfer savings from quantization carry through to execution.</p><p>To do this, we connected the packed-weight path already built into the hardware and the compiler’s block quantization path all the way through to a real model. As a result, we were able to run a speech-to-text model with about 250 million parameters and 1.58-bit (ternary) quantization in real time on the Torq NPU in the SL2619, part of the Synaptics Astra SL2610 product line.</p><p>These two paths did not connect to a real model seamlessly from the start, though. The Torq hardware and compiler already had mechanisms to keep 2-bit weights from being unpacked, but when we applied them to a real model, there were points where those mechanisms did not carry all the way through. In this post, we first look at those mechanisms, then walk through how we closed the gaps so that 2-bit weights make it through the entire compiler. We finish with measurements in a real on-device environment and the optimization work that still remains.</p><p>We use the same terms and dialects introduced in the previous post. If XRAM, LRAM, DMA, SLICE, or linalg, torq_hl, and torq_hw are unfamiliar, reading that post first will help.</p><h3>Extreme Quantization and the Gap in Compiler Support</h3><p>Ternary quantization restricts weights to three values, {-1, 0, 1}, which dramatically reduces model size and weight transfer volume; it is often called 1.58-bit quantization. But a smaller model file does not automatically mean those benefits survive at runtime. If values smaller than a byte, such as 2-bit values, are unpacked into a larger data type too early in compilation, the savings in storage and data transfer are lost. The sub-byte form, meaning anything smaller than a byte, therefore had to survive IR transformations, memory allocation, DMA, and kernel generation, all the way until just before computation.</p><p>Fortunately, Torq already had a solid foundation for this. The hardware provides a path that can store and read sub-byte integer weights in compressed form, that is, packed. Packing here means storing several sub-byte values together inside a single byte. A 2-bit integer, for example, lets you fit four values in one byte.</p><p>The remaining challenge was making full use of this hardware capability across the entire compiler. Even after compressed weights went through multiple transformations, the compiler had to be able to recognize their original form and keep it intact until the actual kernel ran.</p><h3>The Packed-Weight Path</h3><p>The benefit of packing goes beyond reducing XRAM usage. Because weights can move from XRAM to LRAM in compressed form, without being unpacked first, the amount of data transferred by DMA also shrinks. In other words, you save both memory and bandwidth at the same time.</p><p>Since ternary weights use only three values, {-1, 0, 1}, they can be represented as signed 2-bit integers. On Torq hardware, these weights follow this path:</p><pre>[1] Compiled model file : packed as 2-bit (4 values per byte)<br>[2] XRAM                : still 2-bit; ideally 1/8 the size of bf16<br>[3] DMA to LRAM         : packed bytes are transferred as is<br>[4] LRAM                : still 2-bit; not pre-expanded to bf16<br>[5] Read on W path      : expanded from int2 -&gt; bf16 at this point<br>[6] ALU                 : bf16 weight x bf16 activation</pre><p>The most important step is [5]. Weights stay in 2-bit form even inside LRAM, and are expanded to bf16 only at the moment the W path reads them for computation. If this path can be used, there is no need for a separate decompression buffer or a standalone dequantization kernel. Even after compilation, the weight operand remains a 2-bit integer type, and the hardware is configured to interpret it as a signed value and expand it to bf16 as it is read.</p><p>The effect shows up immediately in storage. In ENERZAi’s ternary STT model, about 198 million of the roughly 250 million parameters are ternary weights. For these weights alone, the theoretical sizes are:</p><ul><li>bf16: about 396 MB</li><li>packed 2-bit: about 49.5 MB</li></ul><p>These are theoretical sizes, calculated by multiplying the parameter count by the bit width of a single element. We will come back to the memory usage actually measured on the board later.</p><p>There is one important constraint, however. This capability is not available equally on every input path. In Torq’s current linalg.matmul lowering, the first operand (lhs) is connected to the W path and the second operand (rhs) to the D path, and sub-byte expansion is supported only on the W path. So to keep compressed weights intact until execution, those weights must take the W role. If they go into the D path instead, the compressed input either cannot be used as is or needs a separate expansion step. The same matrix multiplication, mathematically, may not be the same operation from the hardware&#39;s point of view.</p><p>A small test case that places the same 2-bit weight in the W role and in the D role makes the difference clear.</p><pre>// Weight role: packed 2-bit values are passed directly to the matmul<br>op : &quot;matmul-fast&quot;<br>  W %arg2 : memref&lt;64x64xi2, lram&gt;<br>  CFG {weight_format = SI, alu_format = BF, ...}<br><br>// Data role: an explicit expansion kernel appears, and widened bf16 data is consumed.<br>op : &quot;i2f&quot;<br>  D %arg1 : memref&lt;64x64xi8, lram&gt;<br>op : &quot;matmul-fast&quot;<br>  D %arg1 : memref&lt;128x64xbf16, lram&gt;</pre><p>In this experiment, moving the weight into the D role prevented the packed path from surviving. The compiler produced an 8-bit integer input plus a separate i2f path, and the corresponding weight data transferred into LRAM grew to four times the size of the packed 2-bit case.</p><h3>The Block Quantization Path</h3><p>When weights are reduced to just three values, finer-grained scales are usually needed to preserve accuracy. Instead of applying a single scale to an entire tensor, block quantization groups a fixed number of weights into blocks and gives each block its own scale. In our model, not only the ternary weights but also the 4-bit weights in the final vocabulary projection, the LM head, are represented this way.</p><p>When we joined the project, the core of this path was already implemented in the Torq compiler. The central operation is torq_hl.expand_weights. It takes compressed integer weights and per-block scales, and turns them into a kernel that expands each value as it is read and immediately applies that block&#39;s scale.</p><p>One particularly interesting detail is how zero points are handled. Weight dequantization is conceptually (q - z) * s, but this does not require a standalone subtraction kernel. Because the zero point is constant, it can be algebraically folded together with the scale into a bias/scale-compatible representation that the ACT path already knows how to consume. The important point is not that the zero point itself is simply stored in some particular memory location, but that the dequantization expression is rewritten into a form the hardware can process efficiently.</p><p>The compiler also already knew how to bufferize and serialize packed sub-byte integers into the model file, so the basic path from a 2-bit constant in the file to a hardware kernel was already in place.</p><p>We were not starting from a blank slate. The remaining work appeared when we ran a real model through that path and started hitting assumptions that had been reasonable for the original implementation but were too narrow for our model.</p><p>The first case showed up in the 4-bit LM head. This layer uses both a scale and a floating-point zero point for each block, while the existing path had been written around integer zero points. We extended the lowering so that a value incorporating the scale could be folded into the bias input of expand_weights even when the zero point was floating point. Rather than redesigning the kernel, we widened the set of quantization parameters that the existing block-quantization path could represent.</p><p>The same LM head also introduced unsigned 4-bit weights. Signedness is not always preserved directly in the compiler type, so blindly following the existing signed-weight path could reinterpret more than half of the values as negative. We inspected whether the dequantization expression used unsigned conversion semantics, propagated that property down the pipeline, and configured the hardware to zero-extend those weights instead of sign-extending them.</p><p>Finally, we stopped assuming that scale and zero point would always appear at fixed operand positions. Different model exporters can produce equivalent dequantization expressions with different operand ordering. Matching by position can therefore fail silently: the model still compiles, but the optimization simply does not fire. We changed the matcher to infer the roles of scale and zero point from the structure and semantics of the computation instead.</p><p>None of these changes added a brand-new operation. They widened an existing block-quantization path so that it could accept a broader range of real model representations. Because Synaptics had already built the foundation, we only needed to extend the boundaries that our model exposed.</p><h3>Tracking 2-Bit Weights All the Way Through</h3><p>To make full use of the hardware path described above in a real ternary model, the compiler had to recognize that a weight was originally a packed integer constant, even after it went through multiple IR transformations. Similar problems kept appearing in different forms, so here we follow one representative case from the beginning.</p><p>From the compiler’s point of view, a ternary weight is not a special kind of object. It is simply an integer constant with a small bit width, and that information is already in the IR type. For example, the type tensor&lt;128x64xi2&gt; alone tells you that each element is 2 bits.</p><p>The existing Torq compiler decided whether a weight was packed only at the final, kernel-generation stage. At that stage, it checked the weight operand of a matrix multiplication, and if it could tell that the value came from a packed integer constant, it sent the weight to the W path.</p><p>The problem was that several transformations could sit between the constant and the matrix multiplication. By the time compilation reached kernel generation, the original integer constant could already be hidden behind those transformations. If that happened, the compiler fell back to the ordinary bf16 path. The model file could still be small while the runtime execution lost the packed-weight advantage entirely.</p><p>The first problem was a type conversion. The model kept the weight as a 2-bit constant, then converted it to bf16 immediately before the matrix multiplication.</p><pre>%cst = arith.constant dense_resource&lt;...&gt; : tensor&lt;128x64xi2&gt;   // still 2-bit up to here<br>...<br>%w  = tensor.extract_slice %cst[%i, 0] [64, 64] [1, 1]<br>        : tensor&lt;128x64xi2&gt; to tensor&lt;64x64xi2&gt;                 // still i2 after slicing<br>%wf = linalg.generic ins(%w) { arith.sitofp %in : i2 to bf16 }  // expanded here<br>%we = tensor.expand_shape %wf ...<br>linalg.batch_matmul ins(%we, %act) ...                          // kernel generation sees only bf16</pre><p>A single sitofp was the whole cause, but that was enough. The %we that kernel generation sees is already a bf16 tensor, and the original packed 2-bit constant is hidden behind the conversion. So we changed the analysis to trace back through shape-only operations and type conversions to find the original integer tensor, and to pass that integer tensor to the W path instead of the bf16-converted value. This defers expansion again until the moment the hardware actually reads the weights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HSqnjxrXcH_uKAo3k63_0A.png" /><figcaption>A ternary 768x768 matmul (50 tokens) with slicing enabled shows the difference clearly. Before the change, ① a separate SLICE program unpacked i8 weights to bf16 and stored them in XRAM (144 KB × 8), and ② each matmul tile read those bf16 weights back into LRAM (144 KB × 8). After the change, ③ the packed i2 weights go straight into the W path (72 KB × 2) and are expanded only when actually read. Total DMA traffic dropped from 3.5 MB to 372 KB, and estimated execution time fell from 1135.9 µs to 274.3 µs.</figcaption></figure><p>We thought that solved the problem, but the same issue reappeared after slicing.</p><p>When a matrix multiplication was split across two slices, there were cases where an already-sliced weight tile had to be split again. If the IR first expanded the coarse tile to bf16 and only then extracted the smaller slice needed by the matmul, the packed-origin tracking broke again.</p><pre>// Shape produced by slicing: expand first, extract the finer slice afterward.<br>%wt = extract_slice %cst[o, 0] [T, K]      : tensor&lt;MxK xi2&gt;     // coarse packed tile<br>%dt = linalg.generic sitofp %wt            : tensor&lt;TxK xbf16&gt;   // expand the whole tile<br>%s  = extract_slice %dt[i, 0] [t, K]       : tensor&lt;txK xbf16&gt;   // finer tile used by matmul<br>linalg.batch_matmul ins(%s, %act) ...<br><br>// Rewritten shape: slice first, expand afterward.<br>%ws = extract_slice %cst[o+i, 0] [t, K]    : tensor&lt;txK xi2&gt;     // slice while still packed<br>%wd = linalg.generic sitofp %ws            : tensor&lt;txK xbf16&gt;<br>linalg.batch_matmul ins(%wd, %act) ...</pre><p>In the first form, the existing recognition logic could not reach the original integer constant. It knew how to look through shape-only transformations, but not through the extract_slice that appeared after expansion. We rewrote the IR so that the packed constant was sliced first and expanded afterward. The mathematical computation is identical, but the new form preserves a trail the packed-weight analysis can follow.</p><p>If this second issue had only caused a performance regression, it would actually have been harder to notice. Instead, compilation stopped. The leftover expansion lowered into an independent dequantization kernel whose input was still a packed constant, and kernel generation eventually failed with Compressed iType not supported here.</p><p>Once both cases were handled, the result was visible directly in torq_hl: the weight operand of the matrix multiplication was still typed as 2-bit.</p><pre>&quot;torq_hl.matmul&quot;(%act, %shift, %w, %acc)<br>: (tensor&lt;1x64x64xbf16&gt;, tensor&lt;2xi32&gt;, tensor&lt;64x64xi2&gt;, tensor&lt;1x64x64xbf16&gt;)<br>-&gt; tensor&lt;1x64x64xbf16&gt;</pre><p>The second rewrite did more than eliminate a compiler error. By allowing the packed weight to survive slicing, it also restored the intended two-slice execution. In an A/B comparison of compiler builds on the same model, both encoder latency and per-token decoding latency improved by more than 10%, while the transcriptions used for validation remained identical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wf712-OqgzmPLXZBkqDXxQ.png" /><figcaption>Here is a before-and-after comparison for a ternary FFN matmul (3072x768, 50 tokens). With the old compiler, enabling slicing triggered the Compressed iType not supported here error, so the model could only run with slicing disabled, leaving ① SLICE 1 idle. After the change, ② both SLICEs can run the matmul in parallel, and ③ the weights stay in packed i2 form (96 KB × 6, 576 KB in total). The estimated execution time for this matmul fell from 1731.7 µs to 1055.8 µs.</figcaption></figure><p>The information had been present in the type from the beginning, and the hardware had already been capable of consuming it. The challenge was to keep recognizing what a value originally was after it had passed through several transformations. For sub-byte support, the hard part was not inventing new arithmetic — it was preserving an existing compact representation all the way through the pipeline.</p><p>That covers the compiler work most directly tied to ternary weights, but additional general compiler optimizations accumulated along the way as we pushed the model toward real-time execution. Simply reassigning temporary XRAM addresses according to actual buffer lifetimes reduced total DRAM usage by more than one third. Our earlier overview post goes into more detail on the data movement introduced by splitting operations across slices and the optimizations we used to reduce it.</p><h3>Results on the Edge</h3><p>After these changes, we had a ternary speech-to-text model running on the Torq NPU of the Astra SL2619 in the Synaptics SL2610 product line. Measurements as of August 18, 2026 were:</p><ul><li>Memory: up to 225 MB (host 50 MB + NPU 175 MB)</li><li>RTF: 0.455 (min 0.423 / max 0.502)</li><li>WER: 4.58% (9 audio clips, 7 errors out of 153 words)</li></ul><p>RTF (real-time factor) is the ratio of processing time to audio length; a value below 1 means audio is processed faster than it comes in. With an RTF comfortably below 1, real-time execution was possible, and we also verified an end-to-end demo using live microphone input. We then applied decoder input prefetching as a separate optimization, which cut per-token decoding time by about another 15%. RTF dropped to 0.417, and recognition results for the same input stayed unchanged.</p><h3>What Is Still Left to Optimize</h3><p>Getting the model onto the hardware and extracting all of the hardware’s performance are two different milestones. We reached real-time execution, but several major optimization levers are still available.</p><p><strong>1. Data movement between programs</strong></p><p>There are still regions where adjacent slice programs move the same data back and forth between XRAM and LRAM. Keeping values resident in LRAM for longer and eliminating unnecessary round trips remains one of the largest optimization opportunities.</p><p><strong>2. Fusion for non-matmul operations.</strong></p><p>Counting the compiled slice tasks shows that matrix multiplications account for only about 18% of them. The remaining 82% are things such as scale/bias operations, LayerNorm, softmax, and data movement. Decoder GEMV in particular has relatively little arithmetic, so fixed costs such as launching and waiting for programs and moving data account for a larger fraction of latency.</p><p>Fusing these operations in ways that match the NPU data path is therefore an important direction — but reducing task count is not the goal by itself. We also need to verify which kernel path the fusion selects and whether data movement and the actual critical path improve.</p><p><strong>3. More robust tile/fuse/slice algorithms.</strong></p><p>Tile sizes and how work is split across SLICEs still rely heavily on heuristics, so they may need retuning whenever the model changes. In the “Next Steps” section of our previous post(<a href="https://medium.com/@enerzai/optimizing-the-mlir-based-torq-npu-compiler-f5ea6628c95d">https://medium.com/@enerzai/optimizing-the-mlir-based-torq-npu-compiler-f5ea6628c95d</a>), we described a direction for exploring these decisions outside the compiler across many combinations to find the best configuration.</p><h3>Closing Thoughts</h3><p>This Torq project was not about forcing a new feature into a compiler that was never designed with ternary models in mind. The hardware already had a sub-byte data path, and the compiler already had a foundation for handling block quantization. What we did was widen the boundaries that surfaced as we applied a real model, and connect the pieces so that the advantages of packed weights carried through every compiler stage to actual kernel execution.</p><p>There are still many problems to solve in fully preserving the benefits of extremely quantized models on real hardware. ENERZAi is working through them one by one as we build ultra-compact AI agents that deliver top performance in real on-device environments with minimal memory. If you’re looking to run compact AI models efficiently on your own NPU or devices, or want to learn more about ENERZAi’s technology and products, feel free to reach out anytime!</p><p><a href="https://enerzai.com/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf9f55a6910e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ternary STT 모델을 Synaptics Torq NPU에서 온디바이스 구동]]></title>
            <link>https://medium.com/@enerzai/ternary-stt-%EB%AA%A8%EB%8D%B8%EC%9D%84-synaptics-torq-npu%EC%97%90%EC%84%9C-%EC%98%A8%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4-%EA%B5%AC%EB%8F%99-7d24950ba3d1?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d24950ba3d1</guid>
            <category><![CDATA[compiler-optimization]]></category>
            <category><![CDATA[enerzai]]></category>
            <category><![CDATA[low-bit-quantization]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[npu]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 05:51:55 GMT</pubDate>
            <atom:updated>2026-10-27T06:42:05.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>Synaptics Torq NPU에서 Ternary STT 온디바이스 구동하기</h3><p>안녕하세요, 에너자이입니다. 지난 게시글 <a href="https://medium.com/@enerzai/mlir-%EA%B8%B0%EB%B0%98-torq-npu-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EB%9F%AC-%EA%B0%9C%EB%B0%9C-%EC%97%AC%EC%A0%95-b04cf171e227">MLIR 기반 Torq 컴파일러 개발 여정</a>에서는 Synaptics Torq NPU의 컴파일러 구조와, 연산을 두 SLICE로 나눠 병렬 실행할 때 생기는 숨은 데이터 이동 비용을 어느 계층에서 어떻게 줄였는지 다뤘습니다. 이번 글에서는 그 연장선으로, 저희가 오랫동안 연구해 온 극단적 양자화(ternary) 모델을 같은 Torq 컴파일러 위에서 실제 NPU까지 올린 과정을 다루고자 합니다. 핵심은 2-bit로 압축된 가중치가 컴파일 중간에 너무 일찍 풀리지 않고 실제 연산 직전까지 유지되도록 해, 양자화로 얻은 저장 공간과 데이터 전송량의 이점을 실행 단계까지 지키는 것이었는데요.</p><p>해당 목적을 달성하기 위해 저희는 하드웨어에 이미 구현되어 있던 Packed 가중치 경로와 컴파일러의 block quantization 경로를 실제 모델까지 이어 붙였고, 그 결과 1.58-bit(ternary) 양자화를 적용한 약 2억 5천만 parameter 규모의 speech-to-text 모델을, Synaptics Astra SL2610 제품군의 SL2619에 탑재된 Torq NPU에서 실시간으로 실행할 수 있었습니다.</p><p>Ternary 모델은 2-bit 가중치가 컴파일 중간에 더 큰 자료형으로 풀려버리면 양자화의 이점을 잃게 됩니다. 다행히 Torq의 하드웨어와 컴파일러에는 이를 막을 수 있는 장치(packed 가중치 경로, block quantization)들이 구현되어 있었지만, 실제 모델에 적용해 보니 이 장치들이 끝까지 이어지지 않는 지점들이 있었습니다. 이 글에서는 먼저 이들을 살펴본 뒤, 그 빈틈을 메워 2-bit 가중치가 컴파일러를 끝까지 통과하도록 만든 과정과 실제 온디바이스 환경에서의 측정 결과, 그리고 아직 남아 있는 최적화 과제를 다룹니다.</p><p>용어와 dialect는 앞 글에서 설명한 것을 그대로 사용합니다. XRAM, LRAM, DMA, SLICE, 또는 linalg, torq_hl, torq_hw가 익숙하지 않다면 먼저 앞 글을 읽어보는 것이 이해에 도움이 됩니다.</p><h3>극단적인 양자화와 컴파일러 지원 사이의 간극</h3><p>Ternary 양자화는 가중치를 {-1, 0, 1} 세 가지 값으로 제한해 모델 크기와 가중치 전송량을 크게 줄이는 방식으로, 흔히 1.58-bit 양자화라고도 부릅니다. 하지만 모델 파일이 작아졌다고 해서 실행할 때도 그 이점이 그대로 유지되는 것은 아닙니다. 2-bit처럼 1 byte보다 작은 값이 컴파일 과정 중간에 너무 일찍 더 큰 자료형으로 풀려버리면, 저장 공간과 데이터 전송량에서 얻었던 이점을 잃게 됩니다. 따라서 이렇게 1 byte보다 작은(sub-byte) 형태가 IR 변환과 메모리 할당, DMA, 커널 생성 과정을 지나 실제 연산 직전까지 유지되어야 했습니다.</p><p>다행히 Torq에는 이미 이를 위한 좋은 기반이 있었습니다. 하드웨어가 sub-byte 정수 가중치를 압축된 상태로 저장하고 읽을 수 있는 경로를 제공하고 있었기 때문입니다. 여기서 packing은 1 byte보다 작은 여러 값을 한 byte 안에 함께 담는 것을 뜻합니다. 예를 들어 2-bit 정수라면 한 byte에 네 개의 값을 저장할 수 있습니다.</p><p>남은 과제는 이 하드웨어 기능을 컴파일러 전체에서 제대로 활용하는 것이었습니다. 압축된 가중치가 여러 변환을 거친 뒤에도 컴파일러가 그 원래 형태를 알아볼 수 있어야 했고, 실제 커널이 실행될 때까지 그 형태를 잃지 않아야 했습니다.</p><h3>Packed 가중치 경로</h3><p>Packing의 장점은 XRAM 사용량을 줄이는 데서 끝나지 않습니다. 가중치를 미리 풀지 않고 압축된 그대로 XRAM에서 LRAM으로 옮길 수 있기 때문에 DMA로 전송하는 데이터 양도 함께 줄어듭니다. 즉 메모리 사용량과 대역폭을 동시에 아낄 수 있습니다.</p><p>Ternary 가중치는 {-1, 0, 1} 세 값만 사용하므로 signed 2-bit 정수로 표현할 수 있습니다. Torq 하드웨어에서는 이 가중치가 다음과 같은 경로를 거칩니다.</p><pre>[1] 컴파일된 모델 파일 : 2-bit로 packed (byte당 4개 값)<br>[2] XRAM          : 여전히 2-bit, 이상적인 크기는 bf16의 1/8<br>[3] LRAM으로 DMA    : packed byte를 그대로 전송<br>[4] LRAM           : 여전히 2-bit, bf16으로 미리 풀지 않음<br>[5] W path에서 읽기  : 이 시점에 int2 -&gt; bf16로 확장<br>[6] ALU            : bf16 가중치 x bf16 activation</pre><p>가장 중요한 부분은 [5]단계입니다. 가중치는 LRAM 안에서도 계속 2-bit 상태로 남아 있다가, W path가 실제 연산을 위해 값을 읽는 순간에만 bf16으로 확장됩니다. 이 경로를 사용할 수 있다면 별도의 압축 해제용 버퍼나 독립적인 dequantization 커널을 둘 필요가 없습니다. 컴파일이 끝난 뒤에도 가중치 operand는 2-bit 정수형으로 남아 있고, 하드웨어 설정을 통해 이 값을 signed 값으로 해석해 읽는 순간 bf16으로 확장합니다.</p><p>효과는 저장 공간에서 바로 드러납니다. 에너자이 ternary STT 모델의 경우, 전체 약 2억 5천만 개의 parameter 중 약 1억 9,800만 개가 ternary 가중치이며, 이 가중치만 놓고 보면 이론적인 크기는 아래와 같습니다.</p><ul><li>bf16: 약 396 MB</li><li>packed 2-bit: 약 49.5 MB</li></ul><p>이 값은 parameter 수에 element 하나의 bit width를 곱해 계산한 이론적인 크기입니다. 실제 보드에서 측정한 메모리 사용량은 뒤에서 다시 살펴보겠습니다.</p><p>다만 한 가지 중요한 제약이 있습니다. 이 기능을 모든 입력 경로에서 똑같이 사용할 수 있는 것은 아닙니다. 현재 Torq의 linalg.matmul lowering에서는 첫 번째 operand(lhs)가 W path, 두 번째 operand(rhs)가 D path로 연결됩니다. Sub-byte expansion은 W path에서만 지원됩니다. 따라서 압축된 가중치를 실행 직전까지 유지하려면 그 가중치가 W 역할에 들어가야 합니다. 반대로 D path로 들어가면 압축된 입력을 그대로 사용할 수 없거나, 별도의 확장 과정이 필요합니다. 수학적으로 같은 행렬 곱셈이라도 하드웨어 입장에서는 같은 연산이 아닐 수 있습니다.</p><p>같은 2-bit 가중치를 각각 W와 D 역할에 넣은 작은 테스트 케이스를 보면 차이가 분명합니다.</p><pre>// Weight 역할: packed 2-bit 값이 matmul에 직접 전달됨<br>op : &quot;matmul-fast&quot;<br>  W %arg2 : memref&lt;64x64xi2, lram&gt;<br>  CFG {weight_format = SI, alu_format = BF, ...}<br><br>// Data 역할: 별도의 expansion kernel이 생기고, 확장된 bf16 data를 사용함<br>op : &quot;i2f&quot;<br>  D %arg1 : memref&lt;64x64xi8, lram&gt;<br>op : &quot;matmul-fast&quot;<br>  D %arg1 : memref&lt;128x64xbf16, lram&gt;</pre><p>가중치를 D 역할로 옮기자 packed 경로가 끝까지 유지되지 않았습니다. 컴파일러는 8-bit 정수 입력과 별도의 i2f 경로를 만들었고, LRAM으로 전달되는 가중치 데이터의 크기도 packed 2-bit를 사용할 때보다 네 배로 늘어났습니다.</p><h3>Block Quantization 경로</h3><p>가중치를 세 가지 값까지 줄이면 정확도를 유지하기 위해 보통 더 세밀한 스케일이 필요합니다. 텐서 전체에 스케일 하나를 적용하는 대신, block quantization은 일정 개수의 가중치를 하나의 블록으로 묶고 블록마다 별도의 스케일을 사용합니다. 저희 모델에서는 ternary 가중치뿐 아니라 마지막 vocabulary projection, 즉 LM head의 4-bit 가중치도 같은 방식으로 표현합니다.</p><p>저희가 프로젝트에 참여했을 때 Torq 컴파일러에는 이미 이 경로의 핵심이 구현되어 있었습니다. 중심이 되는 연산은 torq_hl.expand_weights입니다. 압축된 정수 가중치와 블록별 스케일을 받아, 가중치를 읽는 순간 값을 확장하고 해당 블록의 스케일까지 곧바로 적용하는 커널로 변환합니다.</p><p>특히 흥미로웠던 부분은 제로 포인트(zero point)를 처리하는 방식입니다. 가중치 dequantization은 개념적으로 (q - z) * s 형태지만, 이를 위해 반드시 별도의 뺄셈 커널이 필요한 것은 아닙니다. 제로 포인트가 상수이기 때문에 스케일과 함께 식을 정리하면, ACT path가 이미 처리할 수 있는 bias/scale 형태로 바꿀 수 있습니다. 중요한 것은 제로 포인트를 특정 메모리에 따로 저장하는 것이 아니라, dequantization 식 자체를 하드웨어가 효율적으로 처리할 수 있는 형태로 바꾸는 것입니다.</p><p>컴파일러는 sub-byte 정수를 버퍼 형태로 만들고 모델 파일에 저장하는 과정도 이미 지원하고 있었습니다. 즉 모델 파일 안의 2-bit 상수에서 실제 하드웨어 커널까지 이어지는 기본적인 경로는 이미 갖춰져 있었습니다.</p><p>문제는 실제 모델을 이 경로에 넣으면서 나타났습니다. 기존 경로에서 합리적으로 두었던 몇 가지 가정이 저희 모델에는 맞지 않았던 것이 문제였는데요.</p><p>첫 번째 문제는 4-bit LM head에서 발견됐습니다. 이 레이어는 블록마다 스케일과 floating-point 제로 포인트를 함께 사용하는데, 기존 경로는 정수 제로 포인트를 중심으로 구현되어 있었습니다. 그래서 제로 포인트가 floating point인 경우에도 스케일이 반영된 값을 expand_weights의 bias 입력에 합칠 수 있도록 lowering을 확장했습니다. 커널을 새로 만들기보다, 기존 block quantization 경로가 더 다양한 quantization parameter를 표현할 수 있도록 범위를 넓힌 것입니다.</p><p>같은 LM head에는 unsigned 4-bit 가중치도 있었습니다. 컴파일러의 type만으로는 값의 부호 정보가 항상 명확하게 남지 않기 때문에, 기존 signed 가중치 경로를 그대로 사용하면 값의 절반 이상을 음수로 잘못 해석할 수 있습니다. 저희는 dequantization 식에서 unsigned 변환을 사용했는지 확인하고 그 정보를 이후 단계까지 전달하여 하드웨어가 해당 가중치를 부호 확장(sign-extension)이 아닌 zero-extension 방식으로 처리하도록 설정했습니다.</p><p>마지막으로 스케일과 제로 포인트가 항상 정해진 operand 위치에 들어온다고 가정하던 부분에서도 문제가 발생했는데요. 서로 다른 모델 exporter는 의미상 같은 dequantization 식을 만들면서도 operand 순서를 다르게 배치할 수 있습니다. 위치만 보고 값을 구분하면 모델 컴파일 자체는 성공하더라도 배포 후에 최적화된 성능을 기대하기 어렵습니다. 그래서 operand 위치가 아니라 계산의 구조와 의미를 보고 어떤 값이 스케일이고 어떤 값이 제로 포인트인지 판단하도록 matcher를 수정하여 이러한 문제를 해결하였습니다.</p><p>위에서도 말씀드렸지만, 이 모든 작업은 새로운 연산을 추가한 것이 아니라 이미 있던 block quantization 경로가 실제 모델에서 나타나는 더 다양한 형태를 처리할 수 있도록 확장하는 방향으로 이루어졌는데요. Synaptics가 기본적인 토대를 이미 마련해 두었기 때문에, 저희는 실제 모델을 적용하면서 드러난 빈틈을 메우는 데 집중할 수 있었습니다.</p><h3>2-bit 가중치를 끝까지 추적하기</h3><p>실제 ternary 모델에서 앞서 설명한 하드웨어 경로를 제대로 활용하려면, 여러 IR 변환을 거친 뒤에도 컴파일러가 해당 가중치가 원래 packed 정수 상수였다는 사실을 알아볼 수 있어야 했습니다. 비슷한 문제가 서로 다른 형태로 반복해서 나타났기 때문에, 여기서는 대표적인 사례 하나를 처음부터 따라가 보겠습니다.</p><p>컴파일러 입장에서 ternary 가중치는 특별한 종류의 객체가 아닙니다. 단지 bit width가 작은 정수 상수이고, 그 정보는 이미 IR의 type에 들어 있습니다. 예를 들어 tensor&lt;128x64xi2&gt;라는 type만 보더라도 각 element가 2 bit라는 사실을 알 수 있습니다.</p><p>기존 Torq 컴파일러는 가중치가 packed 형태인지를 커널을 생성하는 마지막 단계에 가서야 판단했습니다. 이 단계에서 행렬 곱셈의 weight operand를 확인해 그 값이 packed 정수 상수에서 왔다는 것을 알아볼 수 있으면, 가중치를 W path로 보냈습니다.</p><p>문제는 상수와 행렬 곱셈 사이에 여러 변환이 끼어들 수 있다는 점이었습니다. 커널 생성 단계까지 내려오면 원래의 정수 상수가 이미 이런 변환 뒤에 가려져 있을 수 있었고, 그러면 컴파일러는 packed 상수를 알아보지 못한 채 일반적인 bf16 경로를 선택했습니다. 모델 파일은 여전히 작더라도, 실제 실행에서는 packed 가중치의 장점을 완전히 잃게 되는 것입니다.</p><pre>%cst = arith.constant dense_resource&lt;...&gt; : tensor&lt;128x64xi2&gt;   // 여기까지는 여전히 2-bit<br>...<br>%w  = tensor.extract_slice %cst[%i, 0] [64, 64] [1, 1]<br>        : tensor&lt;128x64xi2&gt; to tensor&lt;64x64xi2&gt;                 // slicing 후에도 i2 유지<br>%wf = linalg.generic ins(%w) { arith.sitofp %in : i2 to bf16 }  // 여기서 확장됨<br>%we = tensor.expand_shape %wf ...<br>linalg.batch_matmul ins(%we, %act) ...                          // kernel generation에는 bf16만 보임</pre><p>문제의 원인은 sitofp 하나뿐이었지만, 그것만으로도 충분했습니다. 커널 생성 단계에서 보이는 %we는 이미 bf16 텐서이고, 원래의 packed 2-bit 상수는 변환 연산 뒤에 숨어 있습니다. 그래서 분석 로직이 shape만 바꾸는 연산과 type 변환을 거슬러 올라가 원래 정수 텐서를 찾도록 수정했습니다. 그리고 bf16으로 변환된 값 대신 원래 정수 텐서를 W path에 전달하도록 했습니다. 이렇게 하면 값의 확장은 다시 하드웨어가 가중치를 실제로 읽는 순간까지 미뤄집니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HSqnjxrXcH_uKAo3k63_0A.png" /><figcaption>slicing을 켠 ternary 768x768 matmul(50 token)을 보면 차이가 분명합니다. 변경 전에는 ① 별도의 SLICE 프로그램이 i8 가중치를 bf16으로 풀어 XRAM에 저장하고(144 KB × 8), ② 각 matmul tile이 그 bf16 가중치를 다시 LRAM으로 읽어왔습니다(144 KB × 8). 변경 후에는 ③ packed i2 가중치가 곧바로 W path로 들어가며(72 KB × 2), 실제로 읽는 순간에만 확장됩니다. 전체 DMA 전송량은 3.5 MB에서 372 KB로, 추정 실행 시간은 1135.9 µs에서 274.3 µs로 줄었습니다.</figcaption></figure><p>이 문제를 해결한 뒤에도 slicing 과정에서 비슷한 문제가 다시 나타났습니다.</p><p>행렬 곱셈을 두 SLICE에 나누다 보면, 이미 한 번 잘라낸 weight tile을 다시 더 작은 크기로 나눠야 하는 경우가 있습니다. 이때 IR이 큰 tile 전체를 먼저 bf16으로 확장한 다음, 실제 matmul에서 필요한 작은 부분을 나중에 잘라내면 원래 packed 가중치를 추적하는 흐름이 다시 끊어졌습니다.</p><pre>// Slicing이 만든 형태: 먼저 확장하고, 그 뒤 더 작은 SLICE를 추출<br>%wt = extract_slice %cst[o, 0] [T, K]      : tensor&lt;MxK xi2&gt;     // coarse packed tile<br>%dt = linalg.generic sitofp %wt            : tensor&lt;TxK xbf16&gt;   // tile 전체를 확장<br>%s  = extract_slice %dt[i, 0] [t, K]       : tensor&lt;txK xbf16&gt;   // matmul이 사용하는 더 작은 tile<br>linalg.batch_matmul ins(%s, %act) ...<br><br>// 변경한 형태: packed 상태에서 먼저 slice한 뒤 확장<br>%ws = extract_slice %cst[o+i, 0] [t, K]    : tensor&lt;txK xi2&gt;     // packed 상태에서 slice<br>%wd = linalg.generic sitofp %ws            : tensor&lt;txK xbf16&gt;<br>linalg.batch_matmul ins(%wd, %act) ...</pre><p>첫 번째 형태에서는 기존 분석이 원래의 정수 상수까지 거슬러 올라가지 못했습니다. Shape만 바꾸는 연산은 따라갈 수 있었지만, expansion 이후에 등장하는 extract_slice까지 넘어가지는 못했습니다. 그래서 연산 순서를 바꿔 packed 상수를 먼저 잘라낸 뒤 확장하도록 IR을 다시 썼습니다. 계산 결과는 완전히 같지만, 새 형태에서는 컴파일러가 가중치의 원래 형태를 끝까지 추적할 수 있습니다.</p><p>이 문제는 단순히 성능만 떨어뜨린 것이 아니라 컴파일 자체를 실패시켰기 때문에 비교적 빠르게 발견할 수 있었습니다. 미처 제거되지 않은 expansion이 별도의 dequantization 커널로 변환되었는데, 그 입력은 여전히 packed 상수였습니다. 결국 커널 생성 단계에서 Compressed iType not supported here 오류가 발생하며 컴파일이 멈췄습니다.</p><p>두 문제를 모두 해결한 뒤에는 torq_hl IR에서 결과를 바로 확인할 수 있었습니다. 행렬 곱셈의 weight operand가 끝까지 2-bit type으로 남았습니다.</p><pre>&quot;torq_hl.matmul&quot;(%act, %shift, %w, %acc)<br>: (tensor&lt;1x64x64xbf16&gt;, tensor&lt;2xi32&gt;, tensor&lt;64x64xi2&gt;, tensor&lt;1x64x64xbf16&gt;)<br>-&gt; tensor&lt;1x64x64xbf16&gt;</pre><p>두 번째 수정은 컴파일 오류를 없애는 데서 끝나지 않았습니다. Packed 가중치가 slicing 이후에도 유지되면서 원래 의도했던 two-SLICE 실행도 다시 사용할 수 있게 되었습니다. 같은 모델을 서로 다른 컴파일러 빌드로 비교했을 때 encoder latency와 token당 decoding latency가 모두 10% 이상 줄었고, 검증에 사용한 음성 인식 결과는 동일했습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wf712-OqgzmPLXZBkqDXxQ.png" /><figcaption>Ternary FFN matmul(3072x768, 50 token)에 대한 수정 전/후 비교입니다. 변경 전 컴파일러에서는 slicing을 켜면 Compressed iType not supported here 오류가 발생했기 때문에 slicing을 끈 상태로만 실행할 수 있었고, 그 결과 ① SLICE 1이 놀고 있었습니다. 변경 후에는 ② 두 SLICE가 matmul을 병렬로 실행할 수 있게 되었고, ③ 가중치도 packed i2 상태를 그대로 유지했습니다(96 KB × 6, 총 576 KB). 이 matmul의 추정 실행 시간은 1731.7 µs에서 1055.8 µs로 줄었습니다.</figcaption></figure><p>필요한 정보는 처음부터 타입 정보 안에 있었고, 하드웨어 역시 이미 그 형태를 처리할 수 있었습니다. 어려웠던 점은 새로운 연산을 만드는 것이 아니라, 값이 여러 변환을 지나더라도 컴파일러가 <strong>처음에 어떤 값이었는지 끝까지 놓치지 않게 만드는 것</strong>이었습니다. Sub-byte 지원의 핵심도 결국 압축된 표현을 새로 만드는 데 있다기보다, 이미 존재하는 표현을 실제 실행 직전까지 보존하는 데 있었습니다.</p><p>여기까지가 ternary 가중치와 직접적으로 관련된 컴파일러 작업입니다. 모델을 실시간으로 실행할 수 있는 수준까지 끌어올리는 과정에서는 이 밖에도 일반적인 최적화를 함께 적용했습니다. 예를 들어 임시 XRAM 주소를 실제 버퍼의 생명주기에 맞춰 재사용하도록 바꾸는 것만으로도 전체 DRAM 사용량을 3분의 1 이상 줄일 수 있었습니다.</p><h3>Edge에서의 실행 결과</h3><p>이후 Synaptics Astra SL2610 제품군의 SL2619에 탑재된 Torq NPU에서 ternary speech-to-text 모델을 성공적으로 구동하였으며, 측정 결과는 아래와 같습니다.</p><ul><li>메모리: 최대 225 MB (host 50 MB + NPU 175 MB)</li><li>RTF: 0.455 (min 0.423 / max 0.502)</li><li>WER: 4.58% (9개 음성 clip, 153단어 중 7개 오류)</li></ul><p>RTF는 음성 길이 대비 처리 시간의 비율로, 1보다 작으면 음성이 들어오는 속도보다 빠르게 처리한다는 뜻입니다. RTF가 1보다 충분히 낮아 실시간 실행이 가능했고, 실제 마이크 입력을 사용하는 end-to-end demo도 확인했습니다. 이후 별도의 추가 최적화로 decoder input prefetching을 적용했고, 이를 통해 token당 decoding time을 약 15% 더 줄였습니다. RTF는 0.417까지 내려갔고, 같은 입력에 대한 인식 결과는 그대로 유지되었습니다.</p><h3>아직 남아 있는 최적화</h3><p>다만 모델을 NPU에서 실행하는 것과 하드웨어 성능을 끝까지 끌어내는 것은 서로 다른 문제입니다. 실시간 실행에는 도달했지만, 아직 개선할 수 있는 부분이 크게 세 가지 남아 있습니다.</p><p><strong>1. 프로그램 사이의 데이터 이동</strong></p><p>서로 인접한 SLICE 프로그램이 같은 데이터를 XRAM과 LRAM 사이로 반복해서 주고받는 구간이 아직 남아 있습니다. 값을 LRAM에 더 오래 유지해 이런 불필요한 왕복을 줄이는 것은 여전히 가장 큰 최적화 기회 중 하나입니다.</p><p><strong>2. Matmul 이외 연산의 결합</strong></p><p>컴파일된 SLICE task를 세어보면 matrix multiplication이 차지하는 비중은 약 18%에 불과하고, 나머지 82%는 scale/bias 연산, LayerNorm, softmax, 데이터 이동 같은 작업입니다. 특히 decoder GEMV는 실제 산술 연산량이 비교적 작아서, 프로그램 실행과 대기, 데이터 이동 같은 고정 비용이 전체 지연 시간에서 더 큰 비중을 차지합니다.</p><p>그래서 이런 연산들을 NPU의 데이터 경로에 맞춰 함께 묶는 것이 중요한 최적화 방향입니다. 다만 task 수를 줄이는 것만으로는 충분하지 않습니다. 연산을 합쳤을 때 어떤 커널 경로가 선택되는지, 실제로 데이터 이동과 critical path가 줄어드는지까지 함께 확인해야 합니다.</p><p><strong>3. 더 안정적인 tile/fuse/slice 결정</strong></p><p>현재 tile 크기나 SLICE를 나누는 방식은 경험적인 규칙에 많이 의존하고 있어서, 모델이 바뀌면 다시 조정해야 할 수 있습니다. 이런 결정을 컴파일러 밖에서 여러 조합으로 탐색해 가장 좋은 설정을 찾는 방향은 앞선 글 <a href="https://medium.com/@enerzai/mlir-%EA%B8%B0%EB%B0%98-torq-npu-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EB%9F%AC-%EA%B0%9C%EB%B0%9C-%EC%97%AC%EC%A0%95-b04cf171e227">MLIR 기반 Torq 컴파일러 개발 여정</a>의 “다음 단계”에서 소개한 바 있습니다.</p><h3>마치며</h3><p>이번 Torq 프로젝트는 ternary 모델을 전혀 고려하지 않은 컴파일러에 새로운 기능을 억지로 끼워 넣는 과정이 아니었습니다. 하드웨어에는 이미 sub-byte 데이터 경로가 있었고, 컴파일러에도 block quantization을 처리할 수 있는 기반이 있었습니다. 저희가 한 일은 실제 모델을 적용하면서 드러난 경계를 넓히고, packed 가중치의 장점이 여러 컴파일러 단계를 지나 실제 커널 실행까지 유지되도록 이어 붙이는 것이었습니다.</p><p>극단적으로 양자화된 모델의 이점을 실제 하드웨어 위에서 끝까지 살려내는 데에는 아직 풀어야 할 문제가 많은데요. 에너자이는 최소한의 메모리로 실제 온디바이스 환경에서 최적의 성능을 낼 수 있는 초소형 AI 에이전트를 구현하고 있습니다. 자사 NPU나 디바이스에서 초소형 AI 모델을 효율적으로 구동하고자 하는 니즈가 있거나, 에너자이의 기술과 제품에 대해 더 알고 싶으시다면 언제든 편하게 연락 주세요!</p><p><a href="https://enerzai.com/ko/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d24950ba3d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing the MLIR-Based Torq NPU Compiler]]></title>
            <link>https://medium.com/@enerzai/optimizing-the-mlir-based-torq-npu-compiler-f5ea6628c95d?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ea6628c95d</guid>
            <category><![CDATA[compiler-optimization]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[mlir]]></category>
            <category><![CDATA[nadya]]></category>
            <category><![CDATA[npu]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 03:36:46 GMT</pubDate>
            <atom:updated>2026-10-20T03:36:46.473Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, this is ENERZAi. We recently contributed to the backend implementation and model optimization of the Torq compiler, an open-source IREE/MLIR-based compiler for the Torq NPU in the Astra SL2610 product line from global semiconductor company Synaptics. In this post, we’ll share the challenges we ran into along the way and the insights we gained.</p><p>In particular, we’ll take a close look at the hidden data-movement (DMA) cost that arises when an operation is split across the NPU’s two compute blocks (SLICEs) to run in parallel, and at where in the compiler’s layers we reduced it, and how.</p><p>Once again, a big thank-you to Synaptics for making this opportunity possible!</p><h3>An NPU Ecosystem That Is Still Taking Shape</h3><p>Interest in domain-specific architectures has grown rapidly over the past few years. CPUs and GPUs have already evolved to divide work between general-purpose computation and massively parallel workloads. Deep learning has created a similar need for specialization: much of a model can be expressed as a flow of tensor operations, making architectures tailored to those workloads increasingly important. The rapid growth of model-based services is accelerating this trend.</p><p>As a result, many companies are developing and shipping processing units specialized for neural-network workloads: NPUs, or Neural Processing Units. They are particularly important in edge computing, where models need to run directly on-device under tight power and memory budgets while still delivering useful intelligence.</p><p>Unlike CPUs and GPUs, however, NPUs do not yet benefit from mature compiler stacks, runtimes, and the thick ecosystem built on top of them. Architectures vary widely across vendors, commercial deployment is still relatively young compared with GPUs, and there is no broadly established agreement on where the hardware/software boundary should sit. APIs and infrastructure therefore differ significantly from one platform to another. In some cases, an NPU may already be in production while the software stack needed to use it effectively is still catching up.</p><h3>The Optimization That Looked Obvious</h3><p>One of the first ideas an NPU with multiple compute units suggests is simple: split the work and run the pieces in parallel. The Torq NPU on the Astra SL2619 has two <strong>SLICEs</strong>, or compute blocks, so at first glance splitting an operation in half and running one half on each SLICE looks like an obvious optimization.</p><p>A few hardware terms are enough to see why the result is not always so simple:</p><ul><li>A <strong>SLICE program</strong> operates on data that has already been placed in <strong>LRAM</strong>, a small on-chip memory.</li><li><strong>XRAM</strong> is a region reserved in the board’s main DRAM for NPU execution.</li><li>Data moves between XRAM and LRAM through <strong>DMA</strong>. Inputs need to reach LRAM before a SLICE can use them, and results are copied back to XRAM when needed.</li></ul><p>Splitting an operation can create more opportunities for parallel execution, but it can also create more data movement. The split is decided while the compiler is still working with tensor-level intermediate representation (IR), before concrete DMA tasks and SLICE programs exist. Once the pieces are lowered, each one may acquire its own loads, stores, and program-code transfers. If two pieces need the same constant or input, that data may be moved more than once.</p><p>There is another subtlety: having two SLICE tasks does not mean the two SLICEs actually overlap. The current scheduler assigns work according to the ordering of start and wait operations in the IR. Both programs need to start before the corresponding waits if we want them to execute concurrently.</p><pre># Two SLICEs actually overlap<br>slice_start(0)<br>slice_start(1)<br>slice_wait(0)<br>slice_wait(1)<br><br># Two tasks, but still sequential<br>slice_start(0)<br>slice_wait(0)<br>slice_start(1)<br>slice_wait(1)</pre><p>When an MLIR parallel loop such as scf.forall is unrolled into two independent pieces, the first schedule can be produced. Simply creating two operations side by side, however, may still result in the second form: if each operation is immediately followed by its own wait, the second SLICE does not begin until the first has finished.</p><p>Data movement adds another complication. DMA can overlap with SLICE execution, so extra traffic is not automatically serialized into latency. But it is still more work for the schedule to absorb, and any part that does not overlap extends the critical path.</p><p>This became a recurring pattern in our work on Torq: <strong>an optimization that looked beneficial in tensor IR could expose a new cost only after it reached a lower level of the compiler.</strong> Parallelism was not the hard part by itself. The hard part was making the cost of that parallelism visible soon enough to do something about it.</p><p>That observation leads to a compiler-design question: where should each optimization live when the decision is made at one level, but its cost appears at another?</p><h3>Why Torq Uses Multiple Compiler Layers</h3><p>Compilers represent a model through a sequence of intermediate representations (IRs) between the original model and the final hardware code. Different optimizations need different information from those representations.</p><p>Some transformations are useful across many targets. Others depend on the target’s dataflow, supported operation patterns, or memory hierarchy. The two kinds cannot simply be separated and forgotten about, because their decisions still interact. Operation fusion is a good example: combining operations can avoid materializing intermediate results, but a fused expression may not fit the small set of specialized operations an NPU provides, and the cost of making it fit can outweigh the savings from fusion. Tiling has the same tension. It can be expressed at the tensor level, while the useful tile shape is ultimately constrained by hardware memory and allocation strategy.</p><p>Torq handles this by separating concerns across several compiler layers. In MLIR, these layers are organized as <strong>dialects</strong>, each representing operations and concepts at a particular level of abstraction. <strong>Torq keeps</strong> tensor semantics and high-level transformations in standard dialects for as long as possible. Torq-specific dialects appear only when concrete information about NPU programs and memory becomes necessary.</p><p>Torq Compiler is implemented as an IREE plugin and makes extensive use of MLIR. The main layers are:</p><ul><li><strong>The </strong><strong>linalg layer</strong>: MLIR’s builtin dialect for expressing tensor operations primarily in terms of their mathematical semantics. Tensor-level transformations such as tiling and fusion operate on this IR. Some passes may consult target information, but hardware-specific program descriptors and internal data paths are not exposed yet.</li><li><strong>The </strong><strong>torq_hl layer</strong>: A dialect that gives operations Torq-specific semantics and represents XRAM/LRAM transfers as well as SLICE-program execution. At this level, it becomes explicit which data needs to move into or out of NPU memory and when NPU programs are launched.</li><li><strong>The </strong><strong>torq_hw layer</strong>: A dialect that maps to the descriptors consumed by the hardware. Information such as the D/W/B/Q data paths and ALU/ACT configuration appears directly in the IR that defines an actual SLICE task.</li></ul><p>Looking at the same matrix multiplication at each level makes the progression concrete:</p><pre>// linalg: only the mathematical tensor operation is expressed here.<br>//         tensor.empty and linalg.fill(0.0) initialize the tensor that<br>//         becomes the outs operand (output tensor) of the matmul.<br>%zero = arith.constant 0.000000e+00 : bf16<br>%e = tensor.empty() : tensor&lt;64x128xbf16&gt;<br>%f = linalg.fill ins(%zero : bf16) outs(%e : tensor&lt;64x128xbf16&gt;) -&gt; tensor&lt;64x128xbf16&gt;<br>%m = linalg.matmul ins(%a, %b : tensor&lt;64x64xbf16&gt;, tensor&lt;64x128xbf16&gt;)<br>                   outs(%f : tensor&lt;64x128xbf16&gt;) -&gt; tensor&lt;64x128xbf16&gt;<br><br>// torq_hl: an execution unit understood by the NPU. linalg.fill is gone;<br>//          an uninitialized tensor.empty remains as the init operand,<br>//          and bias / quantization parameters are attached as operands.<br>//          (%sb = dense&lt;[0, 1]&gt; : tensor&lt;2xi32&gt;, i.e. bias 0 · scale 1)<br>%init = tensor.empty() : tensor&lt;64x128xbf16&gt;<br>%q = &quot;torq_hl.matmul&quot;(%init, %sb, %a, %b) {output_zp = 0, shift = 0, ...}<br><br>// torq_hw: the hardware descriptor itself.<br>torq_hw.slice_task {<br>  op : &quot;matmul-fast&quot;<br>  D %arg3 : memref&lt;64x128xbf16, lram&gt;    W %arg2 : memref&lt;64x64xbf16, lram&gt;<br>  B %arg1 : memref&lt;2xi32, lram&gt;          Q %arg0 : memref&lt;64x128xbf16, lram&gt;<br>  CFG {alu_op0_mode = [MUL, ...], alu_op1_mode = [ACC, ...], act_mode = ACT,<br>       weight_format = BF, alu_format = BF, act_format = BF, ...}<br>}</pre><p>The arithmetic is the same at every level, but the representation becomes increasingly concrete. linalg carries the tensor-level semantics. torq_hl adds the information needed to execute the operation as an NPU program. By the time we reach torq_hw, D (Input Data), W (Weight), B (Bias/Scale), Q (Output), and the ALU/ACT configuration expose something close to the hardware behavior itself.</p><p>The lower-level cost becomes even clearer once the surrounding program and data movement are visible:</p><pre>// torq_hl: the machinery surrounding a single kernel operation.<br>%a_x = torq_hl.map_binding {binding_index = 0} : memref&lt;64x64xbf16&gt;   // XRAM address<br>%a_l = memref.alloc() : memref&lt;64x64xbf16, lram&gt;                      // LRAM allocation<br>torq_hl.load %a_x to %a_l {element_size_bytes = 8192}                 // DMA in (XRAM -&gt; LRAM)<br>...<br><br>%prog = torq_hl.program &quot;slice_program_torq_hl.matmul_0&quot; {<br>  ^bb0(%q: ..., %b: ..., %w: ..., %d: ...):<br>    &quot;torq_hl.matmul&quot;(%q, %b, %w, %d) {output_zp = 0, shift = 0, ...}<br>}<br>%inv, %code = torq_hl.create_invocation &quot;slice_program_torq_hl.matmul_0&quot;<br>                program(%prog) on 0 : ..., memref&lt;5120xi8&gt;<br>torq_hl.load %code to %code_l {element_size_bytes = 5120}             // program-code DMA<br>torq_hl.start_program %inv args(%q_l, %b_l, %a_l, %d_l)<br>torq_hl.wait_program %inv<br>torq_hl.store %q_l to %q_x {element_size_bytes = 16384}               // DMA out (LRAM -&gt; XRAM)</pre><p>What was a single tensor operation in linalg has expanded into finding XRAM addresses, allocating LRAM, loading inputs, launching and waiting for a program, and finally storing the result back out. The arithmetic has not changed, but the cost of preparing that computation for execution on the device is now visible.</p><p>This is why the layering mattered to our work. A split made at the linalg level can turn into additional addresses, DMA, and program launches in torq_hl. At the same time, some fixes are easiest before those details exist, while others require exactly the information that appears later. Instead of putting every optimization into one layer, we can address each cost where the necessary information becomes available.</p><p>The same structure also gives the compiler room to evolve. NPU operations, memory capacity, and data paths may change across hardware generations. Keeping high-level semantics separate from lower-level hardware details limits how much of the pipeline needs to change with the target.</p><h3>Paying Back the Cost of Slicing</h3><p>Once we could see where the extra movement appeared, most of our work followed one theme: <strong>keep the parallelism, but remove as much of the movement it introduces as possible.</strong> The fixes landed at different abstraction levels because each one needed a different view of the program.</p><h4>Keep Elementwise Chains Together in linalg</h4><p>At the linalg layer, we found cases where consecutive element-wise operations were sliced one operation at a time. Composite activations and post-processing often canonicalize into chains of linalg.generic operations. If each operation ends up in a separate loop, intermediate values can cross loop boundaries and later be materialized in XRAM.</p><p>We unified the torq-fuse-group attached to operations in such a chain. The compiler pulls linalg operations in the same group into a single scf.forall, while operations in different groups are placed in separate loops. By assigning the chain to one group before slicing begins, the compiler can construct one loop for the whole chain from the start rather than trying to merge loops afterward. The example below compresses a longer chain down to three operations for readability.</p><pre>// [Before change, before slicing]<br>// The chain still consists of multiple operations, and no loop has been<br>// created yet. Each operation only carries a marker describing which group<br>// it belongs to. Those markers are fragmented across the chain.<br>%a = linalg.generic { ... }          {torq-fuse-group = [3]}<br>%b = linalg.generic { ... %a ... }   {torq-fuse-group = [4]}<br>%c = linalg.generic { ... %b ... }   // no marker<br><br>// [After change, before slicing]<br>// Walk the chain and unify the group marker. The operations and their order<br>// do not change; only the marker does.<br>%a = linalg.generic { ... }          {torq-fuse-group = [30]}<br>%b = linalg.generic { ... %a ... }   {torq-fuse-group = [30]}<br>%c = linalg.generic { ... %b ... }   {torq-fuse-group = [30]}<br><br>// [Before change, after slicing]<br>// Fragmented markers produce one loop per operation.<br>%a = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... } }         // %a survives across a loop boundary<br>%b = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... %a ... } }  // the next loop consumes %a<br>%c = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... %b ... } }  // the boundary repeats at every stage<br><br>// [After change, after slicing]<br>// One loop contains the whole chain, so the intermediates stay inside it.<br>%c = scf.forall (%i) = (0) to (N) step (N/2) {<br>  %t0 = linalg.generic { ... }<br>  %t1 = linalg.generic { ... %t0 ... }<br>        linalg.generic { ... %t1 ... }<br>}</pre><p>On the lowering paths where this problem occurred, intermediates crossing different scf.forall loops were materialized in XRAM, creating extra round trips. Keeping the chain inside one loop lets those intermediates stay in LRAM longer and reduces the associated DMA in/out. The point is less “fusion for its own sake” than preserving on-chip residency across the chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXavaPwHIdoFyYOWyo6aCA.png" /><figcaption>Compile-time timeline of erf (1x1024x64, bf16) with slicing enabled. In each panel the upper group is before the elementwise chain was placed in one fuse group and the lower group is after; the bottom panel enlarges the blue frame, the first 330 µs of each run. ① Stores to XRAM between the ops of the chain: each op writes both SLICE halves out. ② Loads that bring those values straight back into LRAM for the next op. ③ With the whole chain in one fuse group, the intermediates stay in LRAM and the SLICE programs run back to back. Stores drop from 36 (2.6 MB) to 7 (448 KB), and the estimated time from 1834.9 µs to 888.0 µs.</figcaption></figure><h4>Reorder SLICE Extraction Before Memory Conversion</h4><p>A different problem appeared after the compiler had reached torq_hl. Some values were still represented as tensors, but their memory placement was now encoded in their types. In the original IR, the compiler could convert a full value to XRAM first and only then extract the smaller SLICE that was actually needed.</p><p>We rewrote that into an equivalent form: extract the SLICE while the value is still in LRAM, then convert only the smaller SLICE. This keeps the large tensor on-chip and exposes a redundant round trip on the smaller SLICE that an existing compiler optimization can fold away.</p><pre>// Before our change<br>%x  = torq_hl.convert in(%big) {encoding = xram}   // write the full result to XRAM<br>%sl = tensor.extract_slice %x [...]                // extract the required part from XRAM<br>%l  = torq_hl.convert in(%sl) {encoding = lram}    // bring it back into LRAM<br><br>// After our change<br>%sl = tensor.extract_slice %big [...]              // extract directly while still in LRAM<br>%x  = torq_hl.convert in(%sl) {encoding = xram}    // the large tensor never leaves for XRAM<br>%l  = torq_hl.convert in(%x) {encoding = lram}     // this round trip on the SLICE is now redundant<br><br>// After subsequent cleanup<br>%sl = tensor.extract_slice %big [...]              // extract directly in LRAM\</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUUmo1g59xyzZHV7d4AXtQ.png" /><figcaption>max_pool (5x5, 1x15x20x384, i8) before (upper group) and after (lower group) SLICE extraction was moved ahead of the LRAM-to-XRAM conversion. ① The full 112.5 KB result is converted to XRAM. ② Each SLICE then extracts its 56.2 KB half and loads it back into LRAM. ③ After the change both SLICEs take their halves while the value is still in LRAM, so the round trip disappears. The estimated time drops from 369.3 µs to 312.9 µs.</figcaption></figure><p>Neither this change nor the linalg grouping above introduced a new operation. In both cases, the useful transformation already existed somewhere in the compiler; the important part was arranging the IR so that it could do the right thing for Torq’s memory model.</p><h4>Expose Access Semantics Instead of Reimplementing Analysis</h4><p>At the torq_hl layer, LRAM addresses, loads/stores, and program boundaries are explicit, so some redundant movement can be attacked directly. If the same read-only data is loaded separately for two SLICEs, we want to transfer it once and share it. If an intermediate is written to temporary XRAM but will never be read again, we want to remove that store.</p><p>The interesting part was that many of the analyses and transformations needed for these cases already existed. The problem was that torq_hl is a custom dialect, so the compiler did not automatically know how its operations access memory or whether they are safe to move. Rather than reimplementing the analyses, we exposed those properties through compiler interfaces.</p><p>The read/write direction of SLICE-program arguments is described through AsyncAccessOpInterface, a simplified version of the interface used in IREE. For operation-level memory effects and motion legality, we use MemoryEffectsOpInterface and ConditionallySpeculatable. Once those properties are available, existing MLIR analyses and utilities can reason about torq_hl as well.</p><p>One immediate benefit is eliminating dead stores. Without read/write information, the compiler has to assume that every SLICE-program argument might be both read and written. Once it knows that a later program overwrites a value rather than reading it, an earlier spill can disappear.</p><pre>// Before our change<br>%t_x = torq_hl.map_binding {binding_index = 2}   // temporary location in XRAM<br>%t_l = memref.alloc() : memref&lt;..., lram&gt;        // location in LRAM<br><br>torq_hl.start_program %inv_a args(%t_l, %d_l)    // A writes its result to %t_l<br>torq_hl.wait_program %inv_a<br>torq_hl.store %t_l to %t_x                       // spill %t_l because LRAM is tight<br><br>torq_hl.start_program %inv_b args(%t_l, %e_l)    // B also writes a result to %t_l<br>torq_hl.wait_program %inv_b                      // but we cannot tell whether B reads or writes %t_l<br>torq_hl.store %t_l to %q_x                       // so the earlier store cannot be removed<br><br>// After our change: the interface tells us B only overwrites %t_l,<br>// so the previously spilled copy will never be read again.<br>%t_l = memref.alloc() : memref&lt;..., lram&gt;<br><br>torq_hl.start_program %inv_a args(%t_l, %d_l)<br>torq_hl.wait_program %inv_a<br>                                                 // one store and the %t_x binding disappear<br>torq_hl.start_program %inv_b args(%t_l, %e_l)<br>torq_hl.wait_program %inv_b<br>torq_hl.store %t_l to %q_x                       // the final result store remains</pre><p>The same information helps when a buffer is temporarily spilled to XRAM because LRAM is full and loaded again later. If the intervening program only reads the buffer, the previously written XRAM copy is still valid. The compiler can release the LRAM allocation and reuse that copy instead of allocating another XRAM location and storing the same data again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCWq1F9l6TegfCF68hMDkw.png" /><figcaption>A conv1d layer (kernel 127, stride 64, 80,000 audio samples to 288 channels) before (upper group) and after (lower group) AsyncAccessOpInterface. The bottom panel lines up the same loop iteration from both runs (blue frames: 1950–2720 µs before, 1842–2612 µs after), each shifted to start at 0. ① A dead store: a 200 KB value is spilled to XRAM although the next program only overwrites it. ② The matching 200 KB load, which disappears with it. ③ An unchanged 309 KB buffer is stored to XRAM again; after the change the copy already in XRAM is reused. DMA out drops from 22 transfers (4.5 MB) to 13 (2.4 MB), and the estimated time from 5091.1 µs to 4218.8 µs.</figcaption></figure><p>A related question is whether an operation can move at all. If an operation produces the same value on every loop iteration, it is better to execute it once outside the loop and reuse the result. Previously, MLIR could not tell whether moving a torq_hl operation was legal.</p><pre>// Before our change: recompute the same value on every iteration<br>// (or for every SLICE program). We cannot prove it is safe to move out.<br>scf.forall (%i) ... {<br>  %s = torq_hl.segmentation ... (%w, %sb, %in)   // all three inputs are independent of %i<br>  ... computations using %s ...<br>}<br><br>// After our change: the operation is classified as safe to move,<br>// allowing MLIR&#39;s moveLoopInvariantCode utility to process it.<br>%s = torq_hl.segmentation ... (%w, %sb, %in)<br>scf.forall (%i) ... {<br>  ... computations using %s ...<br>}</pre><p>We marked only the operations that were actually safe to move; operations whose meaning depends on their position, such as those that gather values by index, were excluded. This allowed us to reuse MLIR’s getBackwardSlice and moveLoopInvariantCode instead of writing separate legality logic.</p><p>Taken together, these changes removed part of the duplicate movement introduced by slicing. They also changed how we thought about the problem: splitting work well is not enough. If parallelization creates overhead, the compiler needs a way to pay that overhead back before the parallelism turns into real performance.</p><h3>What We Learned</h3><p>Looking back, the individual rewrites and interfaces matter less than the pattern behind them.</p><p>First, optimization starts with understanding how data moves through the chip. On Torq, each operation has specific input paths, accumulation paths, and post-processing paths available to it, and those constraints determine what can fit inside a single program. Task count and DMA bytes are useful diagnostics, but they are not performance verdicts by themselves. Even when fusion reduces the number of tasks, we still need to ask which kernel path the fused operation selects and what happens to the actual critical path.</p><p>Second, tiling, fusion, and slicing are tightly coupled under a constrained LRAM budget. All three affect what stays on-chip, how much of it stays there, and how often it needs to move again. Making those decisions independently can easily make the optimizations work against each other.</p><p>The answer is not to collapse everything into one hardware-specific IR. The layered pipeline does not remove the coupling between optimizations; it gives that coupling a place to become visible. High-level transformations can keep working with tensor semantics, while lower layers expose the hardware costs those decisions eventually create. For us, that separation became less about architectural neatness and more about having the right information available at the right time.</p><h3>What’s Next</h3><p>The same lesson shapes where we want to take the compiler next. Our goal is to support a broader range of models and future hardware without turning every new target into another set of hard-coded special cases.</p><p><strong>1. From EasyKernel to Nadya.</strong><br> Today, Torq kernels are written in EasyKernel, an internal C++ DSL. Instead of writing low-level hardware descriptors and instruction streams directly, a kernel can be expressed in something closer to ordinary loops and then serialized into descriptors. This is much easier to work with, but the implementation of each tensor operation still lives inside the compiler. That makes new operations and future hardware generations harder to support and also limits opportunities for runtime profiling and tuning of kernel implementations.</p><p>One direction we are exploring is moving kernel authoring to Nadya, a kernel programming language we are developing. Nadya is designed to make it possible to write high-performance programs without requiring every author to understand all of the underlying hardware optimization details. The implementation of how the NPU executes an operation could live in external kernel code, while the compiler decides how multiple operations should be scheduled together.</p><p><strong>2. Making optimization decisions searchable.</strong><br> The compilation pipeline contains many decisions driven by heuristics: tile sizes, SLICE partitioning, whether to fuse, and so on. Rather than hard-coding those choices into individual passes, we want to parameterize them so they can be explored systematically by a tuning loop. That loop may live in an external tool or be integrated more tightly with the compiler over time; the important part is to separate the search policy from the transformation logic. This lets the same compiler pipeline evaluate different configurations and adapt to new hardware without rewriting heuristics for every target.</p><p>There are still many open problems in making a compiler for a new class of target both powerful and flexible. But that is exactly what makes the project interesting. At ENERZAi, we are still working through those problems one by one.</p><h3>An Open Project</h3><p>One of the best parts of this project is that both the hardware specifications and the compiler are public. The compiler is available at <a href="https://github.com/synaptics-torq/torq-compiler">synaptics-torq/torq-compiler Github repo</a>, model examples are available in <a href="https://github.com/synaptics-torq/torq-examples">torq-examples</a>, and the official documentation is at <a href="https://synaptics-torq.github.io/torq-compiler/v/latest/">synaptics-torq.github.io</a>. Anyone can inspect the kinds of problems we are working on, and contributors who are interested can get involved directly.</p><p>If you’d like to learn more about the Torq project or ENERZAi’s other optimization technologies, such as Nadya, feel free to reach out anytime!</p><p><a href="https://enerzai.com/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ea6628c95d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MLIR 기반 Torq NPU 컴파일러 개발 여정]]></title>
            <link>https://medium.com/@enerzai/mlir-%EA%B8%B0%EB%B0%98-torq-npu-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EB%9F%AC-%EA%B0%9C%EB%B0%9C-%EC%97%AC%EC%A0%95-b04cf171e227?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b04cf171e227</guid>
            <category><![CDATA[compiler-optimization]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[nadya]]></category>
            <category><![CDATA[npu]]></category>
            <category><![CDATA[mlir]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 03:21:17 GMT</pubDate>
            <atom:updated>2026-10-21T04:39:09.726Z</atom:updated>
            <content:encoded><![CDATA[<p>안녕하세요, 에너자이입니다. 에너자이는 최근 글로벌 반도체사인 Synaptics의 Astra SL2610 제품군에 탑재된 Torq NPU를 위해, 오픈소스 IREE/MLIR 기반 Torq 컴파일러의 백엔드 구현과 모델 최적화에 참여했는데요. 오늘은 그 여정에서 마주했던 Challenge와 얻은 Insight들에 대해 다루고자 합니다.</p><p>특히, NPU의 두 연산 블록(SLICE)으로 연산을 나눠 병렬 실행할 때 생기는 숨은 데이터 이동(DMA) 비용을, 컴파일러의 어느 계층에서 어떻게 줄였는지 자세히 소개할 예정입니다.</p><p>귀중한 기회를 만들어주신 Synaptics에 다시 한 번 감사드립니다!</p><h3>아직 만들어지고 있는 NPU 생태계</h3><p>최근 몇 년 사이 domain-specific architecture에 대한 관심은 빠르게 커져 왔습니다. CPU와 GPU가 범용적인 로직 처리와 대량 병렬처리 작업을 나눠 처리하는 방향으로 발전해 온 것처럼, 딥러닝에서 주로 등장하는 텐서 연산에 특화된 새로운 아키텍처에 대한 중요성도 점점 커지고 있었습니다. 특히 최근 딥러닝 모델을 기반으로 하는 서비스가 빠르게 늘어나면서 이러한 흐름은 더욱 가속되고 있는데요.</p><p>그 결과 많은 기업이 neural-network 실행에 특화된 processing unit, 즉 NPU(Neural Processing Unit)를 개발하고 실제 제품에 탑재하고 있습니다. 특히 제한된 전력과 메모리 안에서 모델을 실행하면서도 충분히 똑똑한 결과물을 제공해야 하는 엣지 컴퓨팅 산업에서는 NPU의 중요성이 더욱 큽니다.</p><p>하지만 CPU나 GPU와 달리, NPU에는 아직 성숙한 컴파일러와 런타임 환경, 그리고 이를 바탕으로 하는 두터운 생태계가 없습니다. 제조사마다 그 구조가 크게 다르고, 상용화의 역사도 GPU에 비하면 아직 짧습니다. 하드웨어와 소프트웨어의 경계를 어떻게 설정하여 어떤 식으로 인터페이스를 둘지에 대해서도 널리 합의된 기준이 없다보니, API와 인프라 역시 플랫폼마다 크게 달라집니다. 어떤 경우에는 이미 양산이 진행되고 있는 NPU임에도 이를 제대로 활용할 수 있는 소프트웨어 스택의 지원이 미비하기도 합니다.</p><h3>너무 당연해 보였던 최적화</h3><p>일을 나누고 병렬로 실행하는 것은 현대 최적화 기술에서 가장 기본적인 방식일 겁니다. Astra SL2619의 Torq NPU에는 <strong>SLICE</strong>라고 부르는 두 개의 compute block이 있기 때문에, 하나의 operation을 둘로 나눠 각 <strong>SLICE</strong>에서 절반씩 실행하는 것이 당연한 최적화처럼 보입니다.</p><p>그런데 조금 더 자세히 살펴보면 실제로는 그렇게 단순하지 않다는 것을 알 수 있습니다.</p><ul><li><strong>SLICE</strong> 프로그램은 NPU 위의 작은 on-chip memory인 <strong>LRAM</strong>에 이미 올라와 있는 데이터를 사용합니다.</li><li><strong>XRAM</strong>은 NPU 실행을 위해 보드의 주메모리인 DRAM에 예약된 영역입니다.</li><li>데이터는 <strong>DMA</strong>를 통해 XRAM과 LRAM 사이를 이동합니다. SLICE가 연산을 위해 데이터를 사용하려면 먼저 LRAM까지 가져와야 하고, 필요한 경우 결과를 다시 XRAM으로 복사합니다.</li></ul><p>한 텐서 연산의 데이터를 나누면 병렬 실행의 기회는 늘어날 수 있지만, 동시에 데이터 이동도 늘어날 수 있습니다. Torq 컴파일러의 파이프라인을 보면, 아직 수학적 의미의 텐서 연산을 다루는 IR(Intermediate Representation)에서 이 텐서를 어떻게 나눌지가 결정되는 구조입니다. 이 시점에는 구체적인 DMA 과정이나 SLICE 프로그램이 아직 존재하지 않습니다. 이후 나누어진 연산들이 더 낮은 단계의 IR로 변환되면, 각자 별도의 load, store, program-code transfer를 가지게 될 수 있습니다. 나누어진 연산이 같은 상수 값이나 입력을 필요로 한다면 같은 데이터가 여러 번 이동할 수도 있습니다.</p><p>또 하나 미묘한 점이 있습니다. SLICE 프로그램이 2개라고 해서 실제로 이 둘이 완전히 겹쳐서 실행됨을 보장하는 것은 아닙니다. 현재 스케줄러는 IR에 있는 start와 wait operation의 순서에 따라 작업을 배치합니다. 두 프로그램이 동시에 실행되려면 각각의 wait에 도달하기 전에 두 프로그램이 모두 먼저 시작되어야 합니다.</p><pre># 두 SLICE가 실제로 겹쳐 실행되는 경우<br>slice_start(0)<br>slice_start(1)<br>slice_wait(0)<br>slice_wait(1)</pre><p>컴파일러 로직상 MLIR의 병렬 루프 연산인 scf.forall에 대해 펼쳐주면 (loop unroll) 위 코드블록의 첫 번째 예시와 같은 작업 스케줄이 만들어질 수 있습니다. 하지만 두 번째 예시와 같이 단순히 두 operation이 나란히 실행되도록 각 operation 바로 뒤에 자신의 wait가 붙는다면, 첫 번째 SLICE의 실행이 끝날 때까지 두 번째 SLICE는 시작하지 못하게 됩니다.</p><p>데이터 이동은 또 다른 문제를 만듭니다. DMA는 SLICE 실행과 동시에 수행될 수 있기 때문에, 데이터 이동 횟수가 늘어났다고 해서 그 시간 그대로 실행 시간이 늘어나는 것은 아닙니다. 하지만 스케줄러가 처리해야 할 일 자체는 여전히 늘어나며, 겹쳐서 실행되지 못한 부분은 결국 critical path를 길게 만듭니다.</p><p>Torq를 작업하면서 저희는 이런 패턴을 반복해서 마주쳤습니다. <strong>수학적 의미의 텐서 연산을 표현하는 IR에서는 좋아 보였던 최적화가 컴파일러의 더 낮은 단계에 내려가고 나서야 새로운 비용을 드러내는 경우가 있었습니다.</strong> 병렬화 자체가 어렵다기보다는, 병렬화를 위해 새로 추가되는 비용을 충분히 이른 시점에 알아내고 최소화하는 것이 어려웠습니다.</p><p>이 관찰은 자연스럽게 컴파일러 설계에 대한 질문으로 이어집니다. 어떤 결정이 한 추상화 단계에서 이루어지지만 그 비용은 다른 추상화 단계에서 나타난다면, 각각의 최적화는 어디에서 수행되어야 할까요?</p><h3>Torq가 여러 컴파일러 계층을 사용하는 이유</h3><p>컴파일러는 원래의 모델을 최종 하드웨어 코드로 바꾸기까지 여러 형태의 IR을 거칩니다. 그리고 최적화마다 판단에 필요한 정보가 다릅니다.</p><p>어떤 최적화는 하드웨어와 상관없이 여러 환경에서 공통으로 사용할 수 있지만, 어떤 최적화는 대상 하드웨어의 데이터 흐름이나 지원 연산, 메모리 구조를 알아야만 제대로 적용할 수 있습니다. 문제는 이 둘이 완전히 독립적이지 않다는 점입니다. 앞 단계에서 내린 결정이 뒤 단계의 성능에 그대로 영향을 줍니다.</p><p>연산 결합(fusion)이 대표적인 예입니다. 여러 연산을 하나로 합치면 중간 결과를 별도로 만들어 메모리에 저장하는 일을 줄일 수 있습니다. 하지만 합쳐진 연산이 NPU가 직접 지원하는 소수의 전용 연산 형태에 맞지 않을 수도 있고, 억지로 맞추는 과정에서 생기는 비용이 오히려 연산을 합쳐 얻는 이득보다 커질 수도 있습니다. 타일링(tiling)도 마찬가지입니다. 텐서를 어떤 크기로 나눌지는 비교적 높은 단계의 IR에서도 결정할 수 있지만, 실제로 어떤 크기가 효율적인지는 결국 하드웨어의 메모리 용량과 할당 방식에 따라 달라집니다.</p><p>Torq는 이런 문제를 해결하기 위해 컴파일러를 여러 계층으로 나눕니다. MLIR에서는 각 계층을 <strong>dialect</strong>라는 단위로 구성하고, dialect마다 서로 다른 추상화 단계의 연산과 정보를 표현합니다. <strong>Torq는</strong> 텐서의 수학적 의미와 높은 단계의 최적화를 가능한 한 오래 MLIR의 표준 dialect에 남겨 둡니다. NPU 프로그램이나 메모리 배치처럼 구체적인 하드웨어 정보가 필요해지는 시점부터 Torq 전용 dialect를 사용합니다.</p><p>Torq 컴파일러는 IREE plugin으로 구현되어 있고, MLIR을 기반으로 동작합니다. 이 글에서 주로 다루는 계층은 다음 세 가지입니다.</p><ul><li><strong>linalg 계층</strong>: 텐서 연산을 주로 수학적인 의미로 표현하는 MLIR의 표준 dialect입니다. 타일링이나 연산 결합처럼 하드웨어에 지나치게 종속되지 않은 최적화가 주로 이 단계에서 이루어집니다. 일부 패스가 대상 하드웨어의 정보를 참고할 수는 있지만, 아직 실제 NPU 프로그램이나 내부 데이터 경로까지 드러나지는 않습니다.</li><li><strong>torq_hl 계층</strong>: 연산에 Torq NPU의 의미를 부여하는 dialect입니다. XRAM과 LRAM 사이의 데이터 이동과 SLICE 프로그램 실행이 이 단계부터 직접 표현되기 때문에, 어떤 데이터를 NPU 메모리 안팎으로 옮겨야 하는지, 프로그램을 언제 실행하는지가 보이기 시작합니다.</li><li><strong>torq_hw 계층</strong>: 실제 하드웨어가 사용하는 descriptor에 대응하는 dialect입니다. D/W/B/Q 데이터 경로와 ALU/ACT 설정처럼 하나의 SLICE 작업을 실제로 구성하는 정보가 IR에 직접 나타납니다.</li></ul><p>같은 행렬 곱셈이 각 계층에서 어떻게 표현되는지 보면 차이를 더 쉽게 이해할 수 있습니다.</p><pre>// linalg: 수학적인 의미의 텐서 연산만 표현합니다.<br>//         tensor.empty와 linalg.fill(0.0)은 matmul의 출력 텐서를 초기화합니다.<br>%zero = arith.constant 0.000000e+00 : bf16<br>%e = tensor.empty() : tensor&lt;64x128xbf16&gt;<br>%f = linalg.fill ins(%zero : bf16) outs(%e : tensor&lt;64x128xbf16&gt;) -&gt; tensor&lt;64x128xbf16&gt;<br>%m = linalg.matmul ins(%a, %b : tensor&lt;64x64xbf16&gt;, tensor&lt;64x128xbf16&gt;)<br>                   outs(%f : tensor&lt;64x128xbf16&gt;) -&gt; tensor&lt;64x128xbf16&gt;<br><br>// torq_hl: NPU에서 실행할 수 있는 연산 단위로 바뀝니다.<br>//          linalg.fill은 사라지고 초기화되지 않은 tensor.empty가 init operand로 남으며,<br>//          bias와 quantization parameter가 추가됩니다.<br>//          (%sb = dense&lt;[0, 1]&gt; : tensor&lt;2xi32&gt;, 즉 bias 0 · scale 1)<br>%init = tensor.empty() : tensor&lt;64x128xbf16&gt;<br>%q = &quot;torq_hl.matmul&quot;(%init, %sb, %a, %b) {output_zp = 0, shift = 0, ...}<br><br>// torq_hw: 실제 하드웨어 descriptor에 가까운 형태입니다.<br>torq_hw.slice_task {<br>  op : &quot;matmul-fast&quot;<br>  D %arg3 : memref&lt;64x128xbf16, lram&gt;    W %arg2 : memref&lt;64x64xbf16, lram&gt;<br>  B %arg1 : memref&lt;2xi32, lram&gt;          Q %arg0 : memref&lt;64x128xbf16, lram&gt;<br>  CFG {alu_op0_mode = [MUL, ...], alu_op1_mode = [ACC, ...], act_mode = ACT,<br>       weight_format = BF, alu_format = BF, act_format = BF, ...}<br>}</pre><p>세 단계에서 수행하려는 계산 자체는 같습니다. 달라지는 것은 IR에 담기는 정보의 구체성입니다. linalg에서는 텐서 연산의 수학적 의미만 중요합니다. torq_hl로 내려오면 이 연산을 NPU에서 실행하기 위해 필요한 정보가 붙습니다. 마지막으로 torq_hw에서는 D(Input Data), W(Weight), B(Bias/Scale), Q(Output)와 ALU/ACT 설정처럼 실제 하드웨어 동작에 가까운 정보까지 드러납니다.</p><p>여기에 프로그램 실행과 데이터 이동까지 포함하면, 높은 단계의 IR에서는 보이지 않던 비용이 더욱 분명해집니다.</p><pre>// torq_hl: 하나의 커널 연산을 실행하기 위해 주변에 필요한 과정입니다.<br>%a_x = torq_hl.map_binding {binding_index = 0} : memref&lt;64x64xbf16&gt;   // XRAM 주소<br>%a_l = memref.alloc() : memref&lt;64x64xbf16, lram&gt;                      // LRAM 할당<br>torq_hl.load %a_x to %a_l {element_size_bytes = 8192}                 // DMA 입력 (XRAM -&gt; LRAM)<br>...<br><br>%prog = torq_hl.program &quot;slice_program_torq_hl.matmul_0&quot; {<br>  ^bb0(%q: ..., %b: ..., %w: ..., %d: ...):<br>    &quot;torq_hl.matmul&quot;(%q, %b, %w, %d) {output_zp = 0, shift = 0, ...}<br>}<br>%inv, %code = torq_hl.create_invocation &quot;slice_program_torq_hl.matmul_0&quot;<br>                program(%prog) on 0 : ..., memref&lt;5120xi8&gt;<br>torq_hl.load %code to %code_l {element_size_bytes = 5120}             // 프로그램 코드 DMA<br><br>torq_hl.start_program %inv args(%q_l, %b_l, %a_l, %d_l)<br>torq_hl.wait_program %inv<br>torq_hl.store %q_l to %q_x {element_size_bytes = 16384}               // DMA 출력 (LRAM -&gt; XRAM)</pre><p>linalg에서는 행렬 곱셈 하나로 보이던 연산이 torq_hl에서는 XRAM 주소를 찾고, LRAM을 할당하고, 입력을 불러오고, 프로그램을 실행한 뒤 기다리고, 마지막 결과를 다시 저장하는 여러 단계로 풀어집니다. 실제 계산은 똑같지만, 그 계산을 NPU에서 실행하기 위해 필요한 준비 비용이 이 단계부터 눈에 보이기 시작합니다.</p><p>저희가 Torq를 작업하면서 여러 컴파일러 계층이 중요하다고 느낀 이유도 여기에 있습니다. linalg 단계에서 텐서를 한 번 나누는 결정이 torq_hl에서는 추가 메모리 주소와 DMA, 프로그램 실행으로 이어질 수 있습니다. 반대로 어떤 문제는 이런 하드웨어 세부사항이 생기기 전에 고치는 편이 훨씬 쉽고, 또 어떤 문제는 낮은 단계까지 내려가야 필요한 정보를 얻을 수 있습니다. 모든 최적화를 한 단계에 몰아넣기보다, 필요한 정보가 드러나는 시점에 각각의 문제를 처리하는 편이 훨씬 자연스럽습니다.</p><p>이런 구조는 새로운 하드웨어에 대응할 때도 도움이 됩니다. NPU가 지원하는 연산이나 메모리 크기, 내부 데이터 경로는 제품 세대에 따라 달라질 수 있습니다. 높은 단계의 텐서 의미와 낮은 단계의 하드웨어 세부사항을 분리해 두면, 대상 하드웨어가 바뀌더라도 컴파일러 전체를 함께 뜯어고쳐야 하는 범위를 줄일 수 있습니다.</p><h3>Slicing으로 생긴 추가 비용 줄이기</h3><p>이제 병렬화를 위해 텐서를 나눴을 때 추가 비용이 어디에서 생기는지 확인할 수 있게 되었습니다. 이후 저희가 진행한 최적화의 방향은 비교적 분명했습니다. <strong>병렬 실행 자체는 유지하면서, 그 과정에서 불필요하게 늘어난 데이터 이동을 최대한 줄이는 것</strong>입니다.</p><p>다만 문제마다 필요한 정보가 달랐기 때문에 모든 수정이 같은 단계에 들어가지는 않았습니다. 어떤 문제는 아직 수학적인 텐서 연산만 보이는 linalg 단계에서 해결하는 것이 좋았고, 어떤 문제는 실제 메모리 이동이 드러나는 torq_hl까지 내려가야 해결할 수 있었습니다.</p><h4>linalg에서 연속된 Elementwise 연산을 하나로 묶기</h4><p>linalg 단계에서는 연속된 elementwise 연산이 각각 따로 slicing되는 경우가 있었습니다. 복합 activation이나 후처리 연산은 정규화 과정을 거치면서 여러 개의 linalg.generic 연산으로 풀어지는 경우가 많습니다. 이 연산들이 각각 다른 루프에 들어가면 앞 연산의 중간 결과가 다음 루프까지 살아남아야 하고, 이후 낮은 단계에서 XRAM에 저장되는 상황이 생길 수 있습니다.</p><p>저희는 이런 연산 묶음에 붙어 있던 torq-fuse-group 값을 하나로 통일했습니다. 컴파일러는 같은 그룹의 linalg 연산을 하나의 scf.forall 안에 넣고, 그룹이 다르면 별도의 루프로 나눕니다. 따라서 slicing이 시작되기 전에 연속된 연산 전체에 같은 그룹을 부여하면, 나중에 이미 나뉜 루프를 다시 합칠 필요 없이 처음부터 하나의 루프로 만들 수 있습니다. 아래 예시는 실제보다 긴 연산 묶음을 보기 쉽게 세 단계로 줄인 것입니다.</p><pre>// [변경 전, slicing 전]<br>// 아직 루프는 없고 여러 연산이 이어져 있습니다.<br>// 각 연산에는 자신이 어느 그룹에 속하는지를 나타내는 marker가 붙어 있는데,<br>// 이 값이 서로 다릅니다.<br>%a = linalg.generic { ... }          {torq-fuse-group = [3]}<br>%b = linalg.generic { ... %a ... }   {torq-fuse-group = [4]}<br>%c = linalg.generic { ... %b ... }   // marker 없음<br><br>// [변경 후, slicing 전]<br>// 이어진 연산을 따라가며 같은 group marker를 부여합니다.<br>// 연산의 내용과 순서는 그대로이고 marker만 바뀝니다.<br>%a = linalg.generic { ... }          {torq-fuse-group = [30]}<br>%b = linalg.generic { ... %a ... }   {torq-fuse-group = [30]}<br>%c = linalg.generic { ... %b ... }   {torq-fuse-group = [30]}<br><br>// [변경 전, slicing 후]<br>// 서로 다른 marker 때문에 연산마다 별도의 루프가 만들어집니다.<br>%a = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... } }         // %a가 다음 루프까지 살아남음<br>%b = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... %a ... } }  // 다음 루프가 %a를 사용<br>%c = scf.forall (%i) = (0) to (N) step (N/2) { linalg.generic { ... %b ... } }  // 같은 일이 반복됨<br><br>// [변경 후, slicing 후]<br>// 하나의 루프 안에 전체 연산이 들어가므로 중간 결과도 루프 안에 머뭅니다.<br>%c = scf.forall (%i) = (0) to (N) step (N/2) {<br>  %t0 = linalg.generic { ... }<br>  %t1 = linalg.generic { ... %t0 ... }<br>        linalg.generic { ... %t1 ... }<br>}</pre><p>이 문제가 나타났던 컴파일 경로에서는 서로 다른 scf.forall 사이를 넘어가는 중간 결과가 XRAM에 저장되면서 불필요한 왕복이 생겼습니다. 연속된 연산 전체를 하나의 루프 안에 두면 중간 결과를 LRAM에 더 오래 유지할 수 있고, 그만큼 DMA도 줄어듭니다. 여기서 중요한 것은 단순히 여러 연산을 합치는 것 자체가 아니라, <strong>연산 사이의 중간 결과를 가능한 한 칩 내부에 계속 남겨두는 것</strong>입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXavaPwHIdoFyYOWyo6aCA.png" /><figcaption>slicing을 켠 erf(1x1024x64, bf16)의 컴파일 시점 타임라인을 보면 차이가 더 분명합니다. 각 패널의 위쪽은 elementwise 연산 전체를 하나의 fuse group으로 묶기 전, 아래쪽은 묶은 뒤입니다. 아래 패널은 파란 영역인 실행 초반 330 µs를 확대한 것입니다. ①에서는 각 연산이 끝날 때마다 두 SLICE의 결과를 XRAM으로 저장하고, ②에서는 다음 연산을 위해 같은 값을 다시 LRAM으로 읽어옵니다. ③처럼 연산 전체를 하나의 fuse group으로 묶으면 중간 결과가 LRAM에 남아 있고 SLICE 프로그램도 연달아 실행됩니다. 그 결과 store 횟수는 36회(2.6 MB)에서 7회(448 KB)로 줄었고, 추정 실행 시간도 1834.9 µs에서 888.0 µs로 줄었습니다.</figcaption></figure><h4>메모리 변환보다 필요한 SLICE를 먼저 추출하기</h4><p>다른 문제는 컴파일러가 torq_hl 단계까지 내려간 뒤에 나타났습니다. 이 단계에서도 일부 값은 여전히 텐서 형태로 표현되지만, 이제 어느 메모리에 놓일지가 type에 함께 표현됩니다. 기존 IR에서는 큰 값을 먼저 XRAM으로 옮긴 뒤, 실제로 필요한 작은 부분만 나중에 잘라내는 형태가 만들어질 수 있었습니다.</p><p>저희는 연산 순서를 바꿔, 값이 아직 LRAM에 있을 때 필요한 부분을 먼저 잘라내고 그 작은 값만 XRAM으로 옮기도록 수정했습니다. 이렇게 하면 큰 텐서 전체를 굳이 XRAM까지 내보낼 필요가 없습니다. 또한 작은 값에 남아 있는 불필요한 왕복은 기존 컴파일러 최적화가 제거할 수 있는 형태가 됩니다.</p><pre>// 변경 전<br>%x  = torq_hl.convert in(%big) {encoding = xram}   // 전체 결과를 XRAM에 기록<br>%sl = tensor.extract_slice %x [...]                // XRAM에서 필요한 부분만 추출<br>%l  = torq_hl.convert in(%sl) {encoding = lram}    // 다시 LRAM으로 가져옴<br><br>// 변경 후<br>%sl = tensor.extract_slice %big [...]              // LRAM에 있을 때 필요한 부분을 먼저 추출<br>%x  = torq_hl.convert in(%sl) {encoding = xram}    // 큰 텐서 전체는 XRAM으로 나가지 않음<br>%l  = torq_hl.convert in(%x) {encoding = lram}     // 이제 이 왕복은 불필요함<br><br>// 이후 불필요한 연산 제거 후<br>%sl = tensor.extract_slice %big [...]              // LRAM에서 바로 필요한 부분만 사용</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUUmo1g59xyzZHV7d4AXtQ.png" /><figcaption>max_pool(5x5, 1x15x20x384, i8)의 실행 흐름을 보면, 변경 전에는 ① 112.5 KB 크기의 결과 전체를 XRAM으로 옮긴 뒤 ② 각 SLICE가 자신에게 필요한 56.2 KB만 다시 잘라 LRAM으로 가져옵니다. 변경 후에는 ③ 결과가 아직 LRAM에 있을 때 각 SLICE가 필요한 부분을 바로 가져가기 때문에 이 왕복 자체가 사라집니다. 추정 실행 시간은 369.3 µs에서 312.9 µs로 줄었습니다.</figcaption></figure><p>앞의 linalg 그룹화와 이번 수정 모두 새로운 연산을 추가한 것은 아닙니다. 필요한 변환은 이미 컴파일러 안에 있었습니다. 중요한 것은 Torq의 메모리 구조에 맞게 IR의 형태를 바꿔, 기존 최적화가 제대로 동작할 수 있는 조건을 만들어 주는 것이었습니다.</p><h4>새로운 분석을 만들기보다 필요한 정보를 알려주기</h4><p>torq_hl 단계까지 내려오면 LRAM 주소와 load/store, 프로그램 사이의 경계가 IR에 직접 드러납니다. 따라서 이 단계에서는 중복된 데이터 이동을 더 직접적으로 찾아낼 수 있습니다. 예를 들어 두 SLICE가 같은 읽기 전용 데이터를 각각 따로 불러오고 있다면 한 번만 옮겨 공유하는 편이 낫고, 중간 결과를 임시 XRAM에 저장했지만 이후 한 번도 읽지 않는다면 그 store는 제거하는 편이 낫습니다.</p><p>흥미로운 점은 이런 문제를 해결하는 데 필요한 분석과 변환 대부분이 이미 MLIR과 IREE 쪽에 존재했다는 것입니다. 문제는 torq_hl이 Torq 전용 dialect라서, 기존 컴파일러가 각 연산이 메모리를 어떻게 읽고 쓰는지, 또는 다른 위치로 옮겨도 되는지를 알 수 없었다는 데 있었습니다. 그래서 같은 분석을 새로 구현하는 대신, 기존 분석이 torq_hl 연산을 이해할 수 있도록 필요한 정보를 interface로 제공했습니다.</p><p>SLICE 프로그램의 각 인자가 읽기용인지 쓰기용인지는 IREE의 interface를 단순화한 AsyncAccessOpInterface를 통해 알려줍니다. 연산 단위의 메모리 접근 정보와 연산 이동 가능 여부는 각각 MemoryEffectsOpInterface와 ConditionallySpeculatable을 사용합니다. 이렇게 연산의 성질을 알려주면 기존 MLIR 분석과 유틸리티도 torq_hl을 대상으로 그대로 사용할 수 있습니다.</p><p>가장 직접적인 효과 중 하나는 필요 없는 store를 제거할 수 있게 된 것입니다. 읽기/쓰기 정보가 없다면 컴파일러는 SLICE 프로그램의 모든 인자가 읽힐 수도 있고 쓰일 수도 있다고 보수적으로 가정해야 합니다. 하지만 뒤의 프로그램이 어떤 값을 읽지 않고 새 값으로 완전히 덮어쓴다는 사실을 알 수 있다면, 앞에서 XRAM에 임시로 저장해 둔 값은 더 이상 필요하지 않습니다.</p><pre>// 변경 전<br>%t_x = torq_hl.map_binding {binding_index = 2}   // XRAM의 임시 위치<br>%t_l = memref.alloc() : memref&lt;..., lram&gt;        // LRAM의 위치<br><br>torq_hl.start_program %inv_a args(%t_l, %d_l)    // A가 결과를 %t_l에 씀<br>torq_hl.wait_program %inv_a<br>torq_hl.store %t_l to %t_x                       // LRAM이 부족해 %t_l을 XRAM에 임시 저장<br><br>torq_hl.start_program %inv_b args(%t_l, %e_l)    // B 역시 결과를 %t_l에 씀<br>torq_hl.wait_program %inv_b                      // 하지만 B가 %t_l을 읽는지 쓰는지 알 수 없음<br>torq_hl.store %t_l to %q_x                       // 따라서 앞의 store도 제거할 수 없음<br><br>// 변경 후: B가 %t_l을 읽지 않고 완전히 덮어쓴다는 것을 알 수 있습니다.<br>// 따라서 앞에서 XRAM에 저장했던 값은 다시 읽히지 않습니다.<br>%t_l = memref.alloc() : memref&lt;..., lram&gt;<br><br>torq_hl.start_program %inv_a args(%t_l, %d_l)<br>torq_hl.wait_program %inv_a<br>                                                 // 불필요한 store와 %t_x binding이 사라짐<br>torq_hl.start_program %inv_b args(%t_l, %e_l)<br>torq_hl.wait_program %inv_b<br>torq_hl.store %t_l to %q_x                       // 최종 결과를 저장하는 store는 남음</pre><p>같은 정보는 LRAM이 부족해 어떤 버퍼를 잠시 XRAM으로 내보냈다가 나중에 다시 불러오는 경우에도 활용할 수 있습니다. 중간의 프로그램이 그 버퍼를 읽기만 하고 수정하지 않았다면, 앞서 XRAM에 저장한 값은 여전히 유효합니다. 따라서 새로운 XRAM 공간을 만들고 같은 데이터를 또 저장할 필요 없이, LRAM 공간만 비운 뒤 기존 XRAM 데이터를 나중에 그대로 다시 사용할 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCWq1F9l6TegfCF68hMDkw.png" /><figcaption>AsyncAccessOpInterface를 적용하기 전후의 conv1d 레이어(kernel 127, stride 64, 오디오 80,000 샘플에서 288 채널)를 비교하면 이 효과를 확인할 수 있습니다. ①은 다음 프로그램이 곧바로 덮어쓸 200 KB 값을 XRAM에 저장하는 불필요한 store이고, ②는 그 값과 짝을 이루는 200 KB load입니다. 두 연산은 함께 사라집니다. ③에서는 내용이 바뀌지 않은 309 KB 버퍼를 XRAM에 한 번 더 저장하고 있었는데, 변경 후에는 이미 XRAM에 남아 있는 값을 그대로 재사용합니다. 그 결과 DMA 출력은 22회(4.5 MB)에서 13회(2.4 MB)로 줄었고, 추정 실행 시간은 5091.1 µs에서 4218.8 µs로 감소했습니다.</figcaption></figure><p>연산 자체를 루프 밖으로 옮길 수 있는지도 비슷한 방식으로 판단할 수 있습니다. 어떤 연산이 루프를 몇 번 반복하더라도 항상 같은 결과를 만든다면, 매 반복마다 다시 계산하기보다 루프 밖에서 한 번만 계산한 뒤 결과를 재사용하는 편이 효율적입니다. 기존에는 MLIR이 torq_hl 연산을 다른 위치로 옮겨도 안전한지 판단할 수 없었습니다.</p><pre>// 변경 전: 반복할 때마다 같은 값을 다시 계산합니다.<br>// 루프 밖으로 옮겨도 안전하다는 것을 컴파일러가 알 수 없습니다.<br>scf.forall (%i) ... {<br>  %s = torq_hl.segmentation ... (%w, %sb, %in)   // 세 입력 모두 %i와 무관<br>  ... computations using %s ...<br>}<br><br>// 변경 후: 이 연산을 옮겨도 안전하다는 정보가 있으므로,<br>// MLIR의 moveLoopInvariantCode를 그대로 사용할 수 있습니다.<br>%s = torq_hl.segmentation ... (%w, %sb, %in)<br>scf.forall (%i) ... {<br>  ... computations using %s ...<br>}</pre><p>모든 torq_hl 연산을 무조건 옮길 수 있도록 한 것은 아닙니다. 실제로 위치를 바꿔도 의미가 달라지지 않는 연산만 대상으로 했고, 인덱스에 따라 값을 가져오는 연산처럼 실행 위치가 의미에 영향을 주는 경우는 제외했습니다. 덕분에 연산 이동이 가능한지 판단하는 로직을 별도로 다시 만들지 않고 MLIR의 getBackwardSlice와 moveLoopInvariantCode를 그대로 활용할 수 있었습니다.</p><p>이런 수정들을 통해 slicing 과정에서 생기던 중복 데이터 이동의 일부를 없앨 수 있었습니다. 동시에 문제를 바라보는 관점도 조금 달라졌습니다. 단순히 일을 잘 나누는 것만으로는 충분하지 않았습니다. 병렬화를 위해 추가 비용이 생긴다면, 그 비용까지 다시 줄여야 비로소 병렬 실행이 실제 성능 향상으로 이어집니다.</p><h3>무엇을 배웠는가</h3><p>돌이켜보면 개별적인 rewrite나 interface보다 더 중요했던 것은 여러 문제에서 반복해서 나타난 공통된 패턴이었습니다.</p><p>첫 번째는 <strong>최적화를 하려면 칩 안에서 데이터가 어떻게 움직이는지 먼저 이해해야 한다는 점</strong>입니다. Torq에서는 각 연산이 사용할 수 있는 입력 경로와 누산 경로, 후처리 경로가 정해져 있고, 이 제약에 따라 하나의 프로그램 안에 어떤 연산을 함께 넣을 수 있는지가 결정됩니다. 작업 개수나 DMA 전송량은 문제를 찾는 데 좋은 지표이지만, 숫자가 줄었다고 해서 항상 실행 시간이 줄어드는 것은 아닙니다. 연산을 합쳐 작업 수가 줄었더라도 실제로 어떤 커널 경로를 선택하게 되는지, 전체 실행 시간을 결정하는 경로가 어떻게 바뀌는지까지 확인해야 합니다.</p><p>두 번째는 <strong>제한된 LRAM 안에서 타일링, 연산 결합, slicing을 서로 따로 생각하기 어렵다는 점</strong>입니다. 세 가지 모두 어떤 데이터를 칩 안에 남겨둘지, 한 번에 얼마나 많이 보관할지, 그리고 데이터를 몇 번 다시 옮겨야 할지를 결정합니다. 각각을 독립적으로 최적화하면 한쪽에서 얻은 이득을 다른 쪽이 다시 깎아먹는 상황이 쉽게 생깁니다.</p><p>그렇다고 모든 정보를 하나의 하드웨어 전용 IR에 몰아넣는 것이 답은 아닙니다. 여러 단계로 나뉜 컴파일러 구조가 최적화 사이의 영향을 없애 주는 것은 아니지만, <strong>그 영향이 어디에서 생기는지 드러나게 해 줍니다.</strong> 높은 단계에서는 텐서 연산의 의미를 유지한 채 변환을 수행하고, 낮은 단계에서는 그 결정이 실제 하드웨어에서 어떤 비용으로 이어지는지를 확인할 수 있습니다. 저희에게 이 구조의 장점은 단순히 컴파일러 설계를 깔끔하게 만드는 데 있다기보다, 필요한 정보를 필요한 순간에 볼 수 있게 해 준다는 데 있었습니다.</p><h3>다음 단계</h3><p>이 경험은 앞으로 Torq 컴파일러를 어떤 방향으로 발전시키고 싶은지에도 영향을 주고 있습니다. 저희의 목표는 더 다양한 모델과 앞으로 나올 하드웨어를 지원하면서도, 새로운 대상이 추가될 때마다 예외 처리를 계속 덧붙여야 하는 구조를 피하는 것입니다.</p><p><strong>1. EasyKernel에서 Nadya로.</strong></p><p>현재 Torq의 커널은 자체 C++ DSL인 EasyKernel로 작성되어 있습니다. 하드웨어 descriptor나 instruction stream을 직접 작성하는 대신, 일반적인 반복문에 가까운 형태로 커널을 작성하면 이를 실제 descriptor로 변환해 줍니다. 훨씬 다루기 쉬운 방식이지만, 각 텐서 연산의 구현이 여전히 컴파일러 내부에 들어 있다는 한계가 있습니다. 새로운 연산이나 다음 세대 하드웨어를 지원할 때마다 컴파일러 자체를 수정해야 하고, 커널 구현을 실행 중에 비교하거나 자동으로 튜닝하기도 어렵습니다.</p><p>저희가 고민하고 있는 방향 중 하나는 커널 작성을 저희가 개발하고 있는 프로그래밍 언어인 Nadya로 옮기는 것입니다. Nadya는 작성자가 하드웨어 최적화의 모든 세부사항을 직접 알지 않아도 높은 성능의 프로그램을 만들 수 있도록 설계하고 있습니다. 개별 연산을 NPU에서 어떻게 구현할지는 컴파일러 밖의 커널 코드에 두고, 여러 연산을 어떤 순서와 조합으로 실행할지는 컴파일러가 결정하도록 역할을 나누는 방식입니다.</p><p><strong>2. 최적화 결정을 탐색 가능한 형태로 만들기.</strong></p><p>컴파일 과정에는 아직 경험적인 규칙에 따라 결정되는 값이 많습니다. 타일 크기, SLICE를 어떻게 나눌지, 연산을 합칠지 말지 등이 대표적입니다. 이런 결정을 각각의 컴파일러 패스 안에 고정해 두기보다 외부에서 조절 가능한 값으로 만들고, 여러 조합을 자동으로 탐색할 수 있도록 하고 싶습니다.</p><p>탐색 과정 자체는 별도의 도구에서 수행할 수도 있고, 나중에는 컴파일러 안으로 더 깊게 들어올 수도 있습니다. 중요한 것은 <strong>어떤 값을 탐색할지 결정하는 로직과 실제 IR을 바꾸는 로직을 분리하는 것</strong>입니다. 이렇게 하면 같은 컴파일러 파이프라인을 그대로 두고 여러 설정을 비교할 수 있고, 새로운 하드웨어가 추가될 때마다 모든 최적화 규칙을 처음부터 다시 작성해야 하는 부담도 줄일 수 있습니다.</p><p>새로운 종류의 하드웨어를 위한 컴파일러를 강력하면서도 유연하게 만드는 데에는 아직 풀어야 할 문제가 많습니다. 하지만 바로 그 점 때문에 이 프로젝트가 더 재미있다고 생각합니다. ENERZAi는 지금도 이런 문제들을 하나씩 해결해 나가고 있습니다.</p><h3>오픈소스로 공개된 Torq 컴파일러</h3><p>이 프로젝트의 가장 큰 장점 중 하나는 하드웨어 명세와 컴파일러 소스코드가 모두 공개되어 있다는 점입니다. Torq 컴파일러는 <a href="https://github.com/synaptics-torq/torq-compiler">synaptics-torq/torq-compiler Github 레포</a>에서 확인할 수 있고, 실제 모델 예제는 <a href="https://github.com/synaptics-torq/torq-examples">torq-examples</a>, 공식 문서는 <a href="https://synaptics-torq.github.io/torq-compiler/v/latest/">synaptics-torq.github.io</a>에 공개되어 있습니다. 저희가 어떤 문제를 다루고 있는지 누구나 직접 확인할 수 있고, 관심이 있다면 프로젝트에 직접 참여할 수도 있습니다.</p><p>그 외에 Torq 프로젝트나 Nadya 등 에너자이의 최적화 기술에 대하여 더 알고 싶으시다면, 언제든 연락 부탁드립니다!</p><p><a href="https://enerzai.com/ko/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b04cf171e227" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Ran a 1.7B LLM at 32 tok/s on a Low-Cost Qualcomm SoC (Without QNN)]]></title>
            <link>https://medium.com/@enerzai/how-we-ran-a-1-7b-llm-at-32-tok-s-on-a-low-cost-qualcomm-soc-without-qnn-ca2d2c1bb393?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca2d2c1bb393</guid>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[npu]]></category>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[on-device-llm]]></category>
            <category><![CDATA[qualcomm]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 02:48:07 GMT</pubDate>
            <atom:updated>2026-07-20T02:48:07.275Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, this is ENERZAi. In a previous post, we shared how we successfully deployed BitNet on the Qualcomm Dragonwing QCS6490 Hexagon NPU using QNN. This time, we pushed further — using our own inference backend, <strong>Optimium</strong>, we managed to run an LLM on the same chip with even less memory and significantly faster speeds.</p><p>In this post, we’ll walk through how our results stack up against Qualcomm AI Hub and Hugging Face benchmarks — and what those numbers actually mean for the on-device AI ecosystem.</p><h3>TL;DR</h3><ul><li>We successfully ran <strong>Opti 1.7B</strong> — our in-house language model built by applying 1.58-bit QAT to Qwen3 1.7B — on the Hexagon NPU inside the Qualcomm QCS6490.</li><li>This time, we ran the full pipeline using our own inference backend, <strong>Optimium</strong> — no QNN — cutting memory usage further while dramatically boosting generation speed. (Peak memory: ~680MB; generation speed: ~32 tok/s)</li><li>LLM token generation is inherently a <strong>memory-bound</strong> process, bottlenecked by memory bandwidth rather than compute. We addressed this on two fronts: 1.58-bit quantization to minimize the data read from memory per token, combined with custom NPU kernels that push hardware bandwidth utilization to ~22 GB/s out of a theoretical 25.6 GB/s.</li><li>The result? We outperformed Qualcomm AI Hub benchmarks measured on hardware with far greater memory and compute resources. In short, ENERZAi’s technology means you can <strong>run the same model on cheaper hardware — or a better model on the same hardware.</strong></li></ul><h3>About the Demo</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnINDHzaAAZk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnINDHzaAAZk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnINDHzaAAZk%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/837c9546c458163dc6b7d56a52ba1cbd/href">https://medium.com/media/837c9546c458163dc6b7d56a52ba1cbd/href</a></iframe><p>Here are the key specs and details behind the demo:</p><ul><li>Model: Opti 1.7B (Qwen3 1.7B, quantized to 1.58-bit via QAT)</li><li>Hardware: Qualcomm Hexagon V68 NPU (in QCS6490)</li><li><strong>Peak memory: ~680MB</strong> (weights + KV cache)</li><li><strong>Response rate (Generation): ~32 tok/s</strong></li></ul><p>For a 1.7B model, the quality and speed of the responses speak for themselves. It may look like a simple demo — but under the hood, it represents the full depth of ENERZAi’s technology stack, from 1.58-bit quantization to low-level NPU kernel optimization.</p><h3>Background: Why NPU Matters for On-Device LLMs</h3><p>The case for on-device AI is clear: eliminating cloud dependency brings fundamental advantages in cost, latency, privacy, and offline availability. The challenge is that on-device environments operate under strict memory and power constraints.</p><p>That’s exactly why NPUs (Neural Processing Units) exist. Designed specifically for AI inference, NPUs offer superior efficiency across memory, power, and speed — making NPU utilization essential for running large language models on-device at any meaningful quality.</p><p>The catch is that NPU SDKs have limited operator and layer support, which severely restricts which models can actually run on a given chip. Novel architectures like BitNet fall entirely outside the scope of what most NPU vendors support — making deployment extremely difficult, and real performance even harder to achieve. For the full story, check out our earlier post below.</p><p><a href="https://medium.com/@enerzai/running-bitnet-on-qualcomm-hexagon-with-custom-1-58-kernels-51424c602068">Running BitNet on Qualcomm Hexagon with custom 1.58 kernels</a></p><p>If the last post was about getting an unsupported model to run on an NPU at all, this one goes deeper: how we made it run faster and more efficiently.</p><h3>Why Memory Becomes the Bottleneck in LLM Inference</h3><p>LLM inference has two distinct phases. The first is <strong>prefill</strong> — reading and processing the user’s input. Since this involves many tokens processed in parallel, it’s compute-bound: raw computational power matters most here. The second is <strong>generation</strong> — producing the response one token at a time. This is the phase users actually experience as “speed.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tpzl0evGCMLpQ1vb" /><figcaption>Source: Samsung Electronics Tech Blog</figcaption></figure><p>Why is generation the bottleneck? Because producing each token requires loading the model’s entire set of weights from memory. That means generation speed isn’t limited by compute (measured in TOPS) — it’s limited by how fast data can be read from DRAM. Even the most powerful chip won’t generate tokens any faster if its memory bandwidth stays the same.</p><p>A simple example: if memory bandwidth is 20 GB/s and the model occupies 1 GB in memory, the theoretical maximum generation speed is 20 tok/s. In practice, achieving 100% bandwidth utilization is nearly impossible — and as conversations grow longer, the KV cache (the model’s short-term memory for tracking prior context) grows alongside them, consuming additional memory. This is why the ability to build smaller, more efficient models is so critical.</p><h3>Maximizing LLM Inference via Model Compression and Kernel Optimization</h3><p>Looking at that equation again, there are only two ways to increase generation speed: <strong>reduce the denominator</strong> (data read per token) or <strong>increase the numerator</strong> (usable bandwidth). We went after both at once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vCx8ZB0BToaVSxCC.png" /></figure><p><strong>First, 1.58-bit quantization shrinks the denominator.</strong> When model weights — originally stored as 16-bit or 32-bit floats — are reduced to just three possible values (−1, 0, +1), the model becomes dramatically smaller. These are called <em>ternary</em> weights; the “1.58” comes from information theory, where log₂(3) ≈ 1.58 is the minimum number of bits needed to represent three distinct states. With less data to read per token, the same bandwidth now supports much faster generation. In other words, quantization-based model compression isn’t just about shrinking model size — it’s a direct solution to the memory bottleneck that constrains inference speed.</p><p><strong>Second, custom NPU kernels push the numerator as high as possible.</strong> A chip’s memory bandwidth spec is a theoretical ceiling, not a guarantee. How much you can actually leverage depends entirely on how efficiently your kernels access memory. In this demo, we achieved approximately <strong>22 GB/s of the QCS6490’s rated 25.6 GB/s</strong> — roughly 86% utilization.</p><p>The key point: <strong>neither of these alone gets you here.</strong> Compression lowers the denominator; kernels raise the numerator. Only when both work in tandem do you get conversational speeds on a low-end IoT chip. That’s why we describe this demo as a result that requires 1.58-bit compression and NPU kernel optimization to work together.</p><h4>Key Implications</h4><p>In isolation, 32 tok/s might not sound like much. But once you consider the hardware it came from, the story changes completely.</p><p>The table below compares our demo (Opti 1.7B on QCS6490) against Qualcomm AI Hub benchmarks for Llama 3.2 1B (INT4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0jzltLnNQ_SC_N3X.png" /></figure><p>Take the Snapdragon X Elite — a high-end SoC designed for AI PCs, with roughly 4× the TOPS and 5× the memory bandwidth of the QCS6490. Despite that hardware advantage, the X Elite benchmark clocks in at just 24 tok/s, on a <em>smaller</em> model (Llama 3.2 1B vs. our 1.7B). The SA8255P — a premium automotive-grade SoC — and the Snapdragon 8 Elite, the chip found in flagship smartphones, come in at similar speeds to our demo as well.</p><p>Two takeaways: with ENERZAi’s technology, <strong>the same model can run on cheaper, lower-spec hardware</strong> — and on the <strong>same hardware, you can run a larger, more capable model</strong>. Simple in principle, but essential for delivering Agentic AI on-device rather than just basic command recognition.</p><h3>What’s Next</h3><p>We’re still building toward the same goal: the <strong>smallest possible agentic AI for Edge.</strong> That means continuing to advance our model compression capabilities — led by 1.58-bit quantization — alongside the kernel optimization built into our in-house AI compiler, Optimium. What makes this demo significant is that we implemented NPU kernels entirely on our own, without relying on the chip vendor’s SDK (QNN), and still achieved strong performance on a low-end chipset.</p><p>If you’re exploring on-device LLM deployment on Qualcomm platforms, or want to learn more about ENERZAi’s ultra-lightweight LLMs, feel free to reach out anytime!</p><p><a href="https://enerzai.com/contact">ENERZAi — Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca2d2c1bb393" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qualcomm QCS6490에서 32tok/s로 1.7B 온디바이스 LLM 구동하기]]></title>
            <link>https://medium.com/@enerzai/qualcomm-qcs6490%EC%97%90%EC%84%9C-32tok-s%EB%A1%9C-1-7b-%EC%98%A8%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4-llm-%EA%B5%AC%EB%8F%99%ED%95%98%EA%B8%B0-4e70aeaba190?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e70aeaba190</guid>
            <category><![CDATA[on-device-llm]]></category>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[npu]]></category>
            <category><![CDATA[qualcomm]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 09:28:31 GMT</pubDate>
            <atom:updated>2026-07-16T09:33:59.007Z</atom:updated>
            <content:encoded><![CDATA[<p>안녕하세요, 에너자이입니다. 예전에 다른 게시물에서 QNN을 활용하여 Qualcomm Dragonwing QCS6490 Hexagon NPU에 BitNet을 배포하는 데 성공했다는 소식을 전해드린 바 있는데요. 이번에 저희 자체 추론 백엔드인 <strong>Optimium</strong>을 사용해, 같은 칩에서 더 적은 메모리, 더 빠른 속도로 LLM을 구동하는 데 성공했습니다.</p><p>이번 게시물에서는 Qualcomm AI Hub 및 Hugging Face 벤치마크와의 비교를 통해 에너자이가 어느 정도의 성능을 확보했는지 알아보고, 이것이 온디바이스 AI 생태계에서 어떤 의미를 갖는지에 대해서도 이야기 나눠보고자 합니다.</p><h3>요약</h3><ul><li>에너자이는 Qwen3 1.7B를 자체 1.58-bit 기술로 양자화(Quantizaton Aware Training; QAT)한 언어 모델 <strong>Opti 1.7B</strong>를, Qualcomm QCS6490에 탑재된 Hexagon NPU에서 구동하는데 성공했습니다.</li><li>이번에는 QNN이 아닌 <strong>자체 추론 백엔드 Optimium</strong>으로 전체 파이프라인을 실행해, 메모리 사용량은 더 줄이고 생성 속도는 크게 끌어올렸습니다. (peak memory 약 680MB, 생성 속도 약 32 tok/s)</li><li>언어 모델에서 답변 생성은 본질적으로 메모리 대역폭이 병목으로 작용하는 프로세스입니다 <strong>(memory-bound)</strong>. 저희는 1.58-bit 양자화로 매 토큰 생성마다 메모리에서 읽어야 하는 모델의 크기를 최소화하는 동시에, 자체 NPU 커널 기반으로 하드웨어의 메모리 대역폭 자원을 매우 효율적으로 활용하였습니다 (25.6 GB/s 중 22 GB/s).</li><li>결과적으로 메모리 및 연산 자원이 더욱 풍부한 하드웨어에서 측정된 Qualcomm AI Hub 벤치마크보다 우수한 성능을 달성할 수 있었습니다. 이는 에너자이의 기술을 적용하여 <strong>같은 모델이라면 더욱 저렴한 하드웨어를, 같은 하드웨어라면 더욱 좋은 모델을 사용할 수 있음</strong>을 의미합니다.</li></ul><h3>About the Demo</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnINDHzaAAZk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnINDHzaAAZk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnINDHzaAAZk%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/837c9546c458163dc6b7d56a52ba1cbd/href">https://medium.com/media/837c9546c458163dc6b7d56a52ba1cbd/href</a></iframe><p>이번 데모에 활용된 모델/하드웨어 스펙 및 핵심 정보는 다음과 같습니다.</p><ul><li>모델: Opti 1.7B (Qwen3 1.7B를 1.58bit로 QAT한 모델)</li><li>하드웨어: Qualcomm Hexagon V68 NPU (in QCS6490)</li><li><strong>Peak memory: 약 680MB</strong> (weights + KV cache 포함)</li><li><strong>Response rate (Generation): 약 32 tok/s</strong></li></ul><p>1.7B 크기의 작은 모델임에도 불구하고 괜찮은 수준의 답변을 빠르게 생성하는 것을 확인하실 수 있는데요. 굉장히 간단한 데모이지만, 1.58bit 양자화부터 NPU 커널 최적화까지 에너자이 기술의 정수가 들어간 결과물입니다.</p><h3>지난 이야기: 온디바이스 LLM을 위한 NPU 활용의 중요성</h3><p>온디바이스 AI가 중요한 이유는 명확합니다. 클라우드에 의존하지 않으면 비용, 지연(latency), 프라이버시, 오프라인 동작 측면에서 근본적인 이점이 생기기 때문인데요. 문제는 온디바이스 환경이 메모리와 전력이라는 엄격한 제약 아래 있다는 점입니다.</p><p>그리고 이러한 제약 조건을 극복하기 위해 등장한 것이 NPU(Neural Processing Unit)입니다. AI 추론에 특화된 형태로 설계된 NPU는 메모리와 전력 효율, 그리고 속도 측면에서 뛰어난 성능을 내는 것이 가능하므로, 온디바이스에서 대규모 언어 모델을 제대로 돌리려면 결국 NPU 활용이 중요해집니다.</p><p>다만 NPU SDK에서 지원하는 연산 및 레이어가 제한적이기 때문에 NPU별로 구동할 수 있는 모델의 폭이 크게 제한되는데요. 특히 BitNet과 같은 새로운 구조의 모델들은 NPU사의 지원 범위에서 완전히 벗어나 있기 때문에 배포의 난이도가 매우 높고, 성공하더라도 성능을 기대하기 어려운 것이 일반적입니다. 자세한 내용은 아래 게시물을 참고해주세요.</p><p><a href="https://medium.com/@enerzai/running-bitnet-on-qualcomm-hexagon-with-custom-1-58-kernels-51424c602068">Qualcomm Hexagon에서 1.58-bit 커널로 BitNet 구동하기</a></p><p>지난번 글이 “NPU에서 지원하지 않는 모델을 구동했다”는 이야기였다면, 이번 글은 보다 빠르고 효율적으로 구동되는 모델을 구현하기 위해 어떤 기술을 적용하였는지에 대해 좀 더 집중해보았습니다.</p><h3>LLM 추론에서 메모리가 병목이 되는 이유</h3><p>언어 모델이 답을 만들어내는 과정은 크게 두 단계로 나뉘는데요. 첫 번째는 사용자가 입력한 질문을 읽고 이해하는 prefill 단계로, 여러 토큰을 동시에 처리하기 때문에 연산 능력이 중요한 compute-bound한 작업입니다. 두 번째는 이해한 바를 토대로 답변을 생성하는 generation 단계로, 일반적으로 사용자가 실제로 체감하는 “생성 속도”는 바로 이 구간에서 결정됩니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OFlOVL-xNUkhjvKF" /><figcaption>출처: 삼성전자 테크 블로그</figcaption></figure><p>그 이유는 generation 단계에서 답변을 생성할 때, <strong>토큰 하나를 만들 때마다 모델의 모든 가중치(weight)를 메모리에서 불러와야 하기 때문입니다.</strong> 그래서 generation은 계산을 얼마나 빨리 하느냐(흔히 TOPS로 표현되는 연산 성능)가 아니라, 데이터를 메모리에서 얼마나 빨리 꺼내오느냐(DRAM 대역폭)가 중요한 memory-bound한 작업이라고 볼 수 있습니다. 아무리 <strong>연산 성능이 우수한 칩을 쓰더라도 대역폭이 그대로라면 속도 향상을 기대하기 어려운 것이죠.</strong></p><p>예를 들어 메모리 대역폭이 20GB/s이고 모델이 필요로 하는 메모리가 1GB라면, 이론상 달성할 수 있는 최대 속도는 20 tok/s입니다. 다만, 실제 배포 환경에서는 하드웨어 대역폭을 100% 활용하는 것이 불가능에 가깝고, 대화가 길어질수록 함께 커지는 KV 캐시(모델이 앞선 맥락을 기억하기 위해 저장해두는 일종의 단기 기억 노트)도 메모리를 차지하기 때문에 모델을 보다 가볍고 효율적으로 설계하는 역량이 중요합니다.</p><h3>모델 경량화 및 커널 최적화를 통한 추론 성능 극대화</h3><p>위의 식을 다시 보면, 생성 속도를 높이는 길은 두 갈래뿐입니다. <strong>분모(토큰당 읽는 데이터)를 줄이거나, 분자(활용 가능한 대역폭)를 키우거나.</strong> 저희는 이 둘을 동시에 공략했습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEkc_rdJ2lwSPCdoNZky3Q.png" /></figure><p><strong>첫째, 1.58-bit 양자화로 분모를 줄입니다.</strong> 원래 16비트나 32비트 소수로 표현되던 가중치를 −1, 0, +1 세 가지 값으로만 표현하면(그래서 ternary, 삼진입니다. 세 상태를 표현하는 데 이론적으로 필요한 최소 비트가 log₂(3) ≈ 1.58입니다), 모델이 극단적으로 가벼워집니다. 매 토큰마다 메모리에서 읽어와야 할 데이터가 그만큼 줄어드니, <strong>같은 대역폭으로도 훨씬 빠른 생성이 가능해집니다.</strong> 다시 말해, LLM에서 양자화를 통한 모델 경량화는 모델 크기를 줄인다는 점에서도 의미가 있지만, 동시에 추론 속도에 악영향을 줄 수 있는 메모리 병목을 해결하기 위한 수단이기도 합니다.</p><p><strong>둘째, 자체 NPU 커널로 분자를 최대한 끌어올립니다.</strong> 하드웨어의 메모리 대역폭 스펙은 이론적으로 도달할 수 있는 상한선일 뿐입니다. 실제로 어디까지 활용할 수 있느냐는 전적으로, 메모리에서 데이터를 어떻게 꺼내 쓰느냐를 정의하는 커널에 달려 있는데요. 이번 데모에서 저희는 QCS6490의 스펙시트상 대역폭인 <strong>25.6 GB/s 대비 약 22 GB/s, 즉 약 86%를 실제로 활용</strong>했습니다.</p><p>여기서 강조하고 싶은 것은, <strong>이 둘 중 하나만으로는 이 결과에 도달할 수 없다</strong>는 점입니다. 압축이 분모를 낮추고 커널이 분자를 채워, 두 가지가 맞물릴 때 비로소 저사양 IoT 칩에서도 대화가 되는 속도가 나옵니다. 이번 데모를 “1.58-bit 압축과 NPU 커널 최적화가 함께 맞아야 가능한 결과”라고 말하는 이유가 바로 여기에 있습니다.</p><h3>Key Implications</h3><p>숫자 하나만 놓고 보면 32 tok/s는 평범해 보일 수 있습니다. 하지만 그 숫자가 <strong>어떤 하드웨어에서 나왔는지</strong>를 함께 보면 이야기가 달라집니다.</p><p>아래는 이번 데모 (Opti 1.7B on QCS6490) 결과와 Qualcomm AI Hub에 있는 Llama 3.2 1B (INT4) 벤치마크들을 비교한 표입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Oe6j1taD4tKe183TzydoQ.png" /></figure><p>대표적으로, AI PC를 위해 설계된 Snapdragon X Elite 벤치마크를 보면, X Elite가 QCS6490 대비 TOPS는 약 4배, 메모리 대역폭은 약 5배 높은 고사양 SoC인데도 불구하고, 더 낮은 속도 (24tok/s)를 기록한 것을 확인하실 수 있습니다. 심지어 Llama 3.2 1B가 Opti 1.7B보다 <strong>더 작은 모델</strong>인데도요. 수천만원 상당의 차량용 SoC인 SA8255P나 플래그십 스마트폰에 주로 탑재되는 Snapdragon 8 Elite에서 측정한 속도도 이번 데모 결과와 비슷한 수준인 것을 확인하실 수 있습니다.</p><p>위 결과를 통해 알 수 있는 것은 두 가지입니다. 같은 모델이라면 <strong>더 저렴하고 낮은 사양의 하드웨어에서</strong> 구동할 수 있고, <strong>같은 하드웨어라면 더 크고 좋은 모델을 올릴 수 있다는 것.</strong> 간단하지만, 온디바이스 환경에서 단순 명령 제어가 아닌 Agentic AI를 실현하기 위해 필수적인 역량입니다.</p><h3>앞으로의 방향</h3><p>에너자이는 여전히 Smallest possible agentic AI for Edge를 목표로, 1.58-bit 양자화로 대표되는 모델 경량화 기술과 자체 개발한 AI 컴파일러 Optimium 기반의 커널 최적화 기술을 고도화하고 있습니다. 이번 데모는 반도체사 SDK (QNN)에 의존하지 않고 자체적으로 NPU 커널을 구현하여 저사양 칩셋에서도 우수한 성능으로 LLM을 구동했다는데 의미가 있습니다.</p><p>Qualcomm 플랫폼에서의 온디바이스 LLM 구동을 고민하고 계시거나, 에너자이의 초경량 LLM에 대해 더 궁금하신 점이 있다면, 언제든 연락 주세요!</p><p><a href="https://enerzai.com/ko/contact">ENERZAi — Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e70aeaba190" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In-cabin Voice Agent at the Edge: Redefining the Drive]]></title>
            <link>https://medium.com/@enerzai/on-device-voice-ai-agent-for-automotive-reinventing-the-driving-experience-ed3c839719c5?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3c839719c5</guid>
            <category><![CDATA[in-car-infotainment]]></category>
            <category><![CDATA[local-llm]]></category>
            <category><![CDATA[automotive-industry]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[edge-ai]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 06:47:29 GMT</pubDate>
            <atom:updated>2026-06-30T08:20:57.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Hyundai Motor Group recently introduced Gleo AI — a conversational voice AI agent — in the all-new Grandeur, marking the first time such a system has appeared in one of their production vehicles. Unlike traditional voice recognition, which only responds to fixed commands, Gleo AI understands context, driving conditions, and even where in the cabin the speaker is located. It’s a clear signal: as vehicles shift toward the Software-Defined Vehicle (SDV) paradigm, the primary interface between driver and car is moving away from buttons and screens, and toward voice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_GVtKmQy9HUmyogz.png" /><figcaption>Source: Hyundai Motor Group</figcaption></figure><p>But behind this smart voice assistant sits a more fundamental question: where does all the computation actually happen? Interestingly, major OEMs including Mercedes-Benz are moving in the same direction: <strong>reducing cloud dependency and running AI directly inside the vehicle</strong>. Why would they turn to on-device when the cloud is so powerful?</p><p>In this post, we’ll explore how voice AI is being deployed in automotive, one of the most active frontiers for on-device AI research, why OEMs are making this shift, and how ENERZAi’s <strong>ultra-lightweight voice and language AI</strong> can address the real challenges facing automotive OEMs and digital cockpit manufacturers.</p><h3>TL;DR</h3><ul><li>As vehicles transition to Software-Defined Vehicles (SDVs), the digital cockpit has become the primary battleground. And at the center of it all is the <strong>voice AI interface</strong> connecting drivers to their cars. The market for AI-powered automotive cockpits and assistants is projected to grow from approximately $7.1B in 2025 at a CAGR of 22.2% through 2035.</li><li>Automotive voice AI is evolving beyond navigation, climate control, and infotainment — into a true <strong>AI assistant</strong> that understands natural language and interprets driver intent.</li><li>However, most in-vehicle voice AI today is cloud-based, which comes with fundamental limitations in automotive contexts: <strong>failure in dead zones (tunnels, underground garages, rural roads), latency that undermines the driving experience, mounting per-vehicle operational costs, and privacy concerns around in-cabin voice data</strong>.</li><li>Leading OEMs like Mercedes-Benz and Hyundai Motor Group are actively working to reduce cloud dependency and <strong>increase the share of AI processing handled on-device</strong>. But delivering stable, high-quality performance under the memory and compute constraints of in-vehicle hardware remains a serious engineering challenge.</li><li>ENERZAi aims to accelerate on-device AI innovation in the automotive industry through ultra-lightweight voice AI agents purpose-built for the in-vehicle environment, powered by our differentiated AI compression and optimization technology.</li></ul><h3>AI@Car</h3><blockquote>“Take me the fastest route.” “Drop the temperature by 2 degrees.” “I’m getting sleepy — find me the nearest rest stop.”</blockquote><p>Talking to your car without ever taking your hands off the wheel is quickly becoming the norm. Traditionally, in-vehicle voice features could only recognize <strong>fixed commands</strong> such as “start navigation,” “play music.” But today’s automotive voice AI has evolved to support natural conversation, powered by advances in natural language processing (NLP).</p><p>Driving this shift is the broader transition to <strong>Software-Defined Vehicles (SDVs)</strong>. As vehicle functionality moves from hardware to software, the real competitive arena for OEMs has become the <strong>digital cockpit</strong>. And at the heart of that cockpit experience is the <strong>voice assistant</strong>: the most natural interface between driver and vehicle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*Vi9QJNIXiEb78A4z.png" /><figcaption>Source: HARMAN</figcaption></figure><p>The market reflects this momentum. The AI-powered automotive cockpit and assistant market is estimated at around $7.1B in 2025, with projected CAGR of 22.2% from 2026 through 2035 — driven by growing consumer demand for hands-free interaction and personalization, alongside regulatory pressure to improve road safety.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qc9Jp31jy9RiFwox.png" /><figcaption>Source: Global Market Insights</figcaption></figure><h3>Key Use Cases</h3><p>Automotive voice AI started with simple command control, but it’s rapidly expanding into a unified interface that spans the entire vehicle. Here are the main application areas:</p><p><strong>① Climate Control &amp; Vehicle Settings</strong></p><ul><li>“Direct airflow to my feet,” “Cool down just the rear seats” → zone- and seat-level climate control</li><li>Hands-free control of seat heating/ventilation, windows, sunroof, and ambient lighting</li><li>“It feels stuffy in here” → automatic activation of ventilation or air purification mode</li></ul><p><strong>② Navigation &amp; Route Guidance</strong></p><ul><li>“If the commute is heavy, reroute me” → real-time traffic-aware route recalculation</li><li>“Stop by a charging station on the way” → automatic waypoint insertion</li><li>Voice search for parking and points of interest near the destination</li></ul><p><strong>③ Vehicle Status &amp; Management</strong></p><ul><li>“How much range do I have left?” → voice readout of fuel/battery and vehicle health</li><li>Maintenance reminders and warning light explanations</li></ul><p><strong>④ Infotainment (IVI) &amp; Content Recommendations</strong></p><ul><li>“Play something mellow,” “Resume the podcast I was listening to yesterday” → context- and history-aware playback</li><li>Unified voice control and media search across music, radio, and audiobooks</li></ul><p>More recently, the field is moving beyond voice-only interaction toward <strong>multimodal</strong> interfaces (voice + gesture + gaze), <strong>emotion recognition</strong> that reads driver tone and biometric signals, and full integration of LLM-based conversational assistants into the vehicle.</p><h3>Why On-device?</h3><p>Most voice AI features in today’s vehicles run on <strong>cloud infrastructure</strong>. Voice data captured by the car’s microphone is sent to a remote server, processed, and the result is sent back to the vehicle. The cloud offers virtually unlimited compute — but in the context of a car, it runs into some fundamental walls.</p><p><strong>1. Dead zones: when the connection drops, so does the assistant</strong></p><p>In tunnels, underground parking structures, mountain roads, and rural stretches, cloud-based voice AI simply stops working. But these are exactly the kinds of environments a car passes through constantly. A voice assistant that only works when you have connectivity is fundamentally mismatched with how cars are actually used.</p><p><strong>2. Latency that breaks the experience</strong></p><p>Sending voice data to a server and waiting for a response introduces latency. Research suggests that users perceive responses within about 1.5 seconds as natural, and anything beyond 5 seconds as a significant problem. With cloud-based AI agents, latency can vary unpredictably based on network conditions, which is a real issue.</p><p><strong>3. Per-vehicle costs that compound at scale</strong></p><p>Cloud-based AI generates ongoing API call and server instance costs. For an OEM selling vehicles in the millions, this becomes a <strong>recurring per-vehicle cost that accumulates month after month</strong>. To give a rough sense of scale, let’s look at STT alone, just the first stage of a voice AI agent pipeline.</p><p>Typical STT API pricing from providers like OpenAI and Google runs around $0.006 per minute. As an example, imagine deploying this across the Hyundai Genesis brand, which sold approximately 120,000 units in Korea in 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ohvcsq8UpFrnvnJi.png" /></figure><p>Even assuming just 2 minutes of daily voice recognition usage, that’s roughly $4.4 per vehicle per year, or $525K annually across 120,000 vehicles. And that’s just STT. Add LLM costs for understanding and generating responses, plus TTS for converting those responses back to speech, and the numbers grow substantially — compounding further as the cumulative fleet grows year over year.</p><p><strong>4. Privacy concerns around in-cabin voice data</strong></p><p>Conversations inside a vehicle are deeply personal. Transmitting and storing that data on external servers raises legitimate privacy concerns for drivers and creates compliance burdens around data regulation. On-device processing, where <strong>data never leaves the vehicle, </strong>is the most direct answer to this problem.</p><p>Given how clear the advantages of on-device voice AI are, leading players are already moving in this direction — either through internal development or partnerships with specialized voice AI companies. Mercedes-Benz is working with Liquid AI to embed a voice AI agent capable of handling speech recognition and natural language processing entirely on-board, integrated into their proprietary MB.OS operating system (targeting H2 2026 production). Premium EV brand Lucid is partnering with SoundHound AI to develop a conversational AI agent that functions even offline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*bGM4Ed0SLEssUaSV.png" /><figcaption>Source: Mercedes-Benz</figcaption></figure><h3>ENERZAi in Automotive</h3><p>Automotive application processors (APs) used in digital cockpits typically include both a GPU and NPU, and compared to consumer devices or wearables, they offer relatively generous memory and compute resources. Even so, running a full voice AI agent that supports natural, multi-turn conversation entirely on-device is a genuinely hard problem since more sophisticated speech recognition and language models demand proportionally more memory and compute.</p><h4>Our Goal</h4><p>ENERZAi’s vision goes beyond a voice assistant that simply executes commands. Ultimately, we’re building toward agentic AI , systems that don’t just recognize what a driver says, but understand the context, sustain multi-turn conversations, and autonomously decide which functions to invoke based on the situation. We’re especially focused on delivering this level of capability within the constrained memory and compute budgets of on-device automotive environments.</p><h4>Ultra-Lightweight Voice and Language Models Optimized for the Target Domain</h4><p>A great AI agent is only as good as the components that make it up. ENERZAi develops every module in the pipeline in-house, from Keyword Spotting (KWS) and Voice Activity Detection (VAD) to Speech-to-Text (STT), small Language Models (sLM), and Text-to-Speech (TTS). Since we design and train each module ourselves, we can tune the entire pipeline to fit both the automotive environment and each customer’s specific requirements.</p><p>And these models are purpose-built for on-device deployment, which means that we aim to maximize their performance within the target domain. Covering every possible topic would be nice. But what matters more is that the system works more accurately and faster on utterances within the target domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QpFtbUgJhvt0zwny.png" /><figcaption><em>Source: Mihup</em></figcaption></figure><h4>Hardware-Aware Optimization</h4><p>The key to on-device AI is squeezing the best possible performance out of the available hardware, achieving high accuracy with minimum memory and power. ENERZAi compresses AI models to extremely low bit and transforms the underlying operations into forms that run optimally on the target hardware, delivering ultra-lightweight voice and language AI solutions tuned to each customer’s device environment. For operations not supported by semiconductor vendor SDKs, we build custom kernels (low-level execution code that defines how the hardware actually performs each computation), maximizing inference performance on whatever hardware the customer is running.</p><p>Until now, our primary deployment target has been Arm CPU-based SoCs, where we hold a strong advantage in terms of broad compatibility. Starting this year, however, we are progressively expanding support to GPUs and NPUs. We’ve already demonstrated this: by building custom kernels for operations unsupported by Qualcomm’s QNN, we successfully ran a 2B LLM on the Qualcomm Hexagon NPU (in the QCS6490). In other words, we now have the capability to efficiently leverage the full range of embedded CPU, GPU, and NPU resources found in automotive AP modules.</p><p><a href="https://medium.com/@enerzai/running-bitnet-on-qualcomm-hexagon-with-custom-1-58-kernels-51424c602068">Running BitNet on Qualcomm Hexagon with custom 1.58 kernels</a></p><p>The voice control solutions we currently supply to customers span a full pipeline (keyword spotting, speech recognition, command execution, and speech synthesis) across multiple models. <strong>Yet the total RAM footprint stays under 500MB</strong>. That kind of memory efficiency means more headroom for other features, or the flexibility to run larger models on the same hardware.</p><h3>On-Device AI in Automotive Is Inevitable</h3><p>A car is no longer just a vehicle. It’s increasingly a computing platform running complex software across dozens of processors. And at the center of the user experience revolution sits the AI agent. Cloud-based AI can deliver strong performance, but when you factor in operational costs, network reliability, and data privacy, the move to on-device AI is not a question of if, but when.</p><p>Making that shift real, building AI agents capable of transforming the driving experience without depending on external infrastructure, requires AI compression and optimization technology capable of overcoming the memory bottlenecks of on-device environments. ENERZAi is committed to accelerating on-device AI adoption across the automotive industry with ultra-lightweight AI agents built specifically for the in-vehicle environment.</p><p>If you’re a vehicle OEM, digital cockpit manufacturer, or Tier 1 supplier exploring voice AI for edge, or if you’d simply like to learn more about ENERZAi’s technology and solutions, feel free to reach out through our website anytime!</p><p><a href="https://enerzai.com/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed3c839719c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[차량용 온디바이스 음성 AI 에이전트, 운전 경험을 혁신하다]]></title>
            <link>https://medium.com/@enerzai/%EC%B0%A8%EB%9F%89%EC%9A%A9-%EC%98%A8%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4-%EC%9D%8C%EC%84%B1-ai-%EC%97%90%EC%9D%B4%EC%A0%84%ED%8A%B8-%EC%9A%B4%EC%A0%84-%EA%B2%BD%ED%97%98%EC%9D%84-%ED%98%81%EC%8B%A0%ED%95%98%EB%8B%A4-46dbe5b12aae?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/46dbe5b12aae</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[automotive-industry]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[in-car-infotainment]]></category>
            <category><![CDATA[local-llm]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 06:06:25 GMT</pubDate>
            <atom:updated>2026-06-30T08:12:46.138Z</atom:updated>
            <content:encoded><![CDATA[<p>최근 현대차그룹은 신형 ‘더 뉴 그랜저’에 사람처럼 자연스럽게 대화하는 차량용 음성 AI 에이전트 ‘글레오 AI(Gleo AI)’를 처음으로 탑재했습니다. 정해진 명령어만 알아듣던 기존 음성 인식과 달리, 글레오 AI는 대화의 맥락과 주행 상황, 발화자의 위치까지 파악해 운전자의 의도를 이해하는데요. 자동차가 ‘소프트웨어 정의 차량(Software Defined Vehicle)’으로 전환되면서, 운전자가 차와 만나는 첫 접점이 버튼과 화면에서 ‘목소리’로 빠르게 옮겨가고 있다는 신호입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vh-cBATDu9669l33aFGzZQ.png" /><figcaption>출처: 현대자동차그룹</figcaption></figure><p>그런데 이 똑똑한 음성 비서를 둘러싼 더 근본적인 질문이 하나 있습니다. 그 연산을 대체 ‘어디서’ 처리할 것인가입니다. 흥미롭게도 메르세데스-벤츠를 비롯한 주요 OEM들은 약속이라도 한 듯 <strong>클라우드 의존을 줄이고 차량 안에서 직접 AI를 구동하는 방향</strong>으로 움직이고 있는데요. 왜 이들은 강력한 클라우드를 두고 ‘온디바이스’로 향하는 걸까요?</p><p>이번 글에서는 온디바이스 AI 연구가 가장 활발히 이루어지고 있는 또 다른 무대인 ‘자동차’에서 음성 AI가 어떻게 활용되고 있는지, 위 질문처럼 왜 OEM들이 온디바이스로 향하는지, 그리고 <strong>초경량 음성·언어 AI</strong>를 만드는 저희 에너자이의 기술이 차량 OEM과 디지털 콕핏 제조사들의 어떤 고민을 해결할 수 있는지 이야기해보고자 합니다.</p><h3>요약</h3><ul><li>자동차는 ‘소프트웨어 정의 차량(SDV)’으로 전환되며 디지털 콕핏이 브랜드 차별화의 격전지가 되었고, 그 중심에는 운전자와 차량을 잇는 <strong>음성 AI 인터페이스</strong>가 자리잡고 있습니다. AI 기반 차량 콕핏·어시스턴트 시장은 2025년 약 71억 달러에서 2026~2035년 연평균 22.2% 성장이 전망됩니다.</li><li>차량용 음성 AI는 내비게이션·공조·인포테인먼트 제어를 넘어, 자연어로 대화하고 운전자의 의도를 파악하는 ‘AI 비서’로 진화하고 있습니다.</li><li>그러나 현재 대부분의 차량용 음성 AI는 클라우드 기반으로 구현되어 <strong>통신 음영 지역(터널·지하·외곽)에서의 동작 불가, 주행 중 치명적인 지연 시간, 차량 1대당 누적되는 운영 비용, 차내 음성 데이터의 프라이버시 우려</strong>라는 한계를 안고 있습니다.</li><li>메르세데스-벤츠, 현대차그룹 등 주요 OEM들은 클라우드 의존을 줄이고 차량 내에서 <strong>온디바이스로 구동될 수 있는 기능의 비중을 높이기 위</strong>해 노력하고 있지만, 메모리·연산 자원이 제약된 온디바이스 환경에서 안정적인 성능을 내는 것은 매우 어려운 과제입니다.</li><li>에너자이는 차별화된 AI 경량화 및 최적화 기술을 기반으로 차량 내부 환경에 특화된 초경량 음성 AI 에이전트를 구현하여 자동차 산업 내 AI 혁신을 가속화하고자 합니다</li></ul><h3>AI@Car</h3><blockquote><em>“가장 빠른 길로 안내해줘.” “온도 2도만 낮춰줘.” “졸린데 가까운 휴게소 알려줘.”</em></blockquote><p>운전대에서 손을 떼지 않고 목소리만으로 차량과 대화하는 모습은 이제 일상이 되어 가고 있습니다. 전통적으로 차량의 음성 기능은 “내비게이션 켜줘”, “음악 재생”처럼 <strong>정해진 명령어</strong>만 인식하는 수준이었는데요. 하지만 오늘날의 차량 음성 AI는 자연어 처리(NLP) 기술을 기반으로, 일상적인 대화 방식으로 차량과 소통할 수 있는 단계로 진화하고 있습니다.</p><p>이러한 변화의 배경에는 <strong>소프트웨어 정의 차량(Software-Defined Vehicle, SDV)</strong>으로의 전환이 있습니다. 차량의 기능이 하드웨어가 아닌 소프트웨어로 정의되고 무선(OTA)으로 업데이트되는 시대가 본격화되면서, OEM들의 진짜 경쟁은 ‘디지털 콕핏(Digital Cockpit)’에서 벌어지고 있습니다. 그리고 그 콕핏 경험의 중심에는 운전자와 차량을 가장 자연스럽게 연결하는 <strong>음성 어시스턴트</strong>가 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*hGN_vrnsfzrgkTEJKDGrPg.png" /><figcaption>출처: HARMAN</figcaption></figure><p>시장도 이러한 흐름을 뒷받침합니다. AI 기반 차량 콕핏·어시스턴트 시장은 2025년 약 71억 달러 규모로 추정되며, 2026년부터 2035년까지 연평균 22.2%의 높은 성장률이 전망되고 있는데요. 핸즈프리 조작과 개인화에 대한 소비자 수요, 그리고 운전 안전성 강화라는 규제 흐름이 이 성장을 함께 견인하고 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKyCfaRFAGzHIJIYHBFIcQ.png" /><figcaption>출처: Global Market Insights</figcaption></figure><h3>주요 적용 사례</h3><p>차량 음성 AI는 단순 명령 제어에서 시작해, 점차 차량 전반을 아우르는 통합 인터페이스로 확장되고 있습니다. 대표적인 활용 영역을 정리하면 다음과 같습니다.</p><p><strong>① 공조 및 차량 설정 제어</strong></p><ul><li>“발쪽으로 바람 보내줘”, “2열만 시원하게” → 방향·좌석별 공조 제어</li><li>시트 열선·통풍, 윈도우, 선루프, 무드등의 핸즈프리 설정</li><li>“공기 좀 탁한데” → 환기·공기청정 모드 자동 실행</li></ul><p><strong>② 내비게이션 및 경로 안내</strong></p><ul><li>“퇴근길 막히면 우회로로 안내해줘” → 실시간 교통 반영 경로 재탐색</li><li>“가는 길에 충전소 들렀다 가자” → 경로상 경유지 자동 추가</li><li>목적지 주변 주차장·관심지점(POI) 음성 검색</li></ul><p><strong>③ 차량 상태 확인 및 관리</strong></p><ul><li>“주행 가능 거리 얼마나 남았어?” → 연료·배터리 등 차량 상태 음성 안내</li><li>정비 시점 알림, 경고등 의미 안내</li></ul><p>④ <strong>인포테인먼트(IVI) 및 콘텐츠 추천</strong></p><ul><li>“잔잔한 음악 틀어줘”, “어제 듣던 팟캐스트 이어서 들려줘” → 상황·이력 기반 재생</li><li>음악·라디오·오디오북 통합 음성 제어 및 미디어 검색</li></ul><p>최근에는 단순 명령 제어를 넘어 <strong>멀티모달(음성+제스처+시선)</strong> 인터페이스, 운전자의 목소리 톤과 생체 신호로 상태를 파악하는 <strong>감정 인식</strong>, 그리고 대형 언어 모델(LLM) 기반의 대화형 비서까지 차량에 통합되는 사례가 늘고 있습니다.</p><h3>Why On-device?</h3><p>현재 차량에 탑재된 대부분의 음성 AI 기능은 <strong>클라우드 기반</strong>으로 구현되어 있습니다. 차량 마이크로 들어온 음성 데이터를 클라우드 서버로 전송해 AI 연산을 수행하고, 그 결과를 다시 차량으로 보내 사용자에게 전달하는 구조인데요. 클라우드는 방대한 컴퓨팅 자원을 활용할 수 있다는 장점이 있지만, <strong>자동차라는 환경에서는</strong> 다음과 같은 본질적인 한계에 부딪힙니다.</p><p><strong>1. 통신 음영 지역에서의 동작 불가</strong></p><p>터널, 지하 주차장, 산간·외곽 도로 등 통신이 끊기는 구간에서는 클라우드 기반 음성 AI가 제대로 동작하지 않습니다. 그러나 차량은 바로 이런 환경을 끊임없이 지나다니는 디바이스입니다. “인터넷이 연결되어야만 쓸 수 있는 음성 비서”는 차량의 사용 맥락과 근본적으로 맞지 않습니다.</p><p><strong>2. 사용자 경험을 저해하는 지연 시간</strong></p><p>음성 데이터를 서버로 보내 처리하고 결과를 받아오는 클라우드 방식에서는 그 과정에서 지연(latency)이 발생합니다. 연구에 따르면 음성 AI 사용자가 자연스럽다고 판단하는 응답 시간(natural delay)은 1.5초 정도이고, 5초 이상이 소요될 경우 심각한 문제로 인식한다고 하는데요. 클라우드 기반 AI 에이전트의 경우 통신 상태에 따라 지연 시간이 불규칙하게 변화할 수 있다는 것이 아쉬운 점입니다.</p><p><strong>3. 차량 1대당 누적되는 운영 비용</strong><br>클라우드 기반 AI는 API 호출 비용과 서버 인스턴스 비용이 지속적으로 발생합니다. 수백만 대 규모로 차량을 판매하는 OEM에게 이는 <strong>차량 1대당, 매월 누적되는 운영 비용</strong>으로 이어집니다. 음성 AI 에이전트 파이프라인의 시작 단계에 해당하는 STT에 한정하여 대략적인 비용 규모를 추산해보겠습니다.</p><p>오픈AI나 구글에서 제공하는 대표적인 STT API 가격은 분당 $0.006 수준인데요. 간단한 예로 2025년 기준 국내에서 12만 대가 판매된 현대자동차 제네시스 브랜드 적용을 가정해보겠습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tP9gamDT4ZQkMzW9tCSJA.png" /></figure><p>하루에 음성 인식 기능을 2분 정도만 사용한다고 가정해도 대당 연간 $4.4의 비용이 발생하며, 12만대 기준으로는 연간 $525K (약 8억 원) 상당의 비용이 지속적으로 발생하게 됩니다. 심지어 실제로는 STT로 변환된 텍스트를 이해하여 답변을 생성하는 LLM과 생성된 답변을 음성으로 바꿔주는 TTS에 대한 API 비용까지 발생하며, 누적 판매대수가 쌓일수록 비용은 매년 불어납니다.</p><p><strong>4. 차내 음성 데이터의 프라이버시 우려</strong><br>차량 안에서 오가는 대화는 매우 사적인 데이터입니다. 이를 외부 서버로 전송·저장하는 구조는 운전자의 프라이버시 우려와 데이터 규제 대응 부담을 키웁니다. 데이터가 <strong>차량을 떠나지 않는</strong> 온디바이스 처리는 이 문제에 대한 가장 근본적인 해법입니다.</p><p>위에서 보신 바와 같이 차량용 음성 AI 에이전트가 온디바이스로 구현되었을 때 이점이 너무나도 명확하기 때문에 이미 대부분의 선도 기업들은 자체적으로, 또는 외부 음성 AI 기업과의 협업을 통해 관련 연구를 진행하고 있는데요. 메르세데스 벤츠는 Liquid AI와 협력해 음성 인식 및 자언어 처리 과정을 차량 내에서 처리할 수 있는 음성 AI 에이전트를 자체 운영체제 MB.OS에 탑재하기로 했고(2026년 하반기 양산 목표), 프리미엄 전기차 브랜드 루시드 또한 Soundhound AI와 협력하여 오프라인 환경에서도 구동 가능한 대화형 AI 에이전트를 개발하고 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*3ZF21tedasAlPe_dot69BQ.png" /><figcaption>출처: 메르세데스 벤츠</figcaption></figure><h3>ENERZAi in Automotive</h3><p>디지털 콕핏에 활용되는 차량용 AP(애플리케이션 프로세서) 모듈의 경우 일반적으로 GPU와 NPU가 탑재되어 있고, 가전 제품이나 웨어러블 같은 디바이스들에 비해서는 메모리/연산 자원이 풍부한 편입니다. 그럼에도 자연스러운 대화까지 지원하는 음성 AI 에이전트를 차량 안에서 온전히 구동하는 일은 여전히 만만치 않은데요. 고도화된 음성 인식 및 언어 모델이 필요한 만큼 더 많은 메모리 및 연산 자원을 필요로 하기 때문입니다.</p><h4>Our Goal</h4><p>에너자이가 그리는 그림은 단순히 주어진 명령을 수행하는 음성 비서를 넘어섭니다. 궁극적으로는 운전자의 발화를 단순 인식하는 데 그치지 않고 맥락을 이해하고, 여러 단계에 걸치는(multi-turn) 대화를 이어가며, 상황에 맞는 기능을 스스로 판단해 호출하는 <strong>에이전틱(Agentic) AI를</strong> 지향하고 있는데요. 특히 메모리/연산 자원이 제약된 온디바이스 환경에서도 최적의 성능을 구현하기 위한 연구에 집중하고 있습니다.</p><h4>Target Domain에 최적화된 초경량 음성/언어 모델</h4><p>완성도 높은 에이전트형 AI는 결국 좋은 ‘부품’에서 나옵니다. 에너자이는 호출어 인식(KWS), 음성 활동 감지(VAD), 음성인식(STT), 언어모델(sLM), 음성 합성(TTS)까지 파이프라인을 구성하는 음성·언어 모델을 <strong>직접 개발</strong>하는데요. 각 모듈을 자체적으로 설계·학습하기 때문에, 차량이라는 환경과 고객사의 요구에 맞춰 파이프라인 전체를 유연하게 조율할 수 있습니다.</p><p>특히 이 모델들은 온디바이스에 맞춘 초경량 모델인 만큼, 모든 주제를 두루 잘하는 범용성보다 <strong>타겟 도메인에서의 성능을 극대화</strong>하는 방향으로 고도화합니다. 무엇이든 이해하면 좋겠지만, 차량에서는 “온도 2도 낮춰줘”, “가까운 충전소로 안내해줘” 같은 발화를 더 정확하고 빠르게 인식해 <strong>올바른 동작까지 정확히 수행</strong>하도록 만드는 편이 훨씬 효과적이기 때문입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5hNPsY-XGobf9WjMtgexg.png" /><figcaption>출처: Mihup</figcaption></figure><h4>Hardware-aware 최적화</h4><p>온디바이스 AI의 관건은 주어진 하드웨어 자원을 최대한 효율적으로 활용하여 최소한의 메모리/전력으로 높은 정확도를 구현하는 것입니다. 에너자이는 매우 낮은 비트로 AI 모델을 압축한 다음, 모델을 구성하는 연산들을 대상 하드웨어에서 최적의 성능을 낼 수 있는 형태로 변환하여 고객사 디바이스 환경에 최적화된 초경량 음성/언어 AI 솔루션을 제공하고 있는데요. 특히 반도체사 SDK가 지원하지 않는 연산들에 대해서도 <strong>커스텀 커널</strong> (하드웨어가 연산을 실제로 수행하는 방식을 정의한 low-level 실행 코드)을 직접 구축하여 대상 하드웨어 환경에서의 추론 성능을 극대화하는 것이 가능합니다.</p><p>그 동안에는 주로 범용성 측면에서 강점을 지닌 <strong>Arm CPU 기반 SoC에 AI 솔루션을 배포해왔지만</strong>, 올해부터는 그 지원 범위를 <strong>GPU와 NPU로 점진적으로 확장</strong>하고 있는데요. 실제로 퀄컴 QNN이 지원하지 않는 연산들에 대한 커널들을 직접 구축하여 2B LLM을 퀄컴 Hexagon NPU (in QCS6490)에서 구동하는데 성공하기도 했습니다. 다르게 말하면, 차량용 AP 모듈에 탑재되는 임베디드 CPU, GPU, NPU 자원을 가장 효율적으로 활용하기 위해 필요한 역량을 갖춘 것이죠.</p><p><a href="https://medium.com/@enerzai/qualcomm-hexagon%EC%97%90%EC%84%9C-1-58-bit-%EC%BB%A4%EB%84%90%EB%A1%9C-bitnet-%EA%B5%AC%EB%8F%99%ED%95%98%EA%B8%B0-a836f58442ec">Qualcomm Hexagon에서 1.58-bit 커널로 BitNet 구동하기</a></p><p>실제로 저희가 고객사에 납품하고 있는 음성 제어 솔루션의 경우 호출어 인식부터 음성 인식, 명령 제어 및 음성 합성까지 여러 모델로 구성된 파이프라인이지만, RAM 사용량은 <strong>500MB도 되지 않습니다</strong>. 이처럼 최소한의 메모리로 우수한 성능을 낼 수 있으므로, 남는 자원을 다른 기능들에 할당하거나 같은 하드웨어에서 더 큰 모델을 운용할 여유가 생긴다는 것이 장점입니다.</p><h3>차량에서 온디바이스 AI는 필연적 흐름입니다</h3><p>차량은 더 이상 단순한 탈 것이 아니라 수많은 연산 장치에서 구동되는 소프트웨어로 구성된 컴퓨팅 디바이스에 가깝습니다. 그리고 이러한 변화에 걸맞는 사용자 경험 혁신의 중심에는 AI 에이전트가 위치하고 있는데요. 클라우드 기반으로도 충분히 좋은 성능의 AI를 구현할 수 있지만, 운영 비용이나 네트워크 안정성, 개인 정보 보호 등의 요인들을 고려하면 온디바이스 AI의 도입은 필연적입니다.</p><p>그리고 외부 환경에 대한 의존 없이 운전 경험을 혁신할 수 있는 AI 에이전트를 구현하기 위해서는 온디바이스 환경의 메모리 병목을 극복할 수 있는 AI 경량화 및 최적화 기술이 필수적인데요. 에너자이는 차량 내부 환경에 특화된 초경량 AI 에이전트로 자동차 산업 내 온디바이스 AI 혁신을 가속화하고자 합니다.</p><p>차량 OEM, 디지털 콕핏 제조사, Tier 1 부품사로서 <strong>온디바이스 음성 AI 도입</strong>을 고민하고 계신다면, 혹은 그 외 에너자이 기술 및 솔루션에 대해 궁금하신 점이 있다면, 언제든 홈페이지를 통해 편히 연락 부탁드려요!</p><p><a href="https://enerzai.com/ko/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46dbe5b12aae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Age of Physical AI, On-Device AI Makes It Real]]></title>
            <link>https://medium.com/@enerzai/age-of-physical-ai-on-device-ai-makes-it-real-cd4484250212?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd4484250212</guid>
            <category><![CDATA[enerzai]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[ai-on-device]]></category>
            <category><![CDATA[physical-ai]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Thu, 28 May 2026 09:19:43 GMT</pubDate>
            <atom:updated>2026-05-28T09:19:43.964Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, this is ENERZAi. <strong>“Physical AI”</strong> has become one of the hottest keywords of the moment. It’s a staple of conference keynotes, and the topic visitors most often bring up at our booth. In this post, we’ll take a quick look at what Physical AI actually is and what technologies are needed to make it work.</p><h3>TL;DR</h3><ul><li>From NVIDIA’s GR00T to the humanoids from Figure and Tesla, all the way to AMRs and autonomous vehicles on factory floors and city streets, “Physical AI” is no longer a single technology. It has become an industry-wide paradigm.</li><li>Physical AI refers to AI that understands the physical world, makes the right decisions, and acts on them. Korea’s ICT R&amp;D classification framework organizes the core technologies behind Physical AI into five categories: <strong>VLA models, on-device AI, body technologies, simulation-based training environments, and the Physical AI data factory.</strong></li><li>Among these, <strong>on-device AI</strong> is the final step that runs trained policies in real time at the edge. A non-negotiable prerequisite for perceiving and acting on real-world problems as they happen.</li><li>Across the domains where Physical AI is being deployed, including autonomous vehicles, humanoids, and service/care robots, <strong>voice user interfaces</strong> are becoming the de facto standard. And for natural conversation with AI to actually work, on-device implementation is essentially mandatory across cost, data sensitivity, and real-time performance.</li><li>ENERZAi delivers voice user interfaces that run with minimal memory and power, so they perform reliably even in resource-constrained on-device environments.</li></ul><h3>What is Physical AI?</h3><p>Over the past year, “Physical AI” has been one of the most frequently mentioned keywords in the global tech industry. NVIDIA officially declared the “Physical AI era” at GTC with the announcement of GR00T, its humanoid foundation model, and the core of the humanoid commercialization race that Figure and Tesla are pushing forward also comes down to Physical AI. Add autonomous vehicles, industrial AMRs (autonomous mobile robots), and drones to the mix, and you can see why attention to “AI that physically moves and reacts”, rather than “AI trapped behind a digital screen”, is at an all-time high.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*hxx7hCwnBHG4f3Xm.png" /><figcaption><em>Tesla’s humanoid Optimus</em></figcaption></figure><p>In short, Physical AI is <strong>AI that moves and reacts in the actual physical world.</strong> Rather than staying confined to the digital domain, it perceives its environment through sensors like cameras, lidar, and microphones; makes decisions based on that information; and produces real-world outcomes through motors, actuators, and displays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*Ipfm2DE9xLx9OQqv.png" /><figcaption><em>Source: appinventiv</em></figcaption></figure><p>There are three main reasons this field has come to the forefront. First, on the model side, <strong>models capable of understanding the real world, </strong>such as VLA (Vision-Language-Action) models (which integrate vision, language, and action) are maturing rapidly. Second, on the hardware side, the widespread availability of edge NPUs and low-power SoCs is laying the foundation for <strong>on-device execution of models</strong> that once required cloud infrastructure. Third, on the industry side, <strong>automation demand across manufacturing, logistics, energy, and urban infrastructure</strong> has reached a peak, and AI sophisticated enough to actually meet that demand has finally started to emerge.</p><h3>Core Technologies</h3><p>Physical AI cannot be completed by a single model. It only comes to life when multiple layers, from brain to body to learning infrastructure, come together in a single stack. A recent report based on Korea’s ICT R&amp;D classification framework groups the core technologies of Physical AI into the following five categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*EviSHuO7TOdLF9yq.png" /><figcaption><em>Source: USAII</em></figcaption></figure><ul><li><strong>VLA (Vision-Language-Action) models</strong>: The “core brain” that integrates vision, language, and action to handle perception, judgment, and action generation. NVIDIA’s GR00T, unveiled at this year’s GTC, is a representative example.</li><li><strong>On-device AI</strong>: The “execution layer” that performs robot control at the edge through low-latency, low-power inference. It’s what allows a trained AI model to deliver strong inference performance in real device environments.</li><li><strong>Body technologies (sensors and actuators)</strong>: The “physical layer” that captures environmental information and translates policies into physical action. This spans locomotion and manipulation intelligence as well as situational awareness and judgment, which allows a robot to execute “press the button” without falling over.</li><li><strong>Simulation-based training environments</strong>: Execution environments for large-scale parallel training, dangerous-scenario training, and Sim2Real correction (techniques for minimizing the gap between simulation and reality). Digital twins and platforms like NVIDIA’s Isaac Sim fall into this category.</li><li><strong>Physical AI data factory</strong>: The “training infrastructure” that collects, stores, refines, and trains on robot behavior data. The quantity and quality of this data directly determine model performance.</li></ul><p>All five must come together for Physical AI to work. But among them, <strong>on-device AI is the key that turns the value of every other layer into something real at the edge.</strong> No matter how powerful the VLA model, no matter how refined the simulation and data factory, none of it amounts to true Physical AI if you can’t run the result on a real device in real time.</p><p>The reason is simple. When a robot is about to bump into a person, or when an autonomous vehicle suddenly encounters a pedestrian, “Hold on, let me check with the cloud” is not an acceptable answer. Beyond the difficulty of guaranteeing real-time performance, network dependency, the risk of data leakage, and the snowballing cost of APIs and cloud instances make cloud-based Physical AI essentially unviable.</p><p>For all these reasons, the rise of Physical AI is, in many ways, the rise of on-device AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*-mc7GSy4NEJoEBZU.png" /><figcaption><em>Source: </em><a href="https://medium.com/@mankayarkarasi/the-rise-of-physical-ai-790fc4b1627a"><em>https://medium.com/@mankayarkarasi/the-rise-of-physical-ai-790fc4b1627a</em></a></figcaption></figure><h3>The Rise of Voice User Interfaces</h3><p>At the center of the physical world Physical AI is meant to perceive, judge, and act in, there is almost always a human. In most situations, Physical AI works on behalf of people in a wide range of contexts: the driver behind the wheel, the worker on the factory floor, the patient in a hospital ward, the family in the living room.</p><p>So how should AI in the physical world communicate with people? In the past, the default was a mouse, a keyboard, or a touch panel. But across cars, factories, hospitals, and other environments where AI is increasingly embedded into industry and daily life, the most natural and convenient interface ultimately comes down to <strong>voice.</strong></p><p>In fact, voice user interfaces are quickly becoming the de facto standard across many of the areas where Physical AI is being actively explored.</p><ul><li><strong>Humanoids</strong>: Both Figure and Tesla, the leading humanoid developers, have built voice user interfaces into their robots, supporting not only voice-based command execution but also natural, fluid conversation. Building a conversational AI that feels truly natural is extremely difficult, yet neither company is willing to give up on voice. The reason is simple: speech is still the fastest, most comfortable way for humans to communicate.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYvEdEAX1uP4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYvEdEAX1uP4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYvEdEAX1uP4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8886656ef50164e58f3cdad105090ca3/href">https://medium.com/media/8886656ef50164e58f3cdad105090ca3/href</a></iframe><ul><li><strong>Service robots</strong>: The autonomous guidance robots deployed at Incheon International Airport hold natural voice-based conversations with passengers to recommend the optimal route, and switch to patrol mode to handle safety operations when an emergency is detected.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*xtY0y6mY4moxtqqp.png" /><figcaption><em>Source: Financial News</em></figcaption></figure><ul><li><strong>Care robots</strong>: Care robots are robots that move and talk inside the home to assist with daily life, designed to support the health, safety, and emotional well-being of seniors. Today’s care robots not only handle reminders for waking up, taking medication, or coming home safely, they also act as conversation partners, providing companionship and emotional connection.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dn7iDC7YJ-FhE2OX.png" /><figcaption><em>Source: Robot Newspaper</em></figcaption></figure><p><strong>And AI-powered voice user interfaces, too, ultimately need to run on-device.</strong> Here’s why.</p><ul><li><strong>With cloud, operating costs are impossible to predict</strong>: Cloud-based speech APIs typically charge per call, which means cost scales with usag, and usage is hard to forecast. When the same capability runs on-device, no per-use cost is incurred after deployment, making it far more economical over the long run.</li><li><strong>Voice data is sensitive personal information</strong>: Voice carries more than just the words being spoken. It also captures the speaker’s identity (their voice), their emotional state, and the ambient sounds around them. Transmitting that kind of data to an external server can be a significant liability in itself.</li><li><strong>Natural conversation requires real-time responsiveness</strong>: The acceptable response gap for a conversation to feel natural is reportedly around 0.2 seconds (200ms). If the voice user interface lives on a cloud or external server, the round-trip for sending audio and receiving the result adds extra latency . And that’s often enough to break the rhythm of a real-time exchange.</li></ul><p>For us to talk to AI in our own language during the Physical AI era, the voice user interface that serves as the bridge <strong>must be able to listen, understand, and respond in real time , right on the device.</strong></p><h3>ENERZAi as a Physical AI Company</h3><p>ENERZAi develops voice and language models that can run with minimal memory on low-spec hardware. Specifically, we deliver <strong>voice interfaces that run optimally on CPU alone, even on devices without a GPU or NPU.</strong></p><p>This solves the memory bottleneck that nearly every company exploring on-device AI runs into, which is why we’ve been receiving strong interest from semiconductor and device makers. At embedded world held on this March, the world’s largest embedded systems exhibition, we presented a robotics voice-control demo together with global semiconductor company Synaptics. It’s still an early-stage form of Physical AI, but it earned strong reviews for delivering stable performance with minimal memory and power.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4sHLlT7FbNE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4sHLlT7FbNE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4sHLlT7FbNE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa507d0cb8b40bffb2f790db237833c7/href">https://medium.com/media/fa507d0cb8b40bffb2f790db237833c7/href</a></iframe><p>At the end of last year, we also signed a strategic partnership with Advantech, a global leader in industrial PCs and AIoT solutions and one of the companies driving Physical AI innovation forward. The partnership pairs Advantech’s proven hardware and deep industrial-domain expertise with ENERZAi’s on-device AI technology, and the two companies are jointly building on-device AI solutions that can be deployed across manufacturing, logistics, smart cities, and other industrial sites.</p><p>ENERZAi’s ultimate goal is to achieve <strong>true intelligence,</strong> AI that can reason on its own and call the right tools, even on the edge rather than the cloud or a remote server. Because this direction connects so naturally with Physical AI’s vision of acting independently in the real world, we’re committed to building <strong>the on-device AI that turns Physical AI into reality.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*SQtH-iAkga_wPLwx.png" /></figure><p>If you’re considering on-device AI for your own product or platform, or exploring potential collaboration around Physical AI, please feel free to reach out anytime!</p><p><a href="https://enerzai.com/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4484250212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[피지컬 AI 시대, 온디바이스 AI로 현실이 되다]]></title>
            <link>https://medium.com/@enerzai/%ED%94%BC%EC%A7%80%EC%BB%AC-ai-%EC%8B%9C%EB%8C%80-%EC%98%A8%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4-ai%EB%A1%9C-%ED%98%84%EC%8B%A4%EC%9D%B4-%EB%90%98%EB%8B%A4-a4d727e1c252?source=rss-ad004e8e11d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4d727e1c252</guid>
            <category><![CDATA[physical-ai]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[ai-on-device]]></category>
            <category><![CDATA[enerzai]]></category>
            <category><![CDATA[edge-ai]]></category>
            <dc:creator><![CDATA[ENERZAi]]></dc:creator>
            <pubDate>Thu, 28 May 2026 08:32:40 GMT</pubDate>
            <atom:updated>2026-05-28T08:38:28.191Z</atom:updated>
            <content:encoded><![CDATA[<p>안녕하세요, 에너자이입니다. <strong>“피지컬 AI(Physical AI)</strong>”, 요즘 가장 뜨거운 키워드 중 하나입니다. 컨퍼런스 키노트의 단골 주제이기도 하고, 전시에서도 부스를 찾아주시는 방문객 분들이 가장 자주 언급하시는 키워드인데요. 이번 게시물에서는 피지컬 AI란 무엇인지, 피지컬 AI를 구현하기 위해서는 어떤 기술들이 필요한지에 대하여 간단히 알아보고자 합니다.</p><h3>요약</h3><ul><li>NVIDIA의 GR00T, Figure·Tesla의 휴머노이드, 그리고 산업 현장의 AMR과 자율주행까지. ‘피지컬 AI’는 단일 기술이 아니라 산업 전반의 패러다임으로 자리 잡고 있습니다.</li><li>피지컬AI란 물리 세계를 이해하여 올바른 판단을 내리고 실제 행동으로 옮길 수 있는 AI를 뜻하며, 국내 ICT 연구개발 기술분류체계는 피지컬 AI의 핵심 기술을 <strong>VLA 모델, 온디바이스 AI, 바디 기술, 시뮬레이션 기반 학습 환경, 피지컬 AI 데이터 팩토리</strong> 5가지로 정리하고 있습니다.</li><li>그중 <strong>온디바이스 AI</strong>는 학습된 정책을 현장에서 실시간으로 실행하는 ‘마지막 단계’로, 현장에서 주어진 문제를 인식하여 실시간으로 행동하기 위한 필수 조건입니다.</li><li>자율주행 차량·휴머노이드·서비스/돌봄 로봇과 같은 피지컬 AI의 적용 영역에서 <strong>음성 인터페이스</strong>가 활발하게 도입되고 있으며, AI와의 자연스러운 대화가 성립하기 위해서는 운영 비용·데이터 민감도·실시간성 측면에서 온디바이스 구현이 사실상 필수적입니다.</li><li>에너자이는 최소한의 메모리 및 전력으로 자원이 제한된 온디바이스 환경에서도 뛰어난 성능을 낼 수 있는 음성 인터페이스를 제공합니다.</li></ul><h3>피지컬 AI란?</h3><p>지난 한 해 동안 글로벌 테크 업계에서 가장 자주 언급된 키워드 중 하나가 ‘피지컬 AI’였습니다. 엔비디아는 GTC에서 휴머노이드 파운데이션 모델 GR00T를 발표하며 ‘피지컬 AI 시대’를 본격적으로 선언했고, 피규어와 테슬라가 박차를 가하고 있는 휴머노이드 상용화 경쟁의 핵심도 피지컬 AI에 달려 있습니다. 그 외에도 자율주행 차량이나 산업용 AMR (자율주행 로봇), 그리고 드론까지 ‘디지털 화면 안의 AI’가 아니라 ‘물리적으로 움직이고 반응하는 AI’에 대한 관심이 그 어느 때보다 뜨거운데요.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqVbmwqpRo9J83CjVLRH1w.png" /><figcaption>Tesla의 휴머노이드 Optimus</figcaption></figure><p>피지컬 AI는 한 마디로 ‘<strong>실제 물리 세계에서 움직이고 반응하는 AI</strong>’입니다. 디지털 영역에 머무르는 것이 아니라 카메라·라이다·마이크 등 다양한 센서로 환경을 인지하고, 그 정보를 바탕으로 의사결정을 내린 뒤, 모터·액추에이터·디스플레이를 통해 현실에서의 결과물을 만들어내는 AI를 뜻합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61mnR8X-peQjcsdT_9CEGg.png" /><figcaption>출처: appinventiv</figcaption></figure><p>이 분야가 주목받게 된 데에는 크게 세 가지 배경이 있습니다. 첫째, 모델 측면에서 시각·언어·행동을 통합하는 <strong>VLA(Vision-Language-Action) 모델</strong> 등 ‘실제 세계를 이해할 수 있는’ 모델이 빠르게 성숙하고 있습니다. 둘째, 하드웨어 측면에서 엣지용 NPU와 저전력 SoC가 본격적으로 보급되면서, 과거에는 클라우드에서만 돌릴 수 있던 <strong>모델을 디바이스 위에서 구동할 수 있는 기반</strong>이 마련되었습니다. 셋째, 산업 측면에서 제조·물류·에너지·도시 <strong>인프라 전반의 자동화 수요</strong>가 정점에 달했고, 이를 풀어낼 만큼 정교한 AI가 비로소 등장하기 시작했습니다.</p><h3>핵심 기술</h3><p>피지컬 AI는 단일 모델로 완성되지 않습니다. 두뇌부터 신체, 학습 인프라까지 여러 기술이 한 스택을 이뤘을 때 비로소 동작합니다. 국내 ICT 연구개발 기술분류체계 기반의 최근 보고서는 피지컬 AI의 핵심 기술을 다음 5가지로 정리하고 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lOeahodapxdHjHNpPeWF_Q.png" /><figcaption>출처: USAII</figcaption></figure><ul><li><strong>VLA(Vision-Language-Action) 모델</strong>: 시각·언어·행동을 통합해 로봇의 인지·판단·행동 생성을 수행하는 ‘핵심 두뇌’로, 올해 GTC에서 공개된 엔비디아 GR00T가 대표적입니다.</li><li><strong>온디바이스 AI</strong>: 저지연·저전력 추론을 통해 현장에서 로봇 제어를 수행하는 ‘실행 기술’로, 학습된 AI 모델이 실제 디바이스 환경에서 우수한 추론 성능을 확보하기 위해 필요한 기술입니다.</li><li><strong>바디 기술(센서·액추에이터):</strong> 환경 정보를 확보하고 정책을 물리 행동으로 구현하는 ‘신체 기술’로, 이동·조작 지능, 상황인식·판단까지를 포함합니다. AI 모델이 ‘버튼을 눌러라’는 명령을 내렸을 때 넘어지지 않고 해낼 수 있도록 하는 능력입니다.</li><li><strong>시뮬레이션 기반 학습 환경:</strong> 대규모 병렬 학습, 위험 시나리오 학습, Sim2Real 보정 (시뮬레이션과 현실의 괴리를 최소화하기 위한 기법들을 뜻합니다)을 위한 학습 실행 환경으로, 디지털 트윈과 NVIDIA의 Issac Sim 같은 플랫폼이 여기에 해당합니다.</li><li><strong>피지컬 AI 데이터 팩토리</strong>: 로봇 행동 데이터의 수집·저장·정제·학습을 수행하는 ‘학습 인프라’입니다. 데이터의 양과 질은 AI 모델의 성능과 직결됩니다.</li></ul><p>5가지 모두 한 자리에 모여야 피지컬 AI가 동작하지만, 그중에서도 <strong>온디바이스 AI는 다른 모든 축의 가치를 현장에서 실현시키는 핵심 요</strong>입니다. 아무리 강력한 VLA 모델이 학습되고, 시뮬레이션과 데이터 팩토리가 정교해져도, 그 결과를 실제 디바이스 위에서 실시간으로 돌리지 못하면 진정한 의미의 피지컬 AI는 실현되기 어렵습니다.</p><p>이유는 단순합니다. 로봇이 사람과 부딪힐 뻔할 때나 자율주행 차량이 갑작스러운 보행자를 마주했을 때 “잠시만요, 클라우드에 다녀올게요”라는 답은 허용되지 않습니다. 실시간성을 보장하기 어렵다는 점 외에도 네트워크 의존성, 데이터 유출 위협, 누적되는 API 및 인스턴스 비용까지 여러 제약 조건들로 인해 클라우드 기반으로 피지컬 AI를 구현하는 것은 사실상 불가능에 가까운데요.</p><p>이로 인해 결국 피지컬 AI의 확산은 곧 온디바이스 AI 수요의 확산이라고도 볼 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pPioJpdx4iK15_PliOdhZQ.png" /><figcaption>출처: <a href="https://medium.com/@mankayarkarasi/the-rise-of-physical-ai-790fc4b1627a">https://medium.com/@mankayarkarasi/the-rise-of-physical-ai-790fc4b1627a</a></figcaption></figure><h3>음성 인터페이스의 부상</h3><p>피지컬 AI가 이해하고, 판단하고, 행동해야 하는 물리 세계의 한가운데에는 거의 항상 사람이 있습니다. 즉, 대부분의 상황에서 피지컬 AI는 차 안에서 운전하는 사람, 공장에서 일하는 작업자, 병동에 머무는 환자, 거실에서 함께 지내는 가족까지 다양한 양상의 사람들을 위해 움직이게 되는데요.</p><p>그렇다면 물리 세계의 AI와 사람은 어떻게 소통해야 할까요? 과거에는 마우스나 키보드, 터치 패널 등의 기기를 사용하는 것이 일반적이었지만 자동차 안, 공장, 병원 등 산업과 일상 곳곳에 AI가 들어가는 환경에서 가장 자연스럽고 편리하게 활용될 수 있는 인터페이스는 결국 <strong>음성</strong>입니다.</p><p>실제로 음성 인터페이스는 피지컬 AI 연구가 활발히 이루어지고 있는 다양한 영역에서 사실상의 표준 인터페이스로 자리 잡아가고 있는데요.</p><ul><li><strong>휴머노이드:</strong> 휴머노이드를 개발하는 대표적인 기업 Figure와 Tesla 모두 음성 인터페이스를 탑재하여 음성 기반 명령 제어뿐만 아니라 자연스러운 대화까지 지원하고 있는데요. 자연스러운 대화형 AI를 구현하는 것이 매우 어려운 작업임에도 불구하고 음성 인터페이스를 포기할 수 없는 것은 결국 사람에게 가장 편리하고 빠른 소통 수단은 결국 말이기 때문입니다.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYvEdEAX1uP4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FYvEdEAX1uP4%3Fsi%3Dr4cCQ9AFK1TbN1AC&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYvEdEAX1uP4%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/19eae24e9d252ad65184137b34d1b799/href">https://medium.com/media/19eae24e9d252ad65184137b34d1b799/href</a></iframe><ul><li><strong>서비스 로봇</strong>: 인천국제공항에 도입된 자율주행 안내 로봇은 승객과 자연스러운 음성 대화를 통해 최적 경로를 안내하며, 긴급 상황이 발생했다고 판단될 경우 순찰 모드로 전환되어 안전 관리 업무를 수행합니다.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KsrZjI3MxINjffmC9rPG7Q.png" /><figcaption>출처: 파이낸셜 뉴스</figcaption></figure><ul><li><strong>돌봄 로봇</strong>: 돌봄 로봇이란 가정 내에서 움직이거나 말을 하면서 사용자의 일상생활을 보조해주는 로봇으로 고령자의 건강관리, 안전 및 정서적 안정을 위해 개발된 제품입니다. 오늘날 돌봄 로봇은 기상 및 복약 알림이나 귀가 확인 등 일상 생활을 보조할 뿐만 아니라 정서적 교감을 위한 말벗 및 대화까지 지원하고 있습니다.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*OBZNFHZzK9_A1ljMXjbC7g.png" /><figcaption>출처: 로봇신문</figcaption></figure><p><strong>그리고 AI 기반 음성 인터페이스 또한 궁극적으로는 온디바이스로 구현되어야 합니다.</strong> 그 이유는 아래와 같은데요.</p><ul><li><strong>클라우드로 구현할 경우 운영 비용을 예측하는 것이 불가능합니다</strong>: 클라우드에서 지원하는 음성 인식 API를 사용할 경우 해당 기능이 호출될 때마다 일정 비용이 과금되는 구조인데요. 해당 기능이 얼마나 자주, 많이 활용될지 예측하는 것이 불가능해집니다. 온디바이스로 구현될 경우 배포 이후 별도 비용이 발생하지 않으므로 장기적인 관점에서 훨씬 더 경제적입니다.</li><li><strong>음성 데이터는 민감 정보로 분류되는 중요한 개인 정보입니다</strong>: 음성에는 발화 내용을 넘어 화자의 신원(목소리), 감정, 주변 환경음까지 함께 담깁니다. 이처럼 중요한 음성 데이터를 외부로 전송하는 것 자체가 큰 부담이 될 수 있습니다.</li><li><strong>자연스러운 대화를 위해서는 실시간성이 필수적으로 보장되어야 합니다:</strong> 대화가 자연스럽게 이루어지기 위한 적절한 답변의 공백 시간은 약 0.2초(200ms)라고 합니다. 음성 인터페이스가 클라우드나 외부 서버에 탑재된다면 데이터를 전송하고 결과를 수신하는데 추가적인 시간이 소요되고, 이는 실시간성을 저해할 수 있습니다.</li></ul><p>피지컬 AI 시대에 우리가 쓰는 언어로 AI와 소통하기 위해서는 결국 그 가교 역할을 하게 될 음성 인터페이스가 <strong>디바이스 위에서 실시간으로 듣고 이해하고 응답해야</strong> 합니다.</p><h3>피지컬 AI 기업으로서 에너자이</h3><p>에너자이는 저사양 하드웨어에서 최소한의 메모리로 구동 가능한 음성 및 언어 모델들을 지원하고 있는데요.<strong> GPU나 NPU가 없는 디바이스 환경에서 CPU만으로도 최적의 성능을 낼 수 있는 음성 인터페이스</strong>를 제공하고 있습니다.</p><p>온디바이스 AI에 대한 니즈가 있는 기업이라면 모두가 어려움을 겪고 있는 메모리 병목 문제를 해결한다는 점에서 반도체사 및 디바이스사들의 뜨거운 관심을 받고 있는데요. 올해 3월에 독일에서 개최된 세계 최대 규모 임베디드 시스템 전시인 embedded world에서 글로벌 반도체사인 Synaptics사와 함께 로보틱스 음성 제어 데모를 선보이기도 했습니다. 초보적인 수준의 피지컬 AI라고 볼 수 있지만, 최소한의 메모리 및 전력으로 안정적인 성능을 구현했다는 점에서 좋은 평가를 받았습니다.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4sHLlT7FbNE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4sHLlT7FbNE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4sHLlT7FbNE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c47bce8ab5c0c536ced92a2f8599535/href">https://medium.com/media/2c47bce8ab5c0c536ced92a2f8599535/href</a></iframe><p>작년 말에는 글로벌 산업용 PC 및 AIoT 솔루션 분야 리딩 기업으로서 피지컬 AI 혁신을 선도하고 있는 어드밴텍과 전략적 파트너십을 체결하기도 했습니다. 해당 파트너십은 어드밴텍의 검증된 하드웨어·산업 도메인 전문성과 에너자이의 온디바이스 AI 기술이 만나는 구조로, 양사는 제조, 물류, 스마트 시티 등 다양한 산업 현장에 적용될 수 있는 온디바이스 AI 솔루션을 함께 만들어 나가고 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vRAnQFFD_vclne7zaUBFxQ.png" /></figure><p>에너자이의 궁극적인 목표는 클라우드/서버가 아닌 온디바이스 환경에서도 <strong>스스로 판단하고, 적절한 도구를 호출할 수 있는</strong> <strong>True Intelligence</strong>를 구현하는 것인데요. 저희가 추구하는 이러한 방향이 현실 세계를 이해하여 스스로 행동하는 피지컬 AI와도 맞닿아 있는 만큼, 앞으로도 <strong>피지컬 AI를 현실로 만들 수 있는 온디바이스 AI</strong>를 실현하기 위해 최선을 다할 계획입니다.</p><p>자사 제품이나 플랫폼에 온디바이스 AI 도입을 고민하고 계시거나, 피지컬 AI 관련 협업 가능성을 탐색 중이시라면 언제든 편하게 연락주세요!</p><p><a href="https://enerzai.com/ko/contact">ENERZAi - Contact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4d727e1c252" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>