Can a CGLA Draw Triangles? Prototyping 3D Rasterization on TokenProcessor

LENZO develops adaptable AI computing platforms built on TokenProcessor™ technology. In this post, we take TokenProcessor outside of AI and ask a simple question: can its CGLA architecture accelerate 3D graphics rendering?
A Question From Outside AI
Most of what we publish about TokenProcessor is about AI inference: LLM decode, convolutional networks, speech recognition. But the architecture underneath, the CPU-Grounded Linear Array (CGLA), was never designed to be AI-only. It runs any loop you can express as a stream of arithmetic, comparisons and memory accesses.
So we asked a question that comes up often in conversations with partners: could a CGLA be the basis of a GPU-like device for 3D graphics?
Instead of answering on a whiteboard, we wrote a small rasterizer, ran it on a VPK180 board, and compared every pixel against a CPU reference. This post shares what worked, what didn't, and what the numbers tell us so far.
1. Why Graphics Is an Interesting Test
A classic 3D pipeline has very different kinds of work in it:
Stage | What it does | Fit for a CGLA |
|---|---|---|
Vertex transform and lighting | 4×4 matrix × every vertex | Good: a pure multiply-accumulate stream, like matrix multiplication |
Rasterization | Decide which pixels each triangle covers (edge functions) | Good, if the work is made regular (e.g., by tiles) |
Pixel shading | The same formula for every pixel | Good, as long as branches can become selects |
Depth test and write | Keep the nearest surface per pixel | Good: compare plus conditional select |
Texture sampling | Read from arbitrary addresses | Harder: irregular memory access |
Triangle setup, clipping, binning | Different work per triangle | Better left to the host CPU |
Ray tracing (BVH traversal) | Branch-heavy, pointer-chasing | Poor fit |
The middle of this table, deciding coverage, comparing depth and selecting a color for every pixel, is exactly the kind of regular, data-parallel loop a CGLA is built for. That is what we put on TokenProcessor.
2. The Prototype
We rendered a rotating torus (1,024 triangles, about 410–460 of them front-facing in each frame) at 320×240 with flat Lambert shading.
The test scene: 720 frames of the rotating torus. Every frame was drawn by the same algorithm as our TokenProcessor kernel (this clip comes from the GPU compute-shader version in Section 5) and matches the CPU reference pixel for pixel.
Host CPU (Arm Cortex-A72): transforms vertices, computes lighting once per triangle, builds the equations for each triangle (three edge functions and a depth plane), and sorts triangles into screen tiles.
TokenProcessor: streams every pixel of a tile through its 64-stage array. Each pixel is tested against 10 triangles in one pass, keeping the nearest depth and its color in registers, and then merged with the frame buffer once at the end of the array.

2.1 Mapping Triangles Onto a Linear Array
TokenProcessor arranges processing elements (PEs) and local memories (LMMs) in a line. Pixels enter at the top one after another, and each pixel's partial results flow down to the next stage. We gave each triangle six stages:

Evaluate two edge functions at once (two 32-bit floats packed in one 64-bit register):
C + A·xAdd the
B·ytermCompare signs and depth in a single unsigned compare per pair
Sum the four pass/fail flags
Reduce them to one "inside and nearer" bit
Select the new depth and color, or keep the old ones (a branchless conditional move)
Ten triangles take 60 stages. The remaining four load the pixel coordinates and merge the result with the frame buffer.
Two small tricks made this fit:
Unsigned compares on float bits. For non-negative floats, comparing the raw bit patterns as unsigned integers gives the same order as comparing the values, and "e ≥ 0" is simply "bits < 0x80000000". No float-compare unit was needed.
Packing. One stage can produce four 64-bit values, so we packed pairs of 32-bit values (x and y, color and depth, two edge results) into each register.
2.2 How We Checked Correctness
We checked every frame three ways:
a C emulation of the kernel (no hardware), to confirm the arithmetic;
a CPU reference that runs exactly the same algorithm with the same rounding (
fmaf), so every pixel can be compared bit for bit;a conventional CPU rasterizer that only visits pixels inside each triangle's bounding box. This is the fair speed baseline.
3. Results
All numbers are averages over 30 frames on one VPK180 (AMD Versal Premium; TokenProcessor implemented on the FPGA fabric as a prototype), with two lanes of 64 PEs each.
Configuration | Launches per frame | TokenProcessor, 1 lane | TokenProcessor, 2 lanes | CPU, same algorithm | CPU, conventional (bounding box) |
|---|---|---|---|---|---|
Full-width bands (320×16) | 81.5 | 16.8 ms | 9.2 ms | 31.0 ms | 1.5 ms |
Tiles 80×16 | 107.1 | 9.9 ms | 5.3 ms | 10.1 ms | 1.6 ms |
Tiles 80×24 | 90.2 | 9.5 ms | 5.1 ms | 12.8 ms | 1.8 ms |
Tiles 32×16 | 145.3 | 11.1 ms | 5.9 ms | 5.7 ms | 1.8 ms |

A frame rendered on TokenProcessor. Coverage, depth testing and color selection ran on the CGLA; the image is identical to the CPU reference.
What the numbers say:
It renders correctly. With tiles, all 540 frames we tested were bit-identical to the CPU reference. With full-width bands, one pixel in 30 frames differed: a pixel exactly on an edge shared by two triangles at the same depth, where TokenProcessor's floating-point rounding differed from the CPU's. Both answers are valid rasterizations.
Against the same algorithm on the CPU, TokenProcessor wins with medium and large tiles, by 2.5–3.4× with two lanes. It performs roughly 230–320 million pixel–triangle tests per second per lane. With very small tiles (32×16) the CPU catches up, because its work shrinks with the tile while TokenProcessor still pays a fixed cost for each launch.
Against a conventional CPU rasterizer, it does not win yet. Our best configuration (80×24 tiles, two lanes, 5.1 ms per frame) is about 2.9× slower than a bounding-box rasterizer on the same Arm core (1.8 ms).
Tiling helped. Moving from full-width bands to 80×24 tiles made TokenProcessor 1.8× faster, because far fewer pixels are tested against triangles that cannot cover them. Making tiles too small backfires: each launch carries a fixed cost of roughly 20–50 µs for configuration and data transfer, and that cost starts to dominate.
The gap to the conventional CPU comes from the algorithm more than the hardware. A CPU rasterizer touches only the pixels a triangle covers; our prototype tests every pixel of a tile against every triangle that overlaps the tile. A brute-force, branch-free formulation is what makes the work fit a streaming array, and in this prototype we paid for that in wasted tests.
4. What an ASIC Could Do: A Projection
Our measurements come from an FPGA prototype. To estimate what the same kernel could do as a chip, we used the same projection model we use for our LLM estimates. We take the measured time of each runtime phase and rescale it with the assumptions of an ASIC configuration:
Assumption | Value |
|---|---|
Clock | 1 GHz (the FPGA prototype is modeled at 150 MHz) |
Cycles per loop iteration | 4 |
Cores | 8 arrays of 64 PEs (4 lanes × 2) |
Memory | LPDDR5X-8533, 64-bit (68.3 GB/s, shared) |
Host CPU | One Arm Cortex-A53 per lane (2.16× the time of the VPK180's Cortex-A72, measured on llama.cpp) |
Phase | Measured on VPK180 (1 lane) | Projected on ASIC (8 cores) | How we scaled it |
|---|---|---|---|
Compute (EXEC) | 7.53 ms | 0.09–0.14 ms | Clock and core count |
Data transfer (LOAD, DRAIN) | 1.74 ms | 0.04 ms | Bytes moved ÷ memory bandwidth |
Configuration and registers | 0.23 ms | 0.01 ms | Clock |
TokenProcessor total | 9.54 ms | 0.14–0.19 ms | |
Host work (transform, lighting, binning) | 0.41 ms (A72) | 0.89 ms (one A53) | CPU speed ratio |
The range for compute reflects one open question. On the FPGA, one loop iteration currently takes about 6.5 cycles. The lower bound assumes the 4 cycles of our ASIC model, and the upper bound assumes the FPGA's 6.5 cycles carry over.
For the 320×240 scene in this post, that projects to:
About 1.0 ms per frame (roughly 930–980 frames per second) if the host work runs on one A53 core and does not overlap with rendering.
About 0.22 ms per frame (roughly 4,500 frames per second) if the host work is split across four A53 cores and overlapped with rendering the previous frame. In this case the host work, not TokenProcessor, sets the frame rate.
For comparison, the conventional bounding-box rasterizer takes 1.78 ms on the VPK180's Cortex-A72, which would be about 3.8 ms on a Cortex-A53. On this projection, the rendering part would be roughly an order of magnitude faster than a conventional CPU rasterizer, and the bottleneck would move to the host-side geometry work.
These are projections, not measurements, and they rest on assumptions we have not yet verified:
We assume compute, data transfer and host work run one after another, as they do on the FPGA, and that tiles divide evenly across the 8 cores.
Scaling naively to 1920×1080 (27× the pixels) gives 3.7–5.1 ms for the TokenProcessor part with this simple torus. Real scenes have tens or hundreds of thousands of triangles. Launches grow with triangle count, so per-launch overhead and host-side work would weigh much more than they do here.
We have not yet projected power for this workload. The same model can do that, and it is next on our list.
5. How Does This Compare to a GPU?
To put these numbers in context, we rendered the same scene on two GPUs at opposite ends of the range:
Apple M4 (10-core GPU), with Metal: a high-end GPU of the kind found in laptops and tablets.
Raspberry Pi 5 (VideoCore VII), with OpenGL ES 3.1: a small embedded GPU.
The scene was generated by the same code, and every frame had the same triangle counts as on the VPK180. On each GPU we ran it two ways:
Same algorithm: a compute shader that does exactly what our TokenProcessor kernel does. It tests every pixel of an 80×24 tile against every triangle overlapping that tile.
Native pipeline: the GPU's standard render pipeline, using its fixed-function rasterizer and depth test.

Platform | Method | 320×240 | 1920×1080 |
|---|---|---|---|
VPK180, TokenProcessor (FPGA prototype, 2 lanes) | Same algorithm | 5.12 ms (measured) | – |
VPK180, Arm Cortex-A72 (1 core) | Conventional (bounding box) | 1.78 ms | – |
TokenProcessor ASIC (8 cores, 1 GHz) | Same algorithm | 0.14–0.19 ms (projected) | 3.7–5.1 ms (naive projection) |
Raspberry Pi 5, Arm Cortex-A76 (1 core) | Conventional (bounding box) | 0.94 ms | 8.2 ms |
Raspberry Pi 5 GPU (VideoCore VII) | Same algorithm (compute shader) | 6.0 ms | 31.5 ms |
Raspberry Pi 5 GPU (VideoCore VII) | Native render pipeline | 0.051 ms | 0.84 ms |
Apple M4 CPU (1 core) | Conventional (bounding box) | 0.157 ms | 1.58 ms |
Apple M4 GPU | Same algorithm (compute shader) | 0.057 ms | 0.64 ms |
Apple M4 GPU | Native render pipeline | 0.024 ms | 0.18 ms |
GPU numbers are GPU processing time per frame. On the M4 it is the GPU execution time reported by Metal, averaged over 300 frames. On the Raspberry Pi 5 the driver's timer queries were not reliable, so we submitted the same frame 50 times and divided the total time by 50 (300 frames at 320×240, 30 frames at 1080p). If the CPU submits each frame and waits for it to finish, the round trip adds roughly 0.1–0.7 ms. A real renderer overlaps frames, so throughput follows the GPU time.
The compute-shader versions matched the CPU reference bit for bit. On the M4 they matched a reference using fused multiply-add. On the Raspberry Pi 5 they matched a reference that rounds the multiply and the add separately, because OpenGL ES 3.1 shaders have no fma(). The native pipelines differed on 0.001–0.02% of pixels per frame, all on triangle edges, because GPUs follow their own fill rules for pixels that lie exactly on an edge.
Two things stand out:
Fixed-function rasterization is hard to beat. Even the small Raspberry Pi 5 GPU renders this scene in 0.051 ms with its native pipeline, about 3–4× faster than our ASIC projection at 320×240 and 4–6× faster at 1080p. The M4 is faster still: about 3× faster than our projection even when running our brute-force algorithm, and 6–8× faster with its native pipeline.
Running the same algorithm, the picture flips on the small GPU. The Raspberry Pi 5 GPU takes 6.0 ms with the compute-shader version, about the same as our FPGA prototype and slower than its own CPU. Our ASIC projection would be 30–40× faster on that workload. A GPU of this class is built around its graphics pipeline; general-purpose compute is not where it is strong.
This is consistent with what we expected. A GPU devotes silicon to exactly this problem: fixed-function rasterizers, depth units and a pipeline tuned over decades. TokenProcessor is a general-purpose array, and graphics was a stress test of how far its programmability goes. A fair comparison would also need power and silicon area, which we have not measured for any of these devices here.
6. What About AI Accelerators?
If TokenProcessor is a programmable array for AI, a natural question is whether other AI chips could do the same. We tried two kinds.
6.1 Google Cloud TPU
A TPU is built around a large matrix-multiply unit and is programmed through compilers such as XLA, so it cannot run our C kernel as written. We rewrote the same algorithm in JAX so that the compiler could map it to the TPU:
The three edge functions and the depth plane of a batch of triangles are evaluated for all pixels as one matrix multiply: [pixels × 3] by [3 × 4·triangles], where each pixel row is (x, y, 1).
The inside test, depth test and color selection become element-wise compares, selects and a minimum over the batch, looped over batches of triangles.
For the tiled version, the triangle lists are built on the host as before. Because the TPU compiler needs fixed array shapes, every tile's list is padded to the length of the busiest tile.
We ran it on one TPU v5e chip in Google Colab (JAX 0.11.2), with the same scene and the same 80×24 tiles:
Platform | Method | 320×240 | 1920×1080 |
|---|---|---|---|
Google TPU v5e (1 chip) | Every pixel × every triangle (no tiles) | 19.3 ms | 1,135 ms |
Google TPU v5e (1 chip) | Same algorithm (80×24 tiles) | 7.0 ms | 75.6 ms |
VPK180, TokenProcessor (FPGA prototype, 2 lanes) | Same algorithm | 5.12 ms (measured) | – |
TokenProcessor ASIC (8 cores, 1 GHz) | Same algorithm | 0.14–0.19 ms (projected) | 3.7–5.1 ms (naive projection) |
TPU numbers are the device time per frame with the triangle data already on the TPU, averaged over 30 frames at 320×240 and 10 frames at 1080p. Building the tile lists on the host is not included. The output differed from the CPU reference on 1 pixel in 30 frames at 320×240 and 5 pixels in 10 frames at 1080p, all on triangle edges, because the matrix unit adds the terms in a different order.
It works, and it gives the right picture. But a single TPU v5e chip, a data-center accelerator, is slower on this task than our FPGA prototype. It is roughly 40–50× slower than the ASIC projection at 320×240 and 15–20× slower at 1080p. The reasons are structural:
The matrix unit has almost nothing to do. The inner dimension of the matrix multiply is only 3 (x, y and 1), so the unit that gives a TPU its performance is nearly idle.
The real work is compares and selects. Most of the time goes to element-wise inside tests, depth tests and the minimum search, which run on the TPU's much smaller vector units.
Fixed shapes mean wasted work. At 320×240 the busiest tile has 115 triangles while the average is about 20, so most of the padded work is thrown away. On TokenProcessor each tile simply runs as many launches as it needs.
This was not a hand-tuned TPU kernel (for example, one written in Pallas), and better implementations surely exist. But the gap comes from the shape of the work, not from tuning: rasterization is mostly branch-free logic, not matrix multiplies.
6.2 Fixed-Network NPUs
Many edge AI chips are NPUs that only run neural networks: a vendor compiler converts a trained model, built from a fixed set of supported layers, into instructions for the chip, often in INT8 only. There is no way to write your own kernel. NPUs of this kind cannot run this rasterizer at all. Edge functions, unsigned compares on floating-point bits, per-pixel conditional moves and a depth test are not neural-network layers, and there is nothing to compile them to.
That is the point of this experiment. On TokenProcessor we wrote the rasterizer as an ordinary C loop and ran it on the same array, with the same toolchain, that runs our LLM inference. Floating-point multiply-add, unsigned compares, bit shifts and conditional moves are all first-class operations, and each stage of the array can be programmed as needed. The same silicon that is built for AI can be pointed at a workload that has nothing to do with AI.
7. What We Learned About Programming a CGLA
This prototype was also a good exercise in thinking like a linear array.
Data flows to the next stage. A value produced in one stage is meant to be consumed by the next stage. When a value is needed further down, it is either carried stage by stage or reloaded from that stage's local memory. Designing the dataflow around this, rather than around variables, was the key step.
Four values per stage is the budget. Packing two 32-bit values into each 64-bit register doubled what we could carry. It also let a single instruction evaluate two edge functions at once.
Branches become selects. Inside/outside tests and depth tests turned into sums of 0/1 flags followed by one conditional move. Nothing in the pipeline branches.
Where reads and writes happen matters. The frame buffer is read near the end of the array and written at the very end. To keep results correct across launches, we currently reload the frame buffer for every launch. That accounts for about 20% of the time. We also tried a single-stage read-compare-write using a 16-bit depth and a min-select instruction, but it did not yet produce correct results on hardware, so we left it as future work.
8. What Would Make CGLA Graphics Competitive
Based on these measurements, we see three clear directions:
More triangles per launch. Tightening the per-triangle logic from six stages to five would fit more triangles per pass and reduce launches.
Keeping the frame buffer on-chip. A working single-stage read-modify-write would remove the reload on every launch.
Smarter tiling. Fine tiles where geometry is dense and coarse tiles elsewhere would reduce wasted tests without multiplying launches.
Beyond this prototype, a graphics device needs more than an arithmetic array: texture units, enough memory bandwidth for frame buffers, display output, and above all a software stack (OpenGL ES or Vulkan drivers and a shader compiler). Our new MLIR-based compiler is a natural path for the shader-compiler piece. And as the projection in Section 4 suggests, the host-side geometry work will need as much attention as the array itself.
9. Try It Yourself
Everything in this post runs with the standard TokenProcessor toolchain (conv-mark, cpp and conv-c2d) on a VPK180. If you want to understand the architecture first, start with these:
The Bottom Line
A CGLA can draw triangles. Coverage, depth testing and color selection map naturally onto a linear array, the results match a CPU reference pixel for pixel, and with medium and large tiles the kernel runs 2.5–3.4× faster than the identical algorithm on the host CPU. It is not yet faster than a well-written conventional rasterizer on the same chip. The reasons are clear and measurable: brute-force coverage tests and per-launch overhead. Projected to an ASIC with eight cores at 1 GHz, the rendering part of this scene drops to about 0.14–0.19 ms per frame, roughly an order of magnitude faster than a conventional CPU rasterizer on a comparable core. At that point the host-side geometry work becomes the bottleneck. GPUs are still several times faster on this task with their fixed-function pipelines, from a small embedded GPU (Raspberry Pi 5) to a high-end one (Apple M4). But on the same brute-force algorithm, the projected ASIC would be 30–40× faster than the small embedded GPU. AI accelerators fare worse: a Google TPU v5e chip, running the same algorithm rewritten in JAX, was slower than our FPGA prototype, and NPUs that only run fixed neural networks cannot run it at all. All of this is a reminder that a CGLA's strength is programmability across many kinds of workloads, not beating fixed-function hardware at its own game. That is exactly the kind of result we like to publish: an honest baseline, and a concrete list of what to improve next.
Let's Build What's Next
Whether you are exploring graphics, robotics, perception, or any workload that doesn't fit neatly into a GPU, we'd love to learn more about your application.

