9th APAC HPC-AI 挑战赛

最终,我们取得了以下成绩:
AI: Firmus超级计算机Basic, 8.8k goodput TPS
HPC: Gadi超级计算机Basic, 416 ranks,平均步时1.98 s
Hi, I'm tsune, the captain of the Kisarazu Big Branch w/ Riken. Kisarazu Big Branch w/ Riken is the HPC team of the National Institute of Technology, Kisarazu College, Japan.
Kisarazu Big Branch w/ Riken won the Best AI Performance, which is our 2 years streak on the AI task.

This is the trophy for 8th APAC HPC-AI Competition (at SCA26, Osaka). I'll be at SCA27 Singapore. I'm looking forward to have a funny discussion with other competition participants.
Riken-RCCS supported us with HPC resources from 玄界, which has Intel Xeon Platinum 8490H CPUs and NVIDIA H100 GPUs. I am currently a trainee at Riken-RCCS and went to an internship at Riken-RCCS last year. In the internship, I optimized a trigonometric function kernel for A64Fx (富岳超级计算机在Riken-RCCS的CPU) and achieved a 16x faster trigonometric function implementation with handmade assembly. Therefore, I gained knowledge of pipeline optimization that is very useful for compute-bound application tuning. However, the HPC task, OpenFOAM-v2512, was a nightmare because of its memory access and shit matrix structure.
Also, I'm a top CTF player. ("Top" is not self-praise; I've won many CTF competitions worldwide.) I've been deeply involved in computer science and competitive programming, which I needed to maximize my brain sharp. CTF is dead, everyone says. And I think so too. You should check my other blog to see why my arguments are reliable. Therefore, I do understand what cs competition is going on. And as I expected, this year's HPC-AI Competition became the AI-slop competition.
I felt a bit bored in the middle of the competition period. The cluster queue was occupied with AI agents' jobs. Admittedly, agentic kernel optimization produced significant improvements, and the agent worked fully throughout the competition period. Doing AI slop was the smart option to win the competition. But I didn't get any sense of motivation from that. There is no academic interest.
Consuming my tokens for bug bounty is much more valuable and profitable lol. Thus, I didn't use much AI agent, just for investigating the parameters and hidden environmental configs.
Maximize Your Brain, Not Your Agent
Here's a graph for the total number of jobs each teams sent in the competition period.

We can observe the obvious AI-sloppers. 😂
Have you ever thought about what humans win over LLMs? That is obviously the context memory system. 1M context is not enough for long-term competition. I think our brain is not a bottleneck if we are smart.
Determining what to prioritize and assuming what will be a game changer are important, and we should keep them in mind in the HPC competition. If you keep participating in the HPC competition, use your brain and trust your intelligence.
OpenFOAM OCC DrivAer
I do dislike the HPC task. And I believe no one likes the HPC task in the AI era. In the most of stereotype HPC applications have negative legacy. OpenFOAM is a good example. OpenFOAM tried to make it easy for everyone to write solvers using an LDU matrix and a C++ template nightmare. However, the root cause of worse cache performance and bad memory access is at this point. In the past decade, these characteristics were valuable cuz scientists can write their own solver by themselves. It's now AI-era. Everyone can write and understand complicated C++ code, which means the difficulty of writing a solver has been not important in the recent era. Even if we optimize the mesh, the fucking unresolvable wall will block our optimization. Therefore, I'd like to ask you: is agentic optimization, such as kernel audit and kernel optimization is valurable in the context of HPC competitions? I argue not. If it succeeded, that does NOT resolve the root cause of fucking memory accessing, which means ur optimization improved OpenFOAM from shit to shit. If kernel optimization is allowed, we should use an alternative simulation application. Optimization on negative legacy is just a waste of time. Therefore, OpenFOAM optimization didn't motivate us.
Thus, I'd like to omit explanation of OpenFOAM.
Qwen 3
Qwen is a family of large language models from Alibaba. The model specified for this task, Qwen3-235B-A22B, is an open-weight model and the first Qwen series to adopt QK-Norm and to drop shared experts. It is an MoE architecture with GQA, 94 layers, and 128 experts. The model is about 236 GB, so it doesn't fit on typical consumer GPUs. It is literally a large language model.
In the benchmark, one request consists of 4000 input tokens and 200 output tokens, measured by AIPerf.

We adopted SGLang as the inference framework cuz SGLang is only the inference framework for HPC that natively supports disaggregated prefill decode. Dynamo targets k8s, the combination of dynamo and jobscript is shit.

Here is our optimization plan, you can understand why we carried out with this plan.
PD disaggregation
Transformer LLM inference is split into two phases, Prefill and Decode. Only the KV cache is transferred between them. This task required PD disaggregation, an inference architecture that serves Prefill and Decode on physically separate GPUs.

PD disaggregation was originally designed to assign different compute resources to Prefill and Decode. In Transformer LLMs, Prefill is compute-bound and Decode is memory-bound. For example, the H100 and H200 have the same number of SMs, so you could use H100s for Prefill and H200s, with more memory headroom, for Decode. In this competition, however, both Prefill and Decode ran on H200s.
We first calculated the serving cost from the Qwen3 specification. As mentioned above, the weights alone are 236 GB, so Tensor Parallelism across two or more H200s was required. We chose an architecture that runs TP=2 for both Prefill and Decode and scales it out with Data Parallelism. The KV cache size can be calculated deterministically from Qwen's dimensions and layer count. From these, we calculated values such as the maximum number of tokens the decode side can hold.
The benefit of PD disaggregation is that Prefill and Decode can be optimized independently. For example, a Prefill-heavy PD ratio gives a pure TTFT improvement. Likewise, ITL can be optimized independently on the Decode side.
Calculations
Since input and output token length were specified, we could calculate the inference specifications, such as the size of KV cache, and the TP requirements.

The single kv-cache is not large, only 94KiB/Token. We can estimate that kv-transfer will not be a bottlneck at inference. Also, we can calculate the size of max KV cache per request, which can determine the max concurrency from the decode free GPU memory.
Baseline
We benchmarked Qwen3 with PD-disaggregation, which crafted with 8tp for both prefill and decode.

We can observe the sparse prefill GPU usage during the benchmarking. Also, we can see very tight GPU memories. But this is not useful information. This profiliing data were collected by our custom profiler named GPU monitor which uses nvidia-smi for GPU monitoring. SGLang books 90% of freed GPU memory as KV cache pool as a default (this is what we can specify using mem-fraction-static args). Therefore, we cannot observe real freed GPU memory using nvidia-smi. Instead, we need to check SGLang's log for real KV cache pool. And ofc we should NOT use mem-fraction-static in this competition cuz the size of tokens are completely calculatable.
Decode
We optimized Decode first, for a simple reason: Decode performance determines the maximum concurrency. This track had strict TTFT and ITL limits. Average TTFT had to be under 3000 ms and average ITL 20 ms or less. Only requests meeting these limits counted as goodput. The performance metric was goodput-only tokens/s, and goodput requests also had to make up at least 90% of all requests. These strict requirements make the benchmark closer to real-world serving. For example, increasing concurrency improves overall TPS, but ITL grows with it. Similarly, a huge prefill batch size increases parallelism per batch and improves performance by reducing overhead, but TTFT gets worse. TTFT and ITL therefore matter for guaranteeing acceptable performance for each request.
Decode has a technique called Speculative Decoding, where a small dense model serves as a draft model and predicts tokens. The main model verifies the tokens predicted by the draft model, so accuracy is not degraded. We adopted Speculative Decoding as our first optimization step, because whether you use it changes the number of FFN passes per step. That decision had to come before any profiling to identify the bottleneck. In the first half of the competition we used a 0.6B draft model trained with LMSYS's SpecForge. In the second half we used a 0.6B draft model published by Nebius, trained with LK-loss.
LMSYS draft model: https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-235B-A22B-Instruct-2507-SpecForge-Meituan
Nebius draft model: https://huggingface.co/nebius/EAGLE3-Qwen3-235B-A22B-Instruct-2507
Qwen3 Inference workload block

Qwen3 Inference workload with Eagle3 speculative decoding block

Next, we profiled the decode GPUs with NVIDIA Nsight Systems. We mapped the enormous number of CUDA Graphs in a batch down to architecture-level components such as GQA, RMSNorm, and Embedding. Verifying the speculative tokens consumed 2700 CUDA Graphs (about 99.25% of the batch), and the MoE kernel within it was the bottleneck. Keeping Amdahl's law in mind is the most important thing when optimizing. There is a parameter to change the draft model's attention backend. But would swapping a kernel that takes less than 1% of the batch be a game changer? Of course not. We always aimed for profiling-driven optimization and kept the problem-solving loop effective and efficient. To improve the MoE computation, we adopted DP-attention and benchmarked MoE backends including MegaMoE, DeepGEMM, HPC-Ops, and Triton. We chose MegaMoE and ran DP-attention across two DP ranks. This halved the MoE computation per GPU and processed tokens with faster CUDA kernels. In the end, 4 decode GPUs served 216 concurrent requests while ITL still had headroom.
mapping of CUDA graph and decode kernels

(Re)Qwen3 Inference workload with Eagle3 speculative decoding block

exact statistics of CUDA graphs

Prefill
For Prefill, we profiled first as well. The MoE kernel took about 45% of the batch, and NCCL AllReduce took 11%, so communication was also somewhat of a bottleneck. Looking at the FFN layers, the MoE kernel's CUDA Graph latency differed by about 2 ms between GPUs. NCCL AllReduce was waiting on this synchronization, which inflated its share. The NCCL AllReduce itself took only about 0.2 ms, so the dominant factor was the MoE kernel time gap caused by Expert Parallelism imbalance.
Based on this, we used EPLB with a static placement to replicate frequently routed experts on both GPUs of the TP group, and confirmed a Prefill performance improvement.
We also applied DP-attention to Prefill and increased the batch size as far as TTFT allowed, so Prefill could process more requests in parallel.
We further fused multiple CUDA Graphs to reduce CUDA Graph launch overhead and tuned MegaMoE. Without a single kernel patch, we reached 8.8k goodput TPS.


Final topology
Our final setup used 12 GPUs for Prefill and 4 GPUs for Decode. Prefill ran three TP=2, DP=2 DP-attention workloads, and Decode ran one TP=2, DP=2 DP-attention workload. Both Prefill and Decode were highly optimized, and TTFT and ITL both met the competition's strict limits.
With this performance, we took first place in the AI track.

https://gist.github.com/Yayoi-cs/6de3ba56dfc086bd85172b74eadc3039
Our job script is very simple and has no kernel patching. But won the best AI performance award this year. Thanks to the HPC-AI Advisory council for deciding to reproduce each team's job script without kernel patching allowance.
Future work
We didn't compare KV-cache transfer backends because a single KV cache is tiny, so that we can easily estimate that KV transfer won't be a bottleneck. However, it was an actual part of improving TTFT. In fact, most of SLA fail was occured in the first request. to minimalize those TTFT, we should compare the kv-cache backend and should try to minimalize latency.
People from NVIDIA asked me that did we use NIXL for kv-cache transfer backend, and I realized this point.
