arXiv:2611.17526v1 cs.PL

양자화된 텐서 프로그램을 위한 사용자 스케줄 가능 근사

User-Schedulable Approximations for Quantized Tensor Programs

Alex Reinking

제출 2026-11-12

저자 비고

arXiv Comments

52 pages (20-page body plus appendices), 5 figures, 22 tables

한국어 초록

양자화는 언어 모델을 엣지 장치에서 실행할 수 있게 하지만, 라이브러리가 유지해야 하는 텐서 커널의 수를 급격히 늘린다. 모든 가중치 형식이 모든 명령어 집합과 GPU에서 모든 활성화 형식과 짝지어져야 하며, 저장된 바이트에 대해 합의하는 인코더와 디코더가 필요하기 때문이다. llama.cpp가 사용하는 텐서 라이브러리인 GGML에서는 이러한 커널이 수작업으로 작성되며, 우리의 Arm CPU에서 실행되는 54개 가중치-활성화 쌍 중 타일링된 행렬 곱셈 커널이 있는 것은 8개뿐이다. 우리는 Halide의 알고리즘과 스케줄 분리를 값의 표현으로 확장한다. 각 근사는 코덱, 즉 인코더와 디코더의 쌍이며, 양자화기, 정수 표현, 비트 패커, 레이아웃과 같은 재사용 가능한 단위로 구성된다. 새로운 지시어 approximate_by는 프로그램의 한 단계에 코덱을 적용하고, 인코더와 디코더를 Halide가 스케줄할 수 있는 일반 단계로 반환하므로 두 디코더가 행렬 곱의 레지스터 타일에 융합된다. 왕복 법칙과 같은 선택적 계약은 속성 테스트로 검증되며, 이 법칙을 통해 GGML의 q8_1에서 일관되지 않은 블록 합이 드러났다. 하나의 알고리즘과 하나의 스케줄 라이브러리가 Arm CPU와 Apple GPU에서 GGML과 KleidiAI의 31개 형식에 대해 347개의 커널을 생성하며, GGML에 커널이 없는 38개 가중치-활성화 쌍을 포함하고, 코드량은 GGML과 KleidiAI보다 3.7배 적다. Apple M3 Max에서 우리 커널은 대응 커널이 있는 경우의 91.0%에서 GGML의 형식 특화 커널 속도의 95% 이상에 도달하며, 중앙값 속도 향상은 1.13배이고, GGML이 블록 단위 내적으로 대체되는 경우에는 더욱 빠르다. 더 큰 f32 곱에서 보통 더 빠른 Apple의 BLAS 라이브러리를 포함해 계산하더라도 CPU 사례의 86.9%에서 같은 기준에 도달한다. Intel AMX를 사용하는 x86 이식은 793줄의 코드를 추가하며 GGML의 사례 중 83.5%에서 동등한 성능을 보인다.

원문 초록

Quantization lets language models run on edge devices, but it sharply increases the number of tensor kernels a library must maintain: every weight format must be paired with every activation format on every instruction set and GPU, with an encoder and a decoder that agree on the stored bytes. In GGML, the tensor library used by llama.cpp, these kernels are written by hand, and only 8 of the 54 weight-activation pairs it runs on our Arm CPU have a tiled matrix-multiplication kernel. We extend Halide's separation of algorithm and schedule to the representation of values. Each approximation is a codec, an encoder paired with a decoder, composed from reusable units: quantizers, integer representations, bit packers and layouts. A new directive, approximate_by, applies a codec to one stage of a program and returns the encoder and decoder as ordinary stages that Halide can schedule, so both decoders fuse into the register tiles of a matrix product. Optional contracts, such as a round-trip law, are checked by property tests; the law exposed an inconsistent block sum in GGML's q8_1. One algorithm and one schedule library generate 347 kernels for 31 of GGML's and KleidiAI's formats on Arm CPUs and Apple GPUs, covering 38 weight-activation pairs for which GGML has no kernel, in 3.7x less code than GGML and KleidiAI. On an Apple M3 Max, our kernels reach at least 95% of the speed of GGML's format-specific kernels in 91.0% of the cases that have one, with a median speedup of 1.13x, and are faster still where GGML falls back to blocked dot products. Counting Apple's BLAS library, which is usually faster for larger f32 products, we still reach that threshold in 86.9% of CPU cases. A port to x86 with Intel's AMX adds 793 lines of code and matches GGML in 83.5% of its cases.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2611.17526v1

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.