Bobium Brawlers 移植 Android 的端侧 AI 推理实践
Porting Bobium Brawlers to Android
文章分享了在移动端利用ARM SME2指令集实现本地AI推理的优化经验。
What changes when generative AI runs inside a game instead of behind a cloud API? We recently collaborated with ARM to get our game Bobium Brawlers running on Android.
If you haven’t played it yet, Bobium Brawlers is a fast-paced PvP card-and-dice battler where you describe in text any creature that pops into your mind (see our fun lizard spy below) and the game builds it. Your words become artwork and a playable deck, so every creation looks and fights like nobody else’s. Up until now, Bobium Brawlers only ran on iOS; now we have it running on Android too, entirely on-device with no cloud AI costs.

Bringing this to Android meant leaning on SME2 (Scalable Matrix Extension 2), an Arm CPU extension built to accelerate the matrix-heavy math behind AI inference. We extended our AI Engine, which powers the entire local AI experience of Bobium Brawlers, to support it. In practice, this gave us a fast on-device path for the language model on the CPU while leaving the GPU free for graphics and image generation, the kind of CPU/GPU teamwork our engine is designed to exploit. To use SME2 efficiently, we rely on kernels built specifically for it: some we wrote ourselves, and for the core matrix math we adopted Arm’s KleidiAI micro-kernels to great effect. These kernels work directly on the quantised model: the 4-bit weights are never expanded back to full precision, and the math runs as integer dot products, saving both time and memory. KleidiAI ends up handling the large majority of the model’s matrix multiplications (95% of the matmul work in our measurements). We focused on what surrounds them: fusing each transformer layer into a single pass and tiling the work across CPU cores to squeeze out the best performance for the game.
Big thanks to the ARM team for collaborating with us on this; you can read their deeper technical write-up here.
But let’s start from the beginning: how do we use AI in Bobium Brawlers as the core of the experience?
AI as part of the game loop
Bobium Brawlers utilizes AI in three different ways:
- A small language model generates the structured card and deck data
- An image model paints the creature image
- Embedding classifiers check what players type against our content guardrails

Deck and art generation can be staged behind a loading animation or get prepped while the player is doing something else. Moderation can’t. It has to answer while you type, responding in under 200ms or the experience kinda breaks. So we run that first when the player asks for a creature and if it passes guardrails we run the card deck and image generation in parallel.
Our AI Engine runs as part of the game: sharing resources, scheduling work around rendering and deciding which processor each model should use. This is important because, contrary to running a sidecar process, we can coordinate access to memory and computational resources and avoid impacting rendering.
Running Bobium Brawlers and our AI Engine on Android taught us a few lessons:
- Smaller language models ran faster on the SME2 CPU than on the GPU for generation. For bigger models, the win was a split, while the GPU was faster on prefill, which takes more advantage of parallelization.
- Image generation stayed on the GPU. Even after we cut CPU generation time to 16 seconds from 46, the GPU was still the right call. It was simply the fastest for the use case and allowed us to run the SLM generation on the CPU at the same time, reducing wallclock time significantly.
- More CPU cores don’t automatically mean more speed. Memory bandwidth became the ceiling before core count did.

The useful architectural lesson: profile the real game, put each workload where it actually performs best and optimize for the player experience. Running the CPU and GPU concurrently means we can generate the deck and the artwork at the same time, and quietly prepare level-up cards mid-battle.
On-device is a design choice and a tech flex
Pulling the cloud out of the core loop changes two things at once.
It changes the experience: you create and battle without waiting on cloud inference for every asset, and moderation is local and zippy.
It also changes the economics: a cloud-based generative game pays an inference bill every time a player creates something. The more people love it, the more it costs. On-device, we don’t pay a serving charge per creature, per deck, per moderation check.
Making that work is what our AI Engine is for. It handles where models run, how they share the GPU, and how generation and guardrails fit together on the player’s device. Bobium Brawlers is our first full demonstration of that technology in a game, but we built the engine to be reusable. The goal is to give other developers the same foundation, so they can make AI a real part of gameplay without turning every player interaction into a data center bill.
What’s next
We are currently live with our iOS closed beta. Sign up and let us know what you think! It’s likely going to be a little bit before we are ready to ship Android, but we are learning a ton as we go and we’ll keep sharing what we find.
来源:Atelico · AI 游戏开发博客 · atelico.studio