Skip to main content
QUICK REVIEW

[논문 리뷰] Canonicalization of Batched Einstein Summations for Tuning Retrieval

Kaushik Kulkarni, Andreas Klöckner|arXiv (Cornell University)|2026. 01. 18.
Parallel Computing and Optimization TechniquesComputer Science인용 수 0
한 줄 요약

이 논문은 배치된 Einstein 합 표현의 그래프 기반 표준화를 도입하여 Feinsum이라고 하는 표(tabulation 기반 시스템)에서 재사용 가능하고 거의 최적의 코드 변환을 가능하게 하며, 관련 벤치마크에서 JAX 대비 기하평균 속도향상 4.7배를 달성한다.

ABSTRACT

We present an algorithm for normalizing \emph{Batched Einstein Summation} expressions by mapping mathematically equivalent formulations to a unique normal form. Batches of einsums with the same Einstein notation that exhibit substantial data reuse appear frequently in finite element methods (FEM), numerical linear algebra, and computational chemistry. To effectively exploit this temporal locality for high performance, we consider groups of einsums in batched form. Representations of equivalent batched einsums may differ due to index renaming, permutations within the batch, and, due to the commutativity and associativity of multiplication operation. The lack of a canonical representation hinders the reuse of optimization and tuning knowledge in software systems. To this end, we develop a novel encoding of batched einsums as colored graphs and apply graph canonicalization to derive a normal form. In addition to the canonicalization algorithm, we propose a representation of einsums using functional array operands and provide a strategy to transfer transformations operating on the normal form to \emph{functional batched einsums} that exhibit the same normal form; crucial for fusing surrounding computations for memory bound einsums. We evaluate our approach against JAX, and observe a geomean speedup of $4.7 imes$ for einsums from the TCCG benchmark suite and an FEM solver.

연구 동기 및 목표

  • 과학 계산 워크로드에서 배치된 einsums의 재사용 가능하고 고성능 구현의 필요성을 동기 부여하고 형식화한다.
  • 배치된 einsums와 반복 연산 간 데이터 재사용을 포착하기 위한 동형 이론을 정의한다.
  • 표를 기반으로 한 최적화를 위해 배치된 einsums를 고유한 정규형으로 매핑하는 표준화 절차를 개발한다.
  • 재사용 가능한 데이터베이스를 통해 이상화된 배치된 einsums에서 실제 기능적 배치된 einsums로 최적화를 전이 가능하게 한다.
  • 실행 가능한 기능적 배치된 einsums를 이상화된 형태에 일치시키고 코드 변환으로 매핑하는 오픈 소스 구현(Feinsum)을 제공한다.

제안 방법

  • 순서에 의존하지 않는 공유 표기와 배치별 피연산자를 가진 배치된 Einstein 합을 정의한다.
  • 단일 einsum과 배치된 변형 모두에 대한 동형 정의를 통해 동등한 배치된 einsums를 모델링한다.
  • 세 단계 표준화: 색이 있는 방향 그래프(유도 그래프)로 매핑하고, 그래프를 정규화하며, 다시 배치된 einsum으로 매핑한다.
  • 그래프 표준화를 사용해 동형의 배치된 einsums가 동일한 표현을 갖는 정규형을 생성한다.
  • 변 operands가 람다식인 기능적 배치된 einsums를 도입하여 변환 전이가 용이하게 한다.
  • 고정된 배치된 einsums에 대한 변환을 저장하고 실용 프로그램에 대한 검색 및 적용을 지원하는 데이터베이스를 구현한다.

실험 결과

연구 질문

  • RQ1배치된 einsums를 구문적 이질성을 제거하고 최적화 재사용을 가능하게 하는 표준적 표기에 어떻게 표현할 수 있는가?
  • RQ2그래프 기반 표준화(색상 그래프)가 배치된 einsums와 그 동형에 대해 고유한 정규형을 생성할 수 있는가?
  • RQ3이상화된 배치된 einsums에 대해 개발된 최적화를 실제 응용에서 사용되는 기능적 배치된 einsums에 어떻게 전이할 수 있는가?
  • RQ4정규형이 있는 표 작성 기반 접근이 전통적인 물질화 기반 전략에 비해 메모리 병목 워크로드에서 성능을 향상시키는가?
  • RQ5Feinsum의 접근 방식이 실제 벤치마크와 솔버에 미치는 실질적 성능 영향은 무엇인가?

주요 결과

  • 배치된 einsums에 대한 정규형은 세 단계의 그래프 기반 파이프라인을 통해 달성 가능하며, 등가 클래스가 단일 표현으로 수렴하도록 한다.
  • 람다 피연산자를 가진 기능적 배치된 einsums는 재사용 및 변환 지식을 실제 프로그램으로의 전이 가능하게 한다.
  • 오픈 소스 Feinsum 시스템은 표준화, 이상화 형태와의 매칭, 고성능 코드 변환으로의 매핑을 구현한다.
  • Feinsum은 JAX와 비교하여 TCCG 벤치마크 및 FEM 솔버에서 배치된 einsums에 대해 기하평균 4.7x의 속도향상을 보인다.
  • 이 접근법은 중간 결과의 물질화를 필요로 하지 않는 변환을 가능하게 하여 메모리 대역폭 활용도를 높임으로써 메모리 바운드 상황을 해결한다.
  • 이 연구는 표작성과 최적화 지식의 재사용을 통해 배치된 einsums에 대한 거 거의 루프라인 커널로의 실용적 경로를 제공한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.