[논문 리뷰]WideSA의 Routing-Aware PLIO 할당 알고리즘
Published:
WideSA는 Versal ACAP에서 높은 AIE 배열 활용도를 달성하기 위한 매핑 방안입니다. 라우팅-인식 PLIO 할당 알고리즘을 통해 PLIO 포트와 AIE 코어 사이의 데이터 입/출력 경로를 구축하고, 컴파일 성공률을 높입니다.
Published:
WideSA는 Versal ACAP에서 높은 AIE 배열 활용도를 달성하기 위한 매핑 방안입니다. 라우팅-인식 PLIO 할당 알고리즘을 통해 PLIO 포트와 AIE 코어 사이의 데이터 입/출력 경로를 구축하고, 컴파일 성공률을 높입니다.
Published:
WideSA uses a routing-aware PLIO allocation algorithm to solve routing problems that occur during high AIE utilization. Through this algorithm, it constructs data input/output paths between PLIO ports and AIE cores, improving compilation success rate.
Published:
ONNX-MLIR에서 ONNX Dialect를 Linalg Dialect로 변환하는 파이프라인을 구축하는 과정을 다룹니다. 인프라 구축부터 MatMul 연산의 구체적인 변환 로직 구현, 그리고 IR 변환의 상세 과정까지 단계별로 설명합니다.
Published:
This post covers the process of building a pipeline to convert ONNX Dialect to Linalg Dialect in ONNX-MLIR. We explain step-by-step from infrastructure setup to the specific conversion logic implementation of MatMul operations, and the detailed IR transformation process.
Published:
ONNX-MLIR에서 Linalg Dialect를 도입함으로써 얻을 수 있는 컴파일 흐름의 변화와 최적화 이점에 대해 살펴봅니다. 기존 Krnl 기반 흐름의 한계와 Linalg가 제공하는 구조화된 연산 및 고급 변환 기능을 분석합니다.
Published:
This post explores the changes in compilation flow and optimization benefits that can be achieved by introducing Linalg Dialect into ONNX-MLIR. We analyze the limitations of the existing Krnl-based flow and the structured operations and advanced transformation capabilities provided by Linalg.
Published:
MaxEVA 프레임워크는 Versal AI Engine 배열의 활용도를 최대화하고 MatMul 커널과 애더 트리 간의 통신에서 DMA 사용을 최소화하여 효율성을 높이는 정교한 배치 전략을 사용합니다.
Published:
The MaxEVA framework employs a sophisticated placement strategy that maximizes Versal AI Engine array utilization and minimizes DMA usage in communication between MatMul kernels and adder trees, enhancing overall efficiency.
Published:
vnnx_tflite.py에서 TRANSPOSE 연산 처리 시 발생하는 컴파일 실패 문제를 해결했습니다. TFLite 최적화로 인해 잘못 변환된 TRANSPOSE를 감지하여 원래의 RESHAPE 연산으로 복구하는 방법을 설명합니다.
Published:
Fixed compilation failure issues when processing TRANSPOSE operations in vnnx_tflite.py. Explains how to detect incorrectly converted TRANSPOSE operations due to TFLite optimization and restore them to original RESHAPE operations.
Published:
vnnx_tflite.py에서 5차원 텐서를 슬라이싱하는 SLICE/STRIDED_SLICE 연산 처리 시 발생하는 컴파일 실패 문제를 해결했습니다. 5차원을 4차원으로 안전하게 변환하는 방법을 설명합니다.
Published:
Fixed compilation failure issues when processing SLICE/STRIDED_SLICE operations on 5-dimensional tensors in vnnx_tflite.py. Explains how to safely convert 5-dimensional tensors to 4-dimensional tensors.
Published:
vnnx_tflite.py에서 RESHAPE 연산 처리 시 발생하는 multi-axis squeeze 및 single-axis squeeze 문제를 해결했습니다. VectorBlox SDK가 지원하지 않는 reshape 패턴을 사전에 감지하여 NOP 연산으로 처리하는 방법을 설명합니다.
Published:
Fixed multi-axis squeeze and single-axis squeeze issues when processing RESHAPE operations in vnnx_tflite.py. Explains how to pre-detect reshape patterns not supported by VectorBlox SDK and process them as NOP operations.
Published:
vnnx_tflite.py에서 상수 텐서의 buffer 필드를 직렬화할 때 발생하는 struct.pack 에러를 해결했습니다. 모든 텐서의 buffer를 [buffer_id, offset] 배열 형식으로 통일하여 C 구조체와의 호환성을 확보하는 방법을 설명합니다.
Published:
Fixed struct.pack errors when serializing buffer fields of constant tensors in vnnx_tflite.py. Explains how to unify all tensor buffers to [buffer_id, offset] array format to ensure compatibility with C structures.
Published:
vnnx_tflite.py에서 상수 연산을 포함한 ADD/SUB 연산 처리 시 발생하는 양자화 파라미터 미초기화 문제를 해결했습니다. multi_input=False인 경우에도 모든 양자화 파라미터를 초기화하도록 수정하는 방법을 설명합니다.
Published:
Fixed quantization parameter uninitialization issues when processing ADD/SUB operations with constant operands in vnnx_tflite.py. Explains how to modify the code to initialize all quantization parameters even when multi_input=False.
Published:
onnx-mlir은 ONNX 모델을 네이티브 코드로 효율적으로 변환하는 오픈 소스 컴파일러입니다. 이 포스트에서는 MLIR, ONNX, 그리고 이 둘의 결합체인 onnx-mlir의 기술적 세부 사항을 심층적으로 다룹니다.
Published:
onnx-mlir is an open-source compiler that efficiently converts ONNX models to native code. This post covers the technical details of MLIR, ONNX, and their combination in onnx-mlir.
Published:
vnnx_tflite.py는 TensorFlow Lite(INT8) 모델을 VectorBlox의 VNNX 형식으로 변환하는 핵심 모듈입니다. 이 글에서는 전체 플로우와 내부 구조(generate_vnnx_from_json_subgraphs, update_offsets, vbx.sim.Model 시뮬레이션)를 정리하고, 최신 AI 모델 지원을 위해 직접 패치한 내용을 예고합니다.
Published:
vnnx_tflite.py is a core module that converts TensorFlow Lite (INT8) models to VectorBlox VNNX format. This post covers the overall flow and internal structure (generate_vnnx_from_json_subgraphs, update_offsets, vbx.sim.Model simulation), and previews custom patches made to support latest AI models.
Published:
ONNX 모델을 VectorBlox VNNX 형식으로 변환할 때 호환되지 않는 연산자들이 발생합니다. 이 포스트에서는 Clip 연산자와 ScatterND 연산자를 제거하고 대체하는 방법을 다룹니다.
Published:
When converting ONNX models to VectorBlox VNNX format, some operators are incompatible. This post covers methods to remove and replace Clip and ScatterND operators.
Published:
VectorBlox는 Microchip의 PolarFire FPGA를 위한 AI/ML 추론 가속기 플랫폼입니다. TensorFlow Lite INT8 네트워크를 지원하며, 소프트웨어 기반 구현으로 FPGA 재프로그래밍 없이 AI 모델을 배포할 수 있습니다. 5W 미만의 전력 효율과 오버레이 디자인을 통해 여러 네트워크를 동적으로 전환할 수 있습니다.
Published:
VectorBlox is an AI/ML inference accelerator platform for Microchip PolarFire FPGAs. It supports TensorFlow Lite INT8 networks and enables AI model deployment without FPGA reprogramming through software-based implementation. With power efficiency under 5W and overlay design, it can dynamically switch between multiple networks.
Published:
TVM으로 최적화한 행렬 곱셈 구현을 NVIDIA cuBLAS와 비교합니다. Step 6에서 달성한 1053 GFLOPS는 cuBLAS의 50.7%에 해당하며, 512x512 크기에서는 85.6%의 성능을 달성했습니다.
Published:
We compare our TVM-optimized matrix multiplication implementation with NVIDIA cuBLAS. The 1053 GFLOPS achieved in Step 6 corresponds to 50.7% of cuBLAS, and we achieved 85.6% performance for 512x512 size.
Published:
Loop Unrolling을 통해 1050 GFLOPS를 달성했습니다. 루프 오버헤드를 제거하고 Instruction-Level Parallelism을 향상시켜 최종 성능을 끌어올렸습니다.
Published:
We achieved 1050 GFLOPS through Loop Unrolling. We improved final performance by removing loop overhead and enhancing Instruction-Level Parallelism.
Published:
Software Pipelining을 통해 1029 GFLOPS를 달성했습니다. 메모리 레이턴시를 연산으로 은폐하여 평균 58% 성능 향상을 달성했습니다. 이 포스트에서는 여러 반복을 겹쳐서 실행하는 Software Pipelining 기법을 다룹니다.
Published:
We achieved 1029 GFLOPS through Software Pipelining. We achieved an average 58% performance improvement by hiding memory latency with computation. This post covers Software Pipelining techniques that execute multiple iterations overlapped.
Published:
Vectorization과 Local Memory(레지스터) 캐싱을 통해 평균 614 GFLOPS를 달성했습니다. 이 포스트에서는 Scalar Replacement 기법을 통한 레지스터 최적화와 벡터화를 통한 메모리 대역폭 활용을 다룹니다.
Published:
We achieved an average of 614 GFLOPS through Vectorization and Local Memory (register) caching. This post covers register optimization through Scalar Replacement techniques and memory bandwidth utilization through vectorization.
Published:
Shared Memory를 활용하여 큰 행렬(2048x2048)에서 101% 성능 향상을 달성했습니다. 이 포스트에서는 GPU 메모리 계층 구조와 Shared Memory를 통한 캐싱 전략, Cooperative Fetching 기법을 다룹니다.
Published:
We achieved 101% performance improvement on large matrices (2048x2048) using Shared Memory. This post covers GPU memory hierarchy and caching strategies through Shared Memory, and Cooperative Fetching techniques.
Published:
Tiling과 Loop Reordering을 통해 481 GFLOPS를 달성했습니다. Step 1 대비 5.1배 향상된 성능을 보여줍니다. 이 포스트에서는 캐시 최적화를 위한 Tiling 기법과 레지스터 재사용을 극대화하는 Loop Reordering을 다룹니다.
Published:
We achieved 481 GFLOPS through Tiling and Loop Reordering. This shows 5.1x performance improvement over Step 1. This post covers Tiling techniques for cache optimization and Loop Reordering to maximize register reuse.
Published:
기본 GPU 구현으로 95 GFLOPS를 달성했습니다. CPU 대비 6.3배 향상된 성능을 보여주지만, A500 Peak (3.072 TFLOPS)의 3.1%에 불과합니다. 이 포스트에서는 Data Parallelism과 2D Thread Mapping을 통한 기본 GPU 구현을 다룹니다.
Published:
We achieved 95 GFLOPS with basic GPU implementation. This shows 6.3x performance improvement over CPU, but it is only 3.1% of A500 Peak (3.072 TFLOPS). This post covers basic GPU implementation through Data Parallelism and 2D Thread Mapping.
Published:
TVM의 FuseReductionEpilogue 프리미티브의 복잡한 AST 변환 과정을 Mermaid 다이어그램으로 시각화합니다. 전체 아키텍처 흐름, 클래스 관계도, AST 변환 과정, 패턴 분석, 버퍼 교체 메커니즘, Python API 연결 구조를 다룹니다.
Published:
We visualize the complex AST transformation process of TVM FuseReductionEpilogue primitive using Mermaid diagrams. We cover overall architecture flow, class relationship diagram, AST transformation process, pattern analysis, buffer replacement mechanism, and Python API connection structure.
Published:
Part 2에서 세운 계획을 바탕으로 TVM 컴파일러가 이해할 수 있는 C++ 코드로 구현합니다. 패턴 분석, AST 변환, 트리 재구성의 세 단계를 통해 Reduction Block과 Epilogue Block을 융합하는 프리미티브를 완성합니다.
Published:
Based on the plan established in Part 2, we implement it in C++ code that the TVM compiler can understand. We complete a primitive that fuses Reduction Block and Epilogue Block through three stages: pattern analysis, AST transformation, and tree reconstruction.
Published:
Part 1에서 확인한 기존 스케줄링 프리미티브의 한계를 넘어, Reduction Block의 초기값을 0이 아닌 Bias로 설정하는 새로운 접근 방식을 제안합니다. 이 포스트에서는 TIR 구조 변환 설계와 구현 요구사항을 다룹니다.
Published:
Beyond the limitations of existing scheduling primitives confirmed in Part 1, we propose a new approach that sets the initial value of Reduction Block to Bias instead of 0. This post covers TIR structure transformation design and implementation requirements.
Published:
Vitis-AI의 Model Zoo는 DPU 제약을 고려해 이미 최적화된 AI 모델을 제공합니다. 본 문서는 TVM의 패턴 변환 패스를 활용해 원본 YOLOv4를 DPU 호환 YOLOv4-Leaky로 자동 변환하여, Model Zoo에서 제공하는 결과와 동등한 구조를 자동화하는 방법을 정리합니다.
Published:
Vitis-AI Model Zoo provides AI models already optimized considering DPU constraints. This document summarizes how to automatically convert original YOLOv4 to DPU-compatible YOLOv4-Leaky using TVM pattern transformation passes, automating the same structure provided by Model Zoo.
Published:
Part 3까지 구현한 FuseReductionEpilogue 프리미티브가 올바르게 동작하는지 검증하기 위한 테스트 전략을 다룹니다. 구조적 동등성 검사, 수치 정확도 검사, 엣지 케이스 테스트, Trace Roundtrip 검사를 통해 프리미티브의 안정성을 확보합니다.
Published:
We cover testing strategies to verify that the FuseReductionEpilogue primitive implemented up to Part 3 works correctly. We ensure the stability of the primitive through structural equality checks, numerical accuracy checks, edge case tests, and Trace Roundtrip checks.
Published:
대부분의 AI 가속기는 Output = Input * Weight + Bias를 한 번의 사이클에 처리하는 MAC(Multiply-Accumulate) 명령어를 지원합니다. 하지만 컴파일러가 생성한 중간 코드(TIR)에서 이 두 연산이 분리되어 있다면, 하드웨어의 성능을 온전히 끌어낼 수 없습니다. 이 포스트에서는 TVM의 MatMul 블록에 Bias Addition을 인라인할 수 없는 문제를 분석하고, 기존 스케줄링 프리미티브의 한계를 살펴봅니다.
Published:
Most AI accelerators support MAC (Multiply-Accumulate) instructions that process Output = Input * Weight + Bias in a single cycle. However, if these two operations are separated in the intermediate code (TIR) generated by the compiler, the hardware performance cannot be fully utilized. This post analyzes the problem of not being able to inline Bias Addition into TVM MatMul blocks and examines the limitations of existing scheduling primitives.
Published:
Conv2d + Bias + ReLU는 딥러닝에서 가장 흔한 패턴입니다. 하지만 PyTorch 모델을 TVM으로 가져올 때 Reshape 노드가 중간에 삽입되어 퓨전이 깨지는 문제가 발생합니다. 이 포스트는 이 문제를 해결하기 위한 패턴 매칭 기반 퓨전 패스 구현 과정을 다룹니다.
Published:
Conv2d + Bias + ReLU is the most common pattern in deep learning. However, when importing PyTorch models into TVM, Reshape nodes are inserted in the middle, breaking fusion. This post covers the implementation process of a pattern matching-based fusion pass to solve this problem.