컴백부터 K-뷰티까지 — K-컬쳐의 모든 것을 메일로 받아보세요메일로 받아보기

METAL MEDIA

최신 GPU 명령어까지 직접 다룰 줄 아는 AI, 아직은 반쪽짜리다

arXiv:2608.173792026-08-17

PTXBench: Benchmark and Adapt LLMs for GPU Kernel Optimization with Architecture-specific PTX

최신 GPU 명령어까지 직접 다룰 줄 아는 AI, 아직은 반쪽짜리다

PTXBench는 AI 모델이 엔비디아 최신 GPU(H100, B200)의 저수준 명령어(PTX)를 직접 써서 빠른 커널 코드를 짤 수 있는지 측정하는 벤치마크다. 연구팀은 GEMM(행렬곱)과 어텐션 연산에서 여러 모델을 테스트한 결과, 정방향 연산은 곧잘 성공하지만 역방향 어텐션 연산에서는 성공률이 크게 떨어지고, 목표 명령어를 실행한다고 해서 꼭 빠른 것도 아니라는 점을 발견했다. 추가로 Qwen3.6-27B 모델을 학습시켜 개선을 시도했으나, 데이터 구성과 문제 균형, 그리고 답을 가르쳐주는 교사 모델의 품질에 따라 결과가 들쭉날쭉했다.

METAL MEDIA 해설 도표

최신 GPU 명령어까지 직접 다룰 줄 아는 AI, 아직은 반쪽짜리다

  1. 01PTX(엔비디아 GPU를 가장 낮은 수준에서 직접 제어하는 프로그래밍 인터페이스)를 AI가 얼마나 잘 다루는지 측정하는 PTXBench라는 벤치마크를 만들었다
  2. 02모델에게 GPU 아키텍처 지식을 주고 CUDA 커널 코드를 여러 번 고쳐 쓰게 하면서, 코드가 맞는지, 목표 명령어가 실제로 실행되는지, cuBLAS 같은 최고 성능 라이브러리보다 빠른지를 각각 따로 측정했다
  3. 03Gemini 3.1 Pro, Claude Opus 4.8, GLM-5.2, Qwen3.6-27B 등을 테스트한 결과, 정방향 연산에서는 성공하지만 복잡한 역방향 어텐션에서는 실패율이 크게 높아졌고, 목표 명령어 실행에 성공해도 항상 빠른 코드는 아니었다
  4. 04Fixit이라는 방법으로 실패 사례와 교사 모델의 수정본을 학습 데이터로 만들어 Qwen3.6-27B를 미세조정했더니 일부 과제는 개선됐지만, 새로운 문제 유형으로는 잘 일반화되지 않았다
  5. 05학습 데이터의 양보다 문제 종류를 골고루 담았는지, 균형이 맞는지, 그리고 정답 풀이를 가르쳐주는 교사 모델의 실력이 결과에 더 큰 영향을 미쳤다
METAL MEDIA이 원문을 바탕으로 재구성한 해설 도표이며, 논문 저자의 원문 figure가 아닙니다.

무엇을 했나

  1. PTX(엔비디아 GPU를 가장 낮은 수준에서 직접 제어하는 프로그래밍 인터페이스)를 AI가 얼마나 잘 다루는지 측정하는 PTXBench라는 벤치마크를 만들었다
  2. 모델에게 GPU 아키텍처 지식을 주고 CUDA 커널 코드를 여러 번 고쳐 쓰게 하면서, 코드가 맞는지, 목표 명령어가 실제로 실행되는지, cuBLAS 같은 최고 성능 라이브러리보다 빠른지를 각각 따로 측정했다
  3. Gemini 3.1 Pro, Claude Opus 4.8, GLM-5.2, Qwen3.6-27B 등을 테스트한 결과, 정방향 연산에서는 성공하지만 복잡한 역방향 어텐션에서는 실패율이 크게 높아졌고, 목표 명령어 실행에 성공해도 항상 빠른 코드는 아니었다
  4. Fixit이라는 방법으로 실패 사례와 교사 모델의 수정본을 학습 데이터로 만들어 Qwen3.6-27B를 미세조정했더니 일부 과제는 개선됐지만, 새로운 문제 유형으로는 잘 일반화되지 않았다
  5. 학습 데이터의 양보다 문제 종류를 골고루 담았는지, 균형이 맞는지, 그리고 정답 풀이를 가르쳐주는 교사 모델의 실력이 결과에 더 큰 영향을 미쳤다
Figure 1: Overview of the PTXBench benchmark and adaptation workflow.
Figure 1: Overview of the PTXBench benchmark and adaptation workflow.
Table 1: Target-instruction and unrestricted turn correctness rates (%) on H100 and B200.
GPUModelGEMMMHA-FwdMHA-Fwd-CausalMHA-BwdMHA-Bwd-Causal
H100Gemini 3.1 Pro33.3 / 60.4 / 56.2 (33.3 / 62.5 / 59.4)33.3 / 39.6 / 45.8 (33.3 / 39.6 / 45.8)25.0 / 52.1 / 55.2 (25.0 / 52.1 / 55.2)8.3 / 33.3 / 38.5 (8.3 / 33.3 / 38.5)– / 22.9 / 25.0 (8.3 / 25.0 / 26.0)
Claude Opus 4.891.7 / 95.8 / 94.8 (91.7 / 95.8 / 94.8)50.0 / 81.2 / 90.6 (66.7 / 89.6 / 94.8)50.0 / 77.1 / 75.0 (83.3 / 89.6 / 82.3)8.3 / 62.5 / 79.2 (50.0 / 83.3 / 89.6)– / 22.9 / 44.8 (25.0 / 41.7 / 59.4)
GLM-5.233.3 / 60.4 / 61.5 (33.3 / 62.5 / 62.5)16.7 / 8.3 / 8.3 (16.7 / 14.6 / 15.6)– / 8.3 / 10.4 (8.3 / 16.7 / 17.7)8.3 / 6.2 / 5.2 (8.3 / 18.8 / 16.7)– (– / 22.9 / 15.6)
Qwen3.6-27B
B200Gemini 3.1 Pro8.3 / 47.9 / 45.8 (8.3 / 47.9 / 45.8)– / 12.5 / 15.6 (– / 12.5 / 15.6)– / 8.3 / 10.4 (8.3 / 12.5 / 12.5)– / 2.1 / 2.1 (– / 2.1 / 2.1)– (– / 2.1 / 1.0)
Claude Opus 4.825.0 / 64.6 / 80.2 (75.0 / 81.2 / 88.5)– / 20.8 / 38.5 (83.3 / 87.5 / 86.5)– / 16.7 / 32.3 (91.7 / 77.1 / 83.3)– / 6.2 / 10.4 (83.3 / 89.6 / 91.7)– (25.0 / 52.1 / 68.8)
GLM-5.216.7 / 27.1 / 28.1 (33.3 / 37.5 / 34.4)– / – / 1.0 (33.3 / 22.9 / 26.0)8.3 / 2.1 / 1.0 (33.3 / 22.9 / 25.0)– (8.3 / 25.0 / 30.2)– (16.7 / 18.8 / 22.9)
Qwen3.6-27B– (– / – / 1.0)
Figure 2: FastpInst. on H100 (top) and B200 (bottom).
Figure 2: FastpInst. on H100 (top) and B200 (bottom).
Table 2: Model release dates, knowledge cutoffs, and estimated calendar lag from the release of Hopper PTX ISA 8.0 (Dec. 2022) and Blackwell PTX ISA 8.7 (Jan. 2025) [26, 29]. Lags use monthly granularity, from PTX release to disclosed cutoff; otherwise, model release dates provide upper bounds.
ModelModel releaseKnowledge cutoffLag after PTX release (months)
HopperBlackwell
Gemini 3.1 ProFeb. 2026Jan. 202525≈0
Claude Opus 4.8May 2026Jan. 20263712
GLM-5.2June 2026Not disclosed≤42≤17
Qwen3.6-27BApr. 2026Not disclosed≤40≤15
Figure 3: Gemini 3.1 Pro Fastp distributions for Triton and CUDA-PTX on H100 and B200.
Figure 3: Gemini 3.1 Pro Fastp distributions for Triton and CUDA-PTX on H100 and B200.
Table 3: Ablation of architecture-specific prompt knowledge for Gemini 3.1 Pro.
Prompt knowledgeTarget inst. correctness (%) (turn correctness)Target inst. best speedup (best speedup)
Architecture parameters– (50.0 / 29.2 / 26.0)– (0.056 / 0.119 / 0.273)
Architecture parameters + PTX template functions– / 20.8 / 19.8 (– / 20.8 / 19.8)– / 0.542 / 0.542 (– / 0.542 / 0.542)
Architecture parameters + PTX template functions + architecture contract8.3 / 33.3 / 38.5 (8.3 / 33.3 / 38.5)0.206 / 0.375 / 0.515 (0.206 / 0.375 / 0.515)
Figure 4: Training data recipes. Pie area is proportional to record count, and slices show the fraction drawn from each problem. The top shows labels for the checkpoints; the bottom line lists training formats and reasoning teachers.
Figure 4: Training data recipes. Pie area is proportional to record count, and slices show the fraction drawn from each problem. The top shows labels for the checkpoints; the bottom line lists training formats and reasoning teachers.
Table 4: Target-instruction and unrestricted turn correctness rates (%) under SFT and prompt-time supervision.
ConditionMHA-FwdMHA-Fwd-CausalMHA-BwdMHA-Bwd-Causal
Qwen3.6-27B w/o expert guidance
Qwen3.6-27B
Qwen3.6-27B-s1 w/o expert guidance– / – / 4.2 (– / – / 4.2)– / – / 4.2 (– / – / 4.2)– / 4.2 / 3.1 (– / 4.2 / 3.1)
Qwen3.6-27B-s116.7 / 16.7 / 19.8 (16.7 / 16.7 / 19.8)– / – / 3.1 (– / – / 3.1)– / 2.1 / 4.2 (– / 2.1 / 4.2)– / 2.1 / 4.2 (– / 2.1 / 5.2)
Qwen3.6-27B + retrieved repair notes
Qwen3.6-27B + retrieved repair notes and fixed kernel– / 29.2 / 29.2 (– / 29.2 / 29.2)– / 20.8 / 27.1 (– / 20.8 / 27.1)– / 14.6 / 18.8 (– / 14.6 / 20.8)– / 20.8 / 33.3 (– / 25.0 / 37.5)
Figure 5: SFT training data recipe comparison (complete results in Appendix Tables 8 and 9).
Figure 5: SFT training data recipe comparison (complete results in Appendix Tables 8 and 9).
Table 5: Selected SASS families for target instruction measurement.
GPUTagSelected SASS family
H100 (Hopper)H*GMMA tensor compute; UTMALDG, UTMASTG, and UTMAREDG TMA payload transfer
B200 (Blackwell)BUTC*, LDTM, and STTM from the TCGEN05 tensor pathway
Figure 6: Correctness and speedup of Qwen3.6-27B-s1 on the training and held-out problems.
Figure 6: Correctness and speedup of Qwen3.6-27B-s1 on the training and held-out problems.
Table 6: Token counts for architecture-specific prompt components.
GPUComponentTokens
H100Architecture parameter259
Template functions18,601
Architecture contract3,454
Total22,314
B200Architecture parameter413
Template functions18,871
Architecture contract9,531
Total28,815
Figure 7: How Fixit SFT changes reasoning length and error types across turns.
Figure 7: How Fixit SFT changes reasoning length and error types across turns.
Table 7: Best speedup with target instruction execution on H100 and B200.
GPUModelGEMMMHA-FwdMHA-Fwd-CausalMHA-BwdMHA-Bwd-Causal
H100Gemini 3.1 Pro0.687 / 0.934 / 0.962 (0.687 / 0.934 / 0.962)0.555 / 0.730 / 0.730 (0.555 / 0.730 / 0.730)0.614 / 0.651 / 0.768 (0.614 / 0.651 / 0.768)0.206 / 0.375 / 0.515 (0.206 / 0.375 / 0.515)– / 0.634 / 0.639 (0.065 / 0.634 / 0.639)
Claude Opus 4.80.770 / 0.968 / 0.976 (0.770 / 0.968 / 0.976)0.759 / 0.770 / 0.839 (0.759 / 0.770 / 0.839)0.758 / 0.806 / 0.806 (0.758 / 0.806 / 0.806)0.300 / 0.440 / 0.489 (0.300 / 0.440 / 0.489)– / 0.499 / 0.499 (0.058 / 0.499 / 0.499)
GLM-5.20.447 / 0.692 / 0.692 (0.447 / 0.692 / 0.692)0.407 / 0.470 / 0.607 (0.407 / 0.470 / 0.607)– / 0.471 / 0.533 (0.015 / 0.471 / 0.533)0.316 / 0.437 / 0.437 (0.316 / 0.437 / 0.437)– (– / 0.101 / 0.101)
Qwen3.6-27B
B200Gemini 3.1 Pro0.273 / 0.680 / 0.892 (0.273 / 0.680 / 0.892)– / 0.280 / 0.280 (– / 0.280 / 0.280)– / 0.206 / 0.248 (0.013 / 0.206 / 0.248)– / 0.087 / 0.133 (– / 0.087 / 0.133)– (– / 0.015 / 0.015)
Claude Opus 4.80.782 / 1.012 / 1.012 (0.782 / 1.012 / 1.012)– / 0.253 / 0.300 (0.110 / 0.253 / 0.300)– / 0.232 / 0.269 (0.042 / 0.232 / 0.269)– / 0.069 / 0.149 (0.022 / 0.136 / 0.155)– (0.023 / 0.088 / 0.116)
GLM-5.20.162 / 0.632 / 0.632 (0.162 / 0.632 / 0.632)– / – / 0.027 (0.024 / 0.024 / 0.035)0.098 / 0.098 / 0.098 (0.098 / 0.098 / 0.098)– (0.019 / 0.030 / 0.040)– (0.018 / 0.034 / 0.034)
Qwen3.6-27B– (– / – / 0.006)
Figure 8: Cross-language transfer of Fixit SFT from CUDA-PTX to Triton on Hopper.
Figure 8: Cross-language transfer of Fixit SFT from CUDA-PTX to Triton on Hopper.
Table 8: Turn correctness rates for the five-problem SFT evaluation.
SFT-ed Model LabelGEMMMHA-FwdMHA-Fwd-CausalMHA-BwdMHA-Bwd-Causal
Qwen3.6-27B-s0– / 6.2 / 5.2 (– / 6.2 / 5.2)– / 2.1 / 1.0 (– / 2.1 / 1.0)– / – / 1.0 (– / – / 1.0)
Qwen3.6-27B-s125.0 / 14.6 / 13.5 (25.0 / 14.6 / 13.5)16.7 / 16.7 / 19.8 (16.7 / 16.7 / 19.8)– / – / 3.1 (– / – / 3.1)– / 2.1 / 4.2 (– / 2.1 / 4.2)– / 2.1 / 4.2 (– / 2.1 / 5.2)
Qwen3.6-27B-s2– / 2.1 / 2.1 (– / 2.1 / 2.1)– / 2.1 / 5.2 (– / 2.1 / 5.2)– / – / 1.0 (– / – / 1.0)– / – / 1.0 (– / – / 1.0)
Qwen3.6-27B-s3– / 2.1 / 3.1 (– / 2.1 / 3.1)– / 4.2 / 2.1 (– / 4.2 / 2.1)– / 6.2 / 4.2 (– / 6.2 / 4.2)– / 4.2 / 4.2 (– / 4.2 / 4.2)
Qwen3.6-27B-s48.3 / 8.3 / 10.4 (8.3 / 8.3 / 10.4)– / – / 4.2 (– / – / 4.2)– / 4.2 / 2.1 (– / 4.2 / 2.1)– / – / 1.0 (– / – / 1.0)
Qwen3.6-27B-s516.7 / 14.6 / 12.5 (16.7 / 14.6 / 12.5)– / 2.1 / 4.2 (– / 2.1 / 4.2)– / 2.1 / 3.1 (– / 2.1 / 3.1)– / – / 5.2 (– / – / 5.2)– / – / 4.2 (– / – / 4.2)
Qwen3.6-27B-s68.3 / 2.1 / 1.0 (8.3 / 2.1 / 1.0)
Figure 9: Turn-level error-state transitions for GEMM.
Figure 9: Turn-level error-state transitions for GEMM.
Table 9: Best speedups for the five-problem SFT evaluation.
SFT-ed Model LabelGEMMMHA-FwdMHA-Fwd-CausalMHA-BwdMHA-Bwd-Causal
Qwen3.6-27B-s0– / 0.589 / 0.589 (– / 0.589 / 0.589)– / 0.644 / 0.644 (– / 0.644 / 0.644)– / – / 0.209 (– / – / 0.209)
Qwen3.6-27B-s10.303 / 0.303 / 0.340 (0.303 / 0.303 / 0.340)0.556 / 0.556 / 0.565 (0.556 / 0.556 / 0.565)– / – / 0.395 (– / – / 0.395)– / 0.380 / 0.389 (– / 0.380 / 0.389)– / 0.192 / 0.199 (– / 0.192 / 0.199)
Qwen3.6-27B-s2– / 0.209 / 0.211 (– / 0.209 / 0.211)– / 0.548 / 0.548 (– / 0.548 / 0.548)– / – / 0.315 (– / – / 0.315)– / – / 0.296 (– / – / 0.296)
Qwen3.6-27B-s3– / 0.274 / 0.280 (– / 0.274 / 0.280)– / 0.465 / 0.465 (– / 0.465 / 0.465)– / 0.388 / 0.388 (– / 0.388 / 0.388)– / 0.494 / 0.494 (– / 0.494 / 0.494)
Qwen3.6-27B-s40.276 / 0.373 / 0.373 (0.276 / 0.373 / 0.373)– / – / 0.452 (– / – / 0.452)– / 0.383 / 0.383 (– / 0.383 / 0.383)– / – / 0.199 (– / – / 0.199)
Qwen3.6-27B-s50.325 / 0.446 / 0.446 (0.325 / 0.446 / 0.446)– / 0.425 / 0.573 (– / 0.425 / 0.573)– / 0.241 / 0.246 (– / 0.241 / 0.246)– / – / 0.295 (– / – / 0.295)– / – / 0.246 (– / – / 0.246)
Qwen3.6-27B-s60.073 / 0.073 / 0.073 (0.073 / 0.073 / 0.073)
Figure 10: FastpInst. under SFT and prompt-time supervision.
Figure 10: FastpInst. under SFT and prompt-time supervision.
Table 10: Training data recipes.
SFT-ed Model LabelConfigTemplateReasoning SynthesizerRecord Count
Qwen3.6-27B-s08ops-ExtendedKernelGenGLM-5.2494
Qwen3.6-27B-s14opsFixitGLM-5.2158
Qwen3.6-27B-s24ops-ExtendedFixitGLM-5.2259
Qwen3.6-27B-s38ops-ExtendedFixitGLM-5.2406
Qwen3.6-27B-s48ops-Post-balancedFixitGLM-5.2170
Qwen3.6-27B-s58ops-Pre-balancedFixitGLM-5.2258
Qwen3.6-27B-s68ops-Pre-balancedFixitQwen3.6-27B258
Figure 11: Detailed execution infrastructure supporting PTXBench. MiniPTXAgent compiles generated CUDA–PTX locally and sends successfully compiled candidates to an isolated GPU profiling service for sanitization, evaluation, and optional diagnostics. A reliability monitor pauses dispatch, restarts unhealthy service state, and excludes affected turns from trajectories. After a restart, it also excludes thermally abnormal GPUs because throttling distorted latency by over 15% in our measurements [35].
Figure 11: Detailed execution infrastructure supporting PTXBench. MiniPTXAgent compiles generated CUDA–PTX locally and sends successfully compiled candidates to an isolated GPU profiling service for sanitization, evaluation, and optional diagnostics. A reliability monitor pauses dispatch, restarts unhealthy service state, and excludes affected turns from trajectories. After a restart, it also excludes thermally abnormal GPUs because throttling distorted latency by over 15% in our measurements [35].

왜 중요한가

GPU 커널 최적화는 AI 모델 학습과 서비스 속도를 좌우하는 핵심 기술인데, 사람 전문가가 일일이 저수준 코드를 짜는 것은 매우 어렵고 시간이 오래 걸린다. 이 연구는 AI가 실제로 최신 하드웨어 기능을 제대로 활용할 수 있는지, 그리고 어떻게 학습시켜야 나아지는지를 처음으로 체계적으로 검증한 시도라는 점에서 의미가 있다.

Figure 12: Evaluation of workload state caching, generation-profiling pipelining, and GPU sharing.
Figure 12: Evaluation of workload state caching, generation-profiling pipelining, and GPU sharing.

이 논문의 용어

  • PTX · 엔비디아 GPU를 가장 낮은 수준에서 직접 제어할 수 있는 프로그래밍 인터페이스
  • GEMM · 행렬과 행렬을 곱하는 연산, GPU 성능 측정에 자주 쓰이는 대표 작업
  • SFT(지도 미세조정) · 정답 예시를 모델에게 보여주며 추가로 학습시키는 방법
  • LoRA · 모델 전체가 아니라 일부만 가볍게 학습시켜 비용을 줄이는 미세조정 기법
  • SASS · PTX 코드가 실제 GPU에서 실행될 때 변환되는 엔비디아의 네이티브 기계어

저자 · Genghan Zhang

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL MEDIA 최신 기사

그림 출처: Genghan Zhang et al., arXiv:2608.17379, CC BY 4.0