메뉴
HN
Hacker News • 34일 전

AI 칩 아키텍처의 혁명

IMP
7/10
핵심 요약

헤네시와 패터슨이 2018년 튜링 강연에서 예측한 '컴퓨터 아키텍처의 캄브리아 폭발'이 실제로 현실화되어 현재 GPU, TPU, LPU, NPU, 웨이퍼 스케일 엔진 등 수십 종의 AI 전용 칩 아키텍처가 개발 경쟁 중입니다. 이 글은 AI 연산의 핵심인 행렬 곱셈과 메모리 월(memory wall) 문제를 중심으로 각 아키텍처의 철학, 구조, 확장 방식, 소프트웨어 스택을 비교 분석합니다. 실제 배포에서는 NVIDIA GPU가 압도적 선두를 달리고 있으며, Google TPU, AWS Trainium, Cerebras, Groq LPU 등이 뒤를 잇고 있습니다.

번역된 본문

2018년 국제 컴퓨터 아키텍처 심포지엀(ISCA)에서 존 헤네시(John Hennessy)와 데이비드 패터슨(David Patterson)은 '컴퓨터 아키텍처의 새로운 황금기'라는 제목의 튜링 강연을 진행했습니다. 1980년대, 헤네시와 패터슨이 튜링상을 수상한 연구를 수행할 당시, 단일 스레드 CPU 성능은 연간 52%씩 성장했습니다. 그러나 2018년까지 무어의 법칙과 데나드 스케일링의 종료와 함께 그 성장률은 3%로 떨어졌습니다. 이로 인해 도메인 특화 아키텍처(DSA)가 필요해졌습니다. 그들의 대표 사례는 이미 생산 중이던 구글의 TPU v1이었습니다. 신경망 추론에서 CPU 대비 29배의 처리량과 80배의 에너지 효율을 달성했습니다. 강연의 마무리 예측은 이러했습니다: "다음 10년은 새로운 컴퓨터 아키텍처의 캄브리아 폭발을 목격할 것이다." 이 예측은 실현되었습니다. 오늘날 수십 개의 아키텍처가 본격적으로 개발되고 있습니다. GPU, TPU, LPU, NPU, DPU, ASIC, 웨이퍼 스케일 엔진, 재구성 가능한 데이터플로우, 뉴로모픽, 포토닉, 아날로그 등입니다. 특히 이러한 아키텍처들은 AI 연산에 초점을 맞추고 있습니다. 지금까지 실제 배포에 성공한 아키텍처는 GPU(NVIDIA, AMD), систolic-array 가속기(TPU, Trainium), Cerebras 웨이퍼 스케일 엔진, 그리고 Groq LPU입니다. NVIDIA가 명확한 선두 주자이며, AMD가 그 뒤를 따르고 있습니다. AMD는 OpenAI와 Meta로부터 각각 6GW 규모의 공급 계약을 확보했습니다. TPU는 Gemini를 학습시키고 있으며 Anthropic에 최대 100만 개의 칩을 공급할 예정입니다. Anthropic은 또한 100만 개 이상의 Trainium 칩에서 Claude를 운영하고 있습니다. Cerebras는 현재 OpenAI의 추론을 담당하고 있으며, Groq LPU는 200억 달러 규모의 인수 채용(acquihire)을 통해 NVIDIA에 흡수되었습니다. 이 글은 이러한 다양한 접근 방식을 조사하는 것을 목표로 합니다. 각 아키텍처의 철학, 구조, 확장 방법(스케일업과 스케일아웃), 소프트웨어 스택(칩을 어떻게 프로그래밍하는지)을 다룹니다.

문제

AI 연산은 행렬 곱셈(matrix multiplication)이 지배합니다. 트랜스포머는 행렬 곱셈의 연속입니다. Q/K/V 프로젝션, 어텐션, 출력 프로젝션, FFN이 요소별 연산(정규화, 활성화 함수, 잔차 덧셈)과 교차로 이어집니다. 프론티어 모델을 학습시키는 것은 10^25개의 곱셈-누산(multiply-accumulate) 연산을 수행하는 것입니다(행렬 곱셈은 곱셈-누산의 연속입니다). 이러한 행렬 곱셈의 형태는 워크로드에 따라 달라집니다.

학습(training)은 배치 단위의 시퀀스를 모든 레이어를 통해 순전파하고, 손실을 역전파하며, 가중치를 업데이트합니다. 수천 개의 토큰이 동시에 동일한 가중치 행렬을 통과합니다. Prefill은 추론의 프롬프트 처리 단계로, 첫 번째 출력 토큰이 생성되기 전에 전체 입력 시퀀스를 한 번에 모델에 통과시키는 것입니다. 학습과 prefill 모두 동일한 가중치 행렬에 많은 토큰을 쌓아 올리므로, 각 레이어의 연산은 대규모 행렬-행렬 곱셈(GEMM)이 되며 높은 산술 강도(arithmetic intensity)를 가집니다(연산 병목, compute-bound).

Decode는 자기회귀적(autoregressive)입니다. 모델은 한 번에 토큰을 하나씩 생성하며, 각 토큰은 이전의 모든 토큰에 조건을 둡니다. 토큰 N이 생성되기 전까지는 토큰 N+1을 시작할 수 없습니다. 단계마다 하나의 토큰만 프로젝션되므로, 모든 행렬 곱셈이 행렬-벡터 곱셈(GEMV)이 됩니다. 토큰 하나를 생성하려면 모델의 모든 가중치에 대한 전체 순회와, 어텐션을 위한 KV 캐시의 전체 읽기가 필요합니다. 산술 강도는 prefill 대비 몇 자릿수 떨어집니다.

추론 시스템은 토큰을 배칭하여 GEMV를 다시 GEMM으로 격상시킴으로써 이러한 강도를 일부 회복합니다. 연속 배칭(continuous batching)은 여러 사용자의 decode 단계를 쌓고, 스페큘러티브 디코딩(speculative decoding)은 요청당 K개의 초안 토큰을 생성해 한 번에 검증하며, 멀티 토큰 예측(multi-token prediction)은 같은 기법을 모델 내부에 적용합니다. 이를 통해 행렬 곱셈 유닛의 활용도를 높이고 Ops/B를 끌어올립니다. 연속 배칭의 경우 각 사용자의 요청은 여전히 자신의 KV 캐시를 읽어야 하므로, 긴 컨텍스트 decode는 가중치 대역폭 병목에서 KV 대역폭 병목으로 이동합니다.

여기서 아키텍처 문제는 행렬 곱셈이 일어나는 곳으로 데이터를 충분히 빠르게 이동시키는 것입니다. 이것이 바로 메모리 월(memory wall)로 알려진 문제입니다. 연산 성능은 지수적으로 향상되었지만 메모리 대역폭은 그렇지 못했습니다. 각 아키텍처는 이 데이터 이동 게임에서 이기기 위한 서로 다른 전략을 제시합니다. 칩을 이해하는 것은 네 가지 질문으로 귀결됩니다. 데이터는 어디에 저장되는가, 데이터는 어떻게 이동하는가.

원문 보기
원문 보기 (영어)
At the 2018 International Symposium on Computer Architecture , John Hennessy and David Patterson delivered their Turing Lecture: "A New Golden Age for Computer Architecture" . In the 1980s, when Hennessy and Patterson did their Turing Award-winning research, single-threaded CPU performance grew 52% a year. By 2018, with the end of Moore's Law and Dennard Scaling , the rate was 3%. There was a need for domain-specific architectures (DSAs). Their worked example was Google's TPU v1 , already in production: 29× the throughput of a CPU on neural-network inference, at 80× better energy efficiency. The closing prediction: "the next decade will see a Cambrian explosion of novel computer architectures." This prediction came true. Today, we now have dozens of architectures in serious development. GPUs , TPUs , LPUs , NPUs , DPUs , ASICs , wafer-scale engines , reconfigurable dataflow , neuromorphic , photonic , analog . Particularly, these architectures focus on compute for AI . The architectures that have won real deployment so far: GPUs (NVIDIA, AMD), systolic-array accelerators (TPU, Trainium), the Cerebras Wafer-Scale Engine , and the Groq LPU . NVIDIA is the clear frontrunner; AMD follows, with 6 GW commitments from both OpenAI and Meta . TPUs train Gemini and will serve Anthropic with up to a million chips ; Anthropic also runs Claude on over a million Trainium chips . Cerebras now serves OpenAI inference ; the Groq LPU was folded into NVIDIA via a $20B acquihire . This post aims to survey these varying approaches - their philosophy , architecture , scaling methods (scale-up and scale-out) , and software stack (how you program the chip) . The Problem AI compute is dominated by matrix multiplication . A transformer is a sequence of matmuls: Q/K/V projection , attention , output projection , FFN - interleaved with element-wise ops: normalisation, activation, residual adds. Training a frontier model performs 10 25 10^{25} 1 0 25 multiply-accumulate operations (matmuls are a sequence of multiply-accumulates). The shape of those matmuls depends on the workload. Training pushes a batch of sequences forward through every layer, backpropagates the loss, and updates the weights, with thousands of tokens flowing through the same weight matrix at once. Prefill is the prompt-ingestion phase of inference: the full input sequence projected through the model in a single pass, before the first output token has been produced. Both training & prefill stack many tokens against the same weight matrix, so each layer's math is a large matrix-matrix multiply (GEMM), with high arithmetic intensity (compute-bound). Decode is autoregressive: the model emits one token at a time, each conditioned on every token before it, and token N+1 cannot begin until token N has been produced. Only one token gets projected per step, so every matmul becomes a matrix-vector product (GEMV). Producing one token requires a full pass over every weight in the model, plus a full read of the KV Cache for attention. Arithmetic intensity drops by orders of magnitude versus prefill . Inference systems recover some of that intensity by batching tokens to promote those GEMVs back to GEMMs: continuous batching stacks many users' decode steps, speculative decoding stacks K drafted tokens per request and verifies them in one pass, and multi-token prediction folds the same trick inside the model itself. This achieves higher utilisation of the matmul units, and pushes up the Ops/B. For continuous batching, each user's request still reads its own KV Cache , so long-context decode shifts from weight-bandwidth-bound to KV-bandwidth-bound. The architecture problem here is moving the numbers to where the matmuls happens fast enough. This is known as the memory wall : compute has scaled exponentially, memory bandwidth has not. Each architecture proposes a different strategy for winning the data-movement game. Understanding a chip reduces to four questions: where does data live , how does it move to the compute units, what do the compute units look like, and how do chips talk to each other at scale . NVIDIA GPU The NVIDIA GPU is a massively parallel processor . The philosophy is that a programmable chip with thousands of threads, orchestrated by a host CPU and exposed through CUDA , is the right machine to run parallelisable workloads. Each generation adds acceleration primitives onto programmable Streaming Multiprocessors without changing the programming model. The same chip trains transformers, serves inference, renders graphics, and runs scientific simulation ( accelerated computing ).