KR101908341B1 - Data processor proceeding of accelerated synchronization between central processing unit and graphics processing unit - Google Patents

Data processor proceeding of accelerated synchronization between central processing unit and graphics processing unit Download PDF

Info

Publication number
KR101908341B1
KR101908341B1 KR1020170065858A KR20170065858A KR101908341B1 KR 101908341 B1 KR101908341 B1 KR 101908341B1 KR 1020170065858 A KR1020170065858 A KR 1020170065858A KR 20170065858 A KR20170065858 A KR 20170065858A KR 101908341 B1 KR101908341 B1 KR 101908341B1
Authority
KR
South Korea
Prior art keywords
gpu
data
cpu
thread
memory
Prior art date
Application number
KR1020170065858A
Other languages
Korean (ko)
Other versions
KR20180099420A (en
Inventor
박경수
고영환
무함마드 잠셰드
문영균
황창호
Original Assignee
한국과학기술원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국과학기술원 filed Critical 한국과학기술원
Publication of KR20180099420A publication Critical patent/KR20180099420A/en
Application granted granted Critical
Publication of KR101908341B1 publication Critical patent/KR101908341B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Abstract

본 발명의 일 실시예에 따른 데이터 프로세서는 복수의 제 1 데이터를 처리하는 CPU(중앙처리장치), 복수의 계산 유닛과 캐쉬메모리를 포함하는 GPU(그래픽처리장치) 및 상기 CPU와 상기 GPU가 데이터 저장을 위해 공유하는 공유 메모리를 포함하고,
상기 복수의 계산 유닛 각각은 복수의 쓰레드를 포함하며, 상기 복수의 계산 유닛 중 적어도 일부는 활성화 쓰레드 그룹으로 동작하고 상기 복수의 계산 유닛 중 나머지는 비활성화 쓰레드 그룹으로 동작하며,
상기 활성화 쓰레드 그룹이 상기 복수의 제 1 데이터를 복수의 제 2 데이터로 변환하고, 상기 비활성화 쓰레드 그룹이 더미 데이터 입출력을 처리하도록 하여, 상기 활성화 쓰레드 그룹에서 변환된 상기 복수의 제 2 데이터와 상기 비활성화 쓰레드 그룹에서 처리된 상기 더미 데이터가 함께 상기 캐쉬메모리를 채우도록 함으로써, 상기 캐쉬메모리에 저장된 상기 복수의 제 2 데이터가 상기 공유 메모리로 전송되도록 하여 상기 CPU와 상기 GPU간에 가속화된 동기화를 수행하는 데이터 프로세서임을 특징으로 한다.
A data processor according to an embodiment of the present invention includes a CPU (central processing unit) for processing a plurality of first data, a GPU (graphics processing unit) including a plurality of calculation units and a cache memory, A shared memory shared for storage,
Wherein each of the plurality of calculation units includes a plurality of threads, at least some of the plurality of calculation units operate as an activation thread group and the remainder of the plurality of calculation units operate as a deactivation thread group,
The active thread group converting the plurality of first data into a plurality of second data and causing the inactive thread group to process dummy data input and output so that the plurality of second data converted in the activation thread group and the inactive Wherein the plurality of second data stored in the cache memory is transferred to the shared memory by causing the dummy data processed in the thread group to fill the cache memory together to thereby perform an accelerated synchronization between the CPU and the GPU Processor.

Description

CPU와 GPU간에 동기화를 가속화하여 수행하는 데이터 프로세서 {DATA PROCESSOR PROCEEDING OF ACCELERATED SYNCHRONIZATION BETWEEN CENTRAL PROCESSING UNIT AND GRAPHICS PROCESSING UNIT}TECHNICAL FIELD [0001] The present invention relates to a data processor that performs synchronization by accelerating a synchronization between a CPU and a GPU.

본 발명은, CPU와 GPU간에 동기화를 가속화하여 수행하는 데이터 프로세서에 관한 발명으로, CPU에서 요청한 데이터가 GPU에서 처리된 뒤 공유 메모리로 전송됨으로서, CPU와 GPU간에 동기화를 가속화하여 수행하도록 하는 데이터 프로세서에 관한 발명이다. The present invention relates to a data processor for performing synchronization by accelerating a synchronization between a CPU and a GPU, the data processor requesting data from a CPU to be processed in a GPU and then being transferred to a shared memory, .

최근 많은 연구원들에 의해 네트워크 어플리케이션 내에서 수행되는 패킷 프로세싱을 가속화하기 위한 GPU(Graphics Processing Unit)에 대한 연구가 수행되어 왔다. 많은 업적들은, CPU로만 구현되는 것에 비해 GPU가 동시에 구현되는 경우, 큰 메모리 대역폭(large memory bandwidth) 및 고성능의-병행 처리 능력(highly-parallel computation capacity)에 의해 성능이 더욱 향상됨을 보여주고 있다. 그러나, 최근의 연구는 많은 어플리케이션에서, 고성능을 위한 핵심 요소는 GPU의 병렬 계산 기능이 아니라 메모리 접근 대기 시간을 자동으로 숨기는 것임을 보여주고 있다. 또한, CPU에서 그룹 프리 페칭(group prefetching)이나 소프트웨어 파이프라이닝(software pipelining)과 같은 최적화 기술을 이용한 메모리 접근 대기 시간을 감추도록 코드가 재배열되는 경우 GPU 와 유사하거나 더 우수한 성능을 나타낼 수 있다고 주장한다. Recently, many researchers have studied GPU (Graphics Processing Unit) to accelerate packet processing performed in network applications. Many of the achievements show that performance is further enhanced by the large memory bandwidth and the high-parallel computation capacity when the GPU is implemented concurrently with the CPU. However, recent research shows that, for many applications, the key to high performance is not the GPU's parallel computation capabilities, but the automatic hiding of memory access latency. It also claims that if the code is rearranged to hide the memory access latency using optimizations such as group prefetching or software pipelining, the CPU can perform similar or better than the GPU do.

본 특허에서는, 이러한 최근 연구를 재검토하여 대규모의 네트워크 어플리케이션들에 일반화하여 적용될 수 있는지를 검토하고자 한다. 본 특허의 일 실시예에 따르면, 네트워크 어플리케이션에 널리 적용가능한 대중적인 8가지의 알고리즘들이 있고, 이것은 a) CPU에 기초한 최적화는 실패하지만 GPU 에 의한 병행 처리 능력으로 이득을 얻는 컴퓨터에 기반한 알고리즘이 있음을 보여주며, b) GPU를 대신한 CPU의 상대적인 수행 능력상 이점은, GPU 자체의 용량의 결핍 보다 개별적인 GPU 의 PCIe 통신에서의 데이터 전송 병목 현상 때문임을 보여준다. PCIe 병목 현상을 피하기 위해서, 본 특허에서는 CPU와 GPU가 통합된 APU 플랫폼을 비용상 효율적인 패킷 처리 가속화기기로 사용함을 제안한다. 또한, 본 특허는 APU의 용량을 완전히 활용하는 데 있어 실질적인 문제를 해결하고, APU 기반 네트워크 애플리케이션이 많은 컴퓨팅/메모리 집약적 알고리즘에 대해 수십 Gbps 성능을 달성하는 것을 보여줄 수 있다.In this patent, we review the recent research to see if it can be generalized to large-scale network applications. According to one embodiment of the present patent application, there are eight popular algorithms that are widely applicable to network applications, including: a) a computer-based algorithm that fails to optimize based on CPU but gains benefit from parallel processing capability by GPU , And b) the relative performance advantage of the CPU on behalf of the GPU is due to the data transfer bottleneck in the individual GPU's PCIe communication rather than the lack of capacity of the GPU itself. In order to avoid PCIe bottlenecks, this patent proposes that an APU platform with integrated CPU and GPU is used as a cost-effective packet processing accelerator. In addition, the patent solves a real problem in fully exploiting the capacity of the APU, and APU-based network applications can demonstrate achieving tens of Gbps performance for many computing / memory intensive algorithms.

본 특허에서는 CPU와 GPU가 통합된 APU 플랫폼을 비용상 효율적인 패킷 처리 가속화기기로 사용함을 제안한다. 또한, 본 특허는 APU의 용량을 완전히 활용하는 데 있어 실질적인 문제를 해결하고, APU 기반 네트워크 애플리케이션이 많은 컴퓨팅/메모리 집약적 알고리즘에 대해 수십 Gbps 성능을 달성하는 것을 보여줄 수 있다.This patent proposes that APU platform with integrated CPU and GPU is used as cost-effective packet processing accelerator. In addition, the patent solves a real problem in fully exploiting the capacity of the APU, and APU-based network applications can demonstrate achieving tens of Gbps performance for many computing / memory intensive algorithms.

본 발명의 일 실시예에 따른 데이터 프로세서는 복수의 제 1 데이터를 처리하는 CPU(중앙처리장치), 복수의 계산 유닛과 캐쉬메모리를 포함하는 GPU(그래픽처리장치) 및 상기 CPU와 상기 GPU가 데이터 저장을 위해 공유하는 공유 메모리를 포함하고, 상기 복수의 계산 유닛 각각은 복수의 쓰레드를 포함하며, 상기 복수의 계산 유닛 중 적어도 일부는 활성화 쓰레드 그룹으로 동작하고 상기 복수의 계산 유닛 중 나머지는 비활성화 쓰레드 그룹으로 동작하며, 상기 활성화 쓰레드 그룹이 상기 복수의 제 1 데이터를 복수의 제 2 데이터로 변환하고, 상기 비활성화 쓰레드 그룹이 더미 데이터 입출력을 처리하도록 하여, 상기 활성화 쓰레드 그룹에서 변환된 상기 복수의 제 2 데이터와 상기 비활성화 쓰레드 그룹에서 처리된 상기 더미 데이터가 함께 상기 캐쉬메모리를 채우도록 함으로써, 상기 캐쉬메모리에 저장된 상기 복수의 제 2 데이터가 상기 공유 메모리로 전송되도록 하여 상기 CPU와 상기 GPU간에 가속화된 동기화를 수행할 수 있다. A data processor according to an embodiment of the present invention includes a CPU (central processing unit) for processing a plurality of first data, a GPU (graphics processing unit) including a plurality of calculation units and a cache memory, Wherein each of the plurality of calculation units includes a plurality of threads, at least some of the plurality of calculation units operate as an active thread group, and the remainder of the plurality of calculation units are inactive threads Wherein the active thread group converts the plurality of first data into a plurality of second data and causes the inactive thread group to process dummy data input and output, 2 data and the dummy data processed in the inactive thread group together with the cache memory By Li to fill, it is possible to ensure that the second data of the plurality stored in the cache memory is transferred to the shared memory to perform the speed synchronization between the CPU and the GPU.

본 특허에서는 CPU와 GPU가 통합된 APU 플랫폼을 비용상 효율적인 패킷 처리 가속화기기로 사용할 수 있다. 또한, 본 특허는 APU의 용량을 완전히 활용하는 데 있어 실질적인 문제를 해결하고, APU 기반 네트워크 애플리케이션이 많은 컴퓨팅/메모리 집약적 알고리즘에 대해 수십 Gbps 성능을 달성할 수 있다.In this patent, the CPU and GPU integrated APU platform can be used as a cost-effective packet processing accelerator. In addition, the patent solves a real problem in fully exploiting APU capacity, and APU-based network applications can achieve tens of Gbps performance for many computing / memory intensive algorithms.

도 1은 본 발명의 일 실시예에 따른 전형적인 외장 GPU에 대한 실시예에 대한 블록도이다.
도 2는 본 발명의 일 실시예에 따른 가속 처리 유닛(APU)를 구성하는 CPU(100) 및 GPU(200)간의 공유 메모리(300)를 통한 데이터 흐름을 도시하기 위한 블록도이다.
3 및 도 4는 CPU 기반 외장/내장 GPU에서 평가된 알고리즘들의 성능 비교표이다.
5는 본 발명의 일 실시예에 따른 APUNet의 전반적 아키텍쳐에 대한 도면이다.
6은 GPU(200)의 제어 유닛(210)중 어느 하나의 제어 유닛(210-1)에서 동작하는 쓰레드 그룹의 구성을 예시한 도면이다.
7은 실시예에 따른 다양한 패킷 사이즈에 기반한 패킷 처리 대기시간에 대한 그래프이다.
8은 실시예에 따른 다양한 패킷들 사이즈에 의한 전송 결과물들을 보여주는 그래프이다.
9는 APUnet의 네트워크 어플리케이션 구동 평가 결과를 도시한 그래프이다.
1 is a block diagram of an embodiment of a typical external GPU in accordance with an embodiment of the invention.
2 is a block diagram illustrating data flow through a shared memory 300 between a CPU 100 and a GPU 200 constituting an acceleration processing unit (APU) according to an embodiment of the present invention.
3 and 4 are performance comparison charts of the algorithms evaluated in the CPU-based external / embedded GPU.
5 is a diagram of the overall architecture of APUNet according to one embodiment of the present invention.
6 is a diagram illustrating a configuration of a thread group that operates in any one of the control units 210-1 of the control units 210 of the GPU 200. [
7 is a graph of packet processing latency based on various packet sizes according to an embodiment.
8 is a graph showing transmission results by various packet sizes according to an embodiment.
9 is a graph showing the result of evaluating APUnet's network application.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이들 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 여기에 기재되어 있는 특정 형상, 구조 및 특성은 일 실시예에 관련하여 본 발명의 정신 및 범위를 벗어나지 않으면서 다른 실시예로 구현될 수 있다. 또한, 각각의 개시된 실시예 내의 개별 구성요소의 위치 또는 배치는 본 발명의 정신 및 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 취하려는 것이 아니며, 본 발명의 범위는, 적절하게 설명된다면, 그 청구항들이 주장하는 것과 균등한 모든 범위와 더불어 첨부된 청구항에 의해서만 한정된다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 기능을 지칭한다.The following detailed description of the invention refers to the accompanying drawings, which illustrate, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It should be understood that the various embodiments of the present invention are different, but need not be mutually exclusive. For example, certain features, structures, and characteristics described herein may be implemented in other embodiments without departing from the spirit and scope of the invention in connection with an embodiment. It is also to be understood that the position or arrangement of the individual components within each disclosed embodiment may be varied without departing from the spirit and scope of the invention. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is to be limited only by the appended claims, along with the full scope of equivalents to which such claims are entitled, if properly explained. In the drawings, like reference numerals refer to the same or similar functions throughout the several views.

이하, 첨부되는 도면을 참조하여 본 발명의 실시예에 따른 GPU(200)와 공유 메모리(300)간에 동기화를 가속화하여 수행하는 데이터 프로세서(1)를 설명한다.Hereinafter, a data processor 1 that accelerates synchronization between a GPU 200 and a shared memory 300 according to an embodiment of the present invention will be described with reference to the accompanying drawings.

PUs들은 컴퓨팅 그리고 메모리 집약적 어플리케이션들을 가속화하는 데 널리 이용되고 있다. 수백 또는 수천의 처리 코어(core)들과 큰 메모리 대역폭과 함께, GPU는 병렬처리가 가능한 어플리케이션들의 성능을 향상시키는데 잠재력을 보유하고 있다. 다행이, 많은 네트워크 어플리케이션들은 GPU의 실행 모델에 적합하도록 하는 카테고리로 분류되고 있다. 실제, 많은 연구들에 따르면, 네트워크 어플리케이션들의 성능을 향상시키기 위해 GPU가 도움을 주고 있음이 보고된 바 있다. PUs are widely used to accelerate computing and memory intensive applications. With hundreds or thousands of processing cores and large memory bandwidth, the GPU has the potential to improve the performance of parallelizable applications. Fortunately, many network applications are categorized into categories that make them suitable for the GPU's execution model. In fact, many studies have shown that the GPU is helping to improve the performance of network applications.

최근에 따르면, 그러나, 네트워크 어플리케이션들을 가속화하기 위한 CPU를 대신한 GPU의 상대적 수행능력은 의문을 가져왔다. 최근의 업적에 따르면, GPU로부터 얻을 수 있는 대부분의 이득은 그것의 높은 계산 능력 대신, 메모리 접근 대기 시간을 투명하게 숨기는 빠른 하드웨어 쓰레드 전환에 기반함을 보여준다. 또한, CPU 코드에 그룹 프리페칭의 최적화 기술과 소프트웨어 파이프라이닝을 적용하는 것은, 많은 네트워킹 어플리케이션들을 위한 GPU-가속화 버전에 비해 더욱 자원적으로 효율적임을 보여주고 있다. In recent years, however, the relative performance of a GPU on behalf of a CPU to accelerate network applications has been questioned. Recent achievements show that most of the gain from the GPU is based on fast hardware thread switching that transparently hides memory access latency instead of its high computational power. In addition, applying group prefetching optimization techniques and software pipelining to the CPU code shows that it is more resource-efficient than the GPU-accelerated version for many networking applications.

본 특허에서는, 네트워크 어플리케이션들을 가속화하기 위한 GPU 의 효능에 대한 최근의 연구를 다시 검토하고자 한다. 심사숙고한 실험들과 추론을 통해, 본원 발명에서는 다음과 같은 관찰 결과를 만들 수 있다. 처음으로, 네트워크 어플리케이션들에 광범위하게 이용되는 많은 컴퓨팅-집약적인 알고리즘들의 성능을 향상시키는 데 GPU의 계산 능력이 중요함을 발견하였다. 본 발명에 따르면, RSA, SHA-1 / SHA-2 및 ChaCha20과 같은 SSL 및 IPSec의 인기있는 암호화 알고리즘은 투명한 메모리 접근 시간 숨김이 아닌 병렬 계산 싸이클로부터 얻는 이점이 많음을 보여줄 수 있다. 그것들은 1.3에서 4.8배(x)로 최적화된 CPU 코드의 성능을 능가한다. 두번째로, G-Opt [32]와 같은 CPU 기반 코드 최적화 기술은, 순수한 CPU 코드의 성능을 향상시키는 반면, 그것의 가속화 힘은 CPU-GPU간 데이터 전송 오버헤드가 없는 GPU의 성능에 비해 제한적이다. 비용당 성능 측정기준에 의해, 본원 발명에 따르면 GPU가 CPU-GPU간 데이터 전송 오버헤드를 피하게 되면, GPU는 3.1배(x) 내지 4.8배(x) 더 비용적으로 효과적임을 알 수 있다. 세번째로, 본원 발명에 따르면 GPU 작업의 주된 병목은 GPU 장치 그 자체에 용량 부족 대신 PCIe 통신에 의해 초래된 CPU-GPU간 데이터 전송 오버헤드에 의한 것임을 알 수 있다. 그러나, 개별 패킷 처리는 일반적으로 많은 계산 또는 메모리 접근을 요구하지 않기 때문에 CPU-GPU간 데이터 전송 지연을 감추는 것은 어려울 수 있다. 이것은, GPU 커널 수행과 완전히 오버랩되기 위한 (예를 들어, GPU커널의 동시 복사 및 실행 같은) 비동기 데이터 전송을 어렵게 만들 수 있다. 일반적으로 PCIe 대역폭이 GPU의 메모리 대역폭보다 훨씬 작기 때문에, GPU 가속 네트워크 어플리케이션에서, PCIe의 데이터 전송이 성능상의 이점을 제한한다는 것은 놀라운 일이 아니다. CPU-GPU간 데이터 전송 오버헤드 없이 GPU의 이점을 극대화하기 위해, 본 발명에서는 네트워크 어플리케이션들의 가속 처리를 위해 CPU와 GPU가 통합된 Accelerated Processing Unit(APU)을 이용할 수 있다. APU는 CPU와 GPU 모두를 위한 단일 통합된 메모리 공간을 제공하고, CPU-GPU간 데이터 전송 오버헤드를 제거하기 때문에 패킷 처리에 매력적임을 알 수 있다. 또한, 낮은 가격에 (예 : $ 100 ~ $ 150) 전력 소모량이 아주 적기 때문에 (예 : AMD Carrizo의 경우 35W), 네트워크 시스템을 위한 비용 효율적인 가속기가 될 수 있다. 따라서 어떻게 우리가 고성능의 패킷 처리 엔진을 구현할 지가 관건이다. This patent re-examines the recent work on the GPU's effectiveness in accelerating network applications. Through in-depth experiments and inferences, the following observations can be made in the present invention. For the first time, we have found that the computational power of the GPU is important in improving the performance of many computing-intensive algorithms widely used in network applications. According to the present invention, the popular encryption algorithms of SSL and IPSec, such as RSA, SHA-1 / SHA-2 and ChaCha20, can show the benefits of parallel computation cycles rather than transparent memory access time concealment. They exceed the performance of optimized CPU code from 1.3 to 4.8 times (x). Second, CPU-based code optimization techniques such as G-Opt [32] improve the performance of pure CPU code, while its acceleration power is limited compared to GPU performance without CPU-GPU data transfer overhead . By cost per performance metric, it can be seen that GPUs are 3.1x (x) to 4.8x (x) more cost effective if the GPU avoids the CPU-GPU data transfer overhead. Third, it can be seen that according to the present invention, the main bottleneck in GPU operation is due to the overhead of data transfer between the CPU and the GPU caused by PCIe communication instead of the lack of capacity in the GPU device itself. However, since individual packet processing generally does not require much computation or memory access, it can be difficult to hide the delay in transferring data between the CPU and the GPU. This can make it difficult to transfer asynchronous data (for example, simultaneous copying and execution of the GPU kernel) to fully overlap with GPU kernel execution. It is not surprising that, in GPU-accelerated network applications, PCIe data transfer limits performance benefits because PCIe bandwidth is typically much smaller than the GPU's memory bandwidth. In order to maximize the advantages of the GPU without the overhead of data transfer between the CPU and the GPU, the present invention can use an Accelerated Processing Unit (APU) in which the CPU and the GPU are integrated to accelerate the network applications. APU provides a single, unified memory space for both CPU and GPU, eliminating the overhead of data transfer between the CPU and the GPU, making it attractive for packet processing. In addition, it can be a cost-effective accelerator for networked systems because the power consumption is very low (eg $ 35 to $ 350 for AMD Carrizo) at a low price (eg $ 100 to $ 150). So how we implement a high-performance packet processing engine is key.

그러나, APU 기반 패킷 처리 안에서의 고성능을 달성하는 것은 약간의 실체적인 도전과제가 된다. 첫째로, 외장 GPU와 대조적으로, 내장 GPU는 메모리를(DRAM) CPU와 공유해야 하므로, 외장 GPU에 있던 높은 대역폭의 GDDR 메모리의 이점을 잃는다. CPU와 GPU 모두 공유 메모리 버스와 컨트롤러를 공유하고 있기 때문에, 고성능을 위해서는 메모리 대역폭을 효율적으로 사용하는 것이 중요하다. 두번째로, 컨텍스트들을 스위칭하고 데이터 업데이트를 동기화하는 CPU와 GPU 사이에서의 통신 오버헤드는 GPU 실행 시간의 대부분을 차지한다. 외장 GPU와 달리, 이러한 오버헤드는 오버랩된 GPU 커널 수행에 의해 더 이상 차단되지 않는다. 또한, CPU와 GPU는 독립된 캐시를 사용하므로, APU의 캐시 일관성은 값비싼 작업을 통해 시행되어야 한다. 이는 GPU에서 처리된 결과가 atomics 동기화 작업이나 느린 GPU 커널 종료없이 CPU에서 쉽게 볼 수 없음을 의미한다.However, achieving high performance in APU based packet processing is a bit of a real challenge. First, in contrast to external GPUs, the built-in GPUs have to share the memory with the (DRAM) CPU, losing the benefit of high-bandwidth GDDR memory in the external GPU. Because both the CPU and the GPU share a shared memory bus and controller, it is important to use memory bandwidth efficiently for high performance. Second, the communication overhead between the CPU and the GPU, which switches contexts and synchronizes data updates, takes up most of the GPU run time. Unlike an external GPU, this overhead is no longer blocked by the overlapped GPU kernel execution. Also, because the CPU and GPU use separate caches, the cache coherency of the APUs must be done through expensive operations. This means that the results processed by the GPU are not easily visible on the CPU without atomics synchronization or a slow GPU kernel termination.

본 특허에서는 이러한 도전을 APUNet(고성능의 APU 가속화된 네트워크 패킷 프로세서)이라고 불리는 시스템을 통해 구현하려고 한다. 메모리 대역폭의 효과적인 구현을 위하여, APUNet은 패킷 프로세싱(CPU와 GPU에 의한 패킷 수용, 처리)의 모든 단계에서 제로 복사(zero-copying)을 광범위하게 사용할 수 있다. 본 특허에서는 이러한 광범위한 제로 복사 모델(zero-copying model)이 통합된 GPU로부터의 더욱 향상된 계산력을 추출하는데 도움을 주고, IPsec에서 일반적인 버전에 비해 성능이 4.2배(x)-5.4배(x) 능가하는 것을 발견할 수 있다. CPU와 GPU 간의 통신을 최소화 하기 위해, APUNet은 지속적인 입력 패킷 스트림에서 병렬로 실행되는 GPU의 쓰레드를 종료 없이 유지하는 지속적인 GPU 커널 실행을 채택할 수 있다. GPU 커널 시작과 종료를 제거하기 위해 제로 복사와 결합하는 것은 패킷 처리 대기 시간을 7.3배(x) 에서 8.2배(x) 정도 크게 줄일 수 있고, 병렬 수행을 위한 패킷의 배치를 수집하기 위한 대기 시간을 줄일 수 있다. 또한, APUNet은, 무거운 아토믹스(atomics) 명령들을 피하기 위해, 처리된 패킷들의 메모리 영역을 GPU 쓰레드들이 내재적으로 일괄 동기화하는 "그룹 동기화"를 수행할 수 있다. 그룹 동기화 후, GPU에서 업데이트된 패킷의 결과(예를 들어, HMAC 다이제스트에서 0이 아닌 값들)를 CPU가 점검함으로써, CPU와 GPU 사이의 일관된 데이터 접근을 효율적으로 보장할 수 있고, 이로써, 동기화 성능을 5.7 배 향상시킬 수 있다. This patent attempts to implement this challenge through a system called APUNet (High Performance APU Accelerated Network Packet Processor). For an effective implementation of memory bandwidth, APUNet can make extensive use of zero-copying at all stages of packet processing (packet reception and processing by the CPU and GPU). In this patent, this broad zero-copying model helps to extract more advanced computational power from integrated GPUs and outperforms 4.2 times (x) -5.4 times (x) in the IPsec standard . ≪ / RTI > To minimize communication between the CPU and the GPU, the APUNet can adopt a persistent GPU kernel run that keeps the thread of the GPU running in parallel in the continuous input packet stream untimely. Combining with zero copy to eliminate GPU kernel startup and shutdown can reduce the packet processing latency by as much as 8.2 times (x) from 7.3 times (x), and the waiting time to collect the batch of packets for parallel execution . APUNet can also perform "group synchronization" in which GPU threads implicitly bulk synchronize memory areas of processed packets to avoid heavy atomics instructions. After the group synchronization, the CPU checks the result of the updated packet in the GPU (e.g., non-zero values in the HMAC digest), thereby effectively ensuring consistent data access between the CPU and the GPU, Can be improved by 5.7 times.

APUNet은 여러 개의 대중적인 네트워크 어플리케이션들 상에서 높은 속도와 비용적으로 효율적인 네트워크 패킷 프로세싱을 달성할 수 있다. 본 특허에 따르면, IPv4 forwarding을 제외한 모든 네트워크 어플리케이션들은 메모리- 또는 계산력이 내재되어 있는지와 무관하게, 최적의 구현과 함께 CPU 베이스라인을 능가할 수 있게 된다. APUNet은 IPv6 forwarding에서 1.6배까지, IPsec gateway에서 2.2배, SSL proxy에서 2.8배, 그리고 NIDS에서 4.0배까지 최적화된 CPU의 성능을 향상시킬 수 있다. APUNet can achieve high speed and cost effective network packet processing on several popular network applications. According to the patent, all network applications, except for IPv4 forwarding, can outperform the CPU baseline with optimal implementation, regardless of memory or computational power. APUNet can improve CPU performance by 1.6 times in IPv6 forwarding, 2.2 times in IPsec gateway, 2.8 times in SSL proxy, and 4.0 times in NIDS.

외장 GPU(Discrete GPU)External GPU (Discrete GPU)

부분의 GPU 가속화 네트워크 시스템들은 네트워크 어플리케이션들의 성능을 향상시키기 위해 외장 GPU(discrete GPU)를 사용해왔다. 전형적인 외장 GPU는 도 1에 도시한 바와 같이, PCIe 레인을 통해 호스트 측과 통신하는 PCIe 주변 장치의 형태를 취한다. 그것은 수천개의 프로세싱 코어들 (예: NVIDIA GTX980에 2048개)과 큰 메모리 대역폭 (예: 224 GB/s for GTX980)을 가지는 별개의 GDDR 메모리로 구성될 수 있다. 그것은 싱글-인스트럭션 멀티플-쓰레드(SIMT) 를 채택할 수 있고, SIMT 하에서, 쓰레드들의 그룹(NVIDIA의 워프(warp) 또는 AND 하드웨어의 파면(wavefront)) 은 잠금 스텝 방법(lock-step manner)안에서 동일한 명령어 스트림을 동시에 수행한다. 복수의 워프(warps)들 (예: 4 in GTX980)은 빠른 명령어/데이터 접근을 위한 캐쉬들(명령어, L1, 공유메모리) 또는 쓰레드들 중에 스위칭된 빠른 컨텍스트 스위칭을 위한 수천개의 레지스터들을 공유하기 위한 스트리밍 멀티프로세서(Streaming Multiprocessor, SM) 상에서 구동된다. SM 들은 주로 명령어 레벨의 병렬처리에 최적화되어 있으나, 현대의 CPU에서 일반적으로 사용 가능한 정교화된 분기 예측이나 추측 실행을 구현하지는 않는다. 모든 쓰레드들이 동일한 기본 블록을 병렬로 실행할 때 높은 성능을 얻을 수 있지만, 하나의 쓰레드가 브랜치(branch)로 인해 명령 스트림으로부터 벗어날 때, 워프 내의 다른 쓰레드의 실행은 완전히 직렬화된다. Part of the GPU-accelerated network systems have used an external GPU (discrete GPU) to improve the performance of network applications. A typical external GPU takes the form of a PCIe peripheral device that communicates with the host side via a PCIe lane, as shown in FIG. It can be composed of separate GDDR memories with thousands of processing cores (eg 2048 on NVIDIA GTX980) and a large memory bandwidth (eg 224 GB / s for GTX980). It can adopt a single-instruction multiple-thread (SIMT), and under SIMT, a group of threads (NVIDIA's warp or wavefront of AND hardware) is the same in a lock-step manner Simultaneously execute the instruction stream. Multiple warps (eg, 4 in GTX980) can be used to share thousands of registers for fast context switch switching between caches (instruction, L1, shared memory) or for fast command / data access It runs on a streaming multiprocessor (SM). SMs are mostly optimized for instruction-level parallelism, but they do not implement sophisticated branch prediction or speculative execution that are commonly available in modern CPUs. While all threads can achieve high performance when executing the same basic block in parallel, the execution of another thread in the warp is fully serialized when one thread leaves the instruction stream due to a branch.

원시 계산 싸이클들과 메모리 대역폭에 의해, 전형적인 외장 GPU는 CPU의 작업능력을 능가할 수 있다. 예를 들어, NVIDIA GTX980는 Intel Xeon E5-2650 v2 CPU 보다 110배 많은 계산 싸이클들과 3.8배 더 높은 메모리 대역폭을 가진다. 그러한 큰 계산력은 슈퍼컴퓨팅과 같이 거대하게 병렬처리되는 작업 로드 또는 깊은 신경 네트워크들에 명백한 수행상 이점을 가져온다. 그러나, 충분하게 병렬처리를 하지 않는 다른 작업로드들 안에서, GPU는 하드웨어를 충분히 구동할 수 없으므로 약하게 수행될 것이다. 따라서, 본 특허는 네트워크 어플리케이션들에서의 패킷 처리에 초점을 두고 있기 때문에, 대중적인 네트워크 어플리케이션들 안에서 GPU는 CPU보다 더 나은 수행능력을 가지는지 우리는 질문을 할 수 있다. Due to primitive computation cycles and memory bandwidth, a typical external GPU can outperform the CPU's work capabilities. For example, the NVIDIA GTX980 has 110 times the computation cycles and 3.8 times the memory bandwidth of the Intel Xeon E5-2650 v2 CPU. Such large computational power brings obvious performance benefits to massively parallel workloads or deep neural networks such as supercomputing. However, within other workloads that do not have enough parallelism, the GPU will perform poorly because it can not drive the hardware sufficiently. Thus, since this patent focuses on packet processing in network applications, we can ask if the GPU has better performance than the CPU in popular network applications.

내장 GPU(Integrated GPU)Integrated GPU (Integrated GPU)

근에, 내장 GPU는 계산력의 증가와 함께 더 많은 대중적인 인기를 얻고 있다. 외장 GPU와는 달리, 내장 GPU는 CPU와 동일한 다이(die) 안에 제조되고, 그것은 CPU와 함께 메모리(DRAM)를 공유한다. Intel과 AMD는 OpenCL에 프로그램이 가능한 내장 GPU(예: AMD's Accelerated Processing Unit (APU) or Intel HD Graphics)의 라인업을 가지고 있다. 도 2는 AMD Carrizo APU 안의 내장 GPU의 아키텍쳐의 예를 보여주고 있다. 도 2에 도시한 바와 같이, 본 발명의 일 실시예에 따른 데이터 프로세서(1)는 APU일 수 있으며, 데이터 프로세서(1)는 CPU(100), GPU(200), 공유 메모리(300, 일례로 DRAM), 인터페이스부(400), 및 메모리 컨트롤러(500)를 포함할 수 있다. 그리고 GPU(200)는 복수의 계산 유닛(210-1, 210-2, .., 210-8)과 캐쉬 메모리(220)를 포함할 수 있다.In recent years, the built-in GPU has gained more popularity with increasing computing power. Unlike an external GPU, the built-in GPU is manufactured in the same die as the CPU, which shares memory (DRAM) with the CPU. Intel and AMD have a lineup of embedded GPUs (such as AMD's Accelerated Processing Unit (APU) or Intel HD Graphics) that can be programmed into OpenCL. Figure 2 shows an example of an architecture of an embedded GPU in an AMD Carrizo APU. 2, the data processor 1 according to an embodiment of the present invention may be an APU and the data processor 1 may include a CPU 100, a GPU 200, a shared memory 300, DRAM), an interface unit 400, and a memory controller 500. The GPU 200 may include a plurality of calculation units 210-1, 210-2, .., 210-8 and a cache memory 220. [

PU(100)은 복수의 제 1 데이터를 처리할 수 있으며, 도 5에 도시한 바와 같이 하나의 마스터와 복수의 워커들을 포함할 수 있다. 또한, 이러한 복수의 제 1 데이터는 패킷 데이터일 수 있다.The PU 100 may process a plurality of first data, and may include one master and a plurality of workers as shown in FIG. The plurality of first data may be packet data.

PU(200)에 포함되는 도 2 에 도시한 바와 같은 복수의 계산 유닛(210-1, 210-2, .., 210-8) 각각은 도 6과 같은 복수의 쓰레드를 포함할 수 있다. 이러한 복수의 쓰레드는 그룹을 형성하여, 활성화 쓰레드 그룹으로 동작하거나, 비활성화 쓰레드 그룹으로 동작할 수 있다. 도 6의 쓰레드 그룹은 활성화 쓰레드 그룹의 일례로, 활성화 쓰레드는 유효 쓰레드와 아이들 쓰레드를 포함할 수 있다. 여기서, 유효 쓰레드와 아이들 쓰레드의 구분된 처리에 대한 내용은 후술한다. Each of the plurality of calculation units 210-1, 210-2, ..., 210-8 included in the PU 200 as shown in FIG. 2 may include a plurality of threads as shown in FIG. These plurality of threads may form a group, act as an active thread group, or act as an inactive thread group. The thread group of FIG. 6 is an example of an activation thread group, wherein the activation thread may include an active thread and an idle thread. Here, the separate processing of the effective thread and the idle thread will be described later.

이 때, 활성화 쓰레드 그룹은 CPU(100)의 복수의 제 1 데이터를 복수의 제 2 데이터로 변환하고, 비활성화 쓰레드 그룹은 더미 데이터 입출력을 처리하도록 할 수 있다.At this time, the active thread group may convert the plurality of first data of the CPU 100 into a plurality of second data, and the inactive thread group may process the dummy data input / output.

그리고, 활성화 쓰레드 그룹에서 변환된 복수의 제 2 데이터와 비활성화 쓰레드 그룹에서 처리된 더미 데이터가 함께 캐쉬메모리(200)를 채우도록 함으로써, 캐쉬메모리(200)에 저장된 복수의 제 2 데이터가 공유 메모리(300)로 전송되도록 하여 CPU(100)와 상기 GPU(200)간에 가속화된 동기화를 수행할 수 있다.The plurality of second data converted in the active thread group and the dummy data processed in the inactive thread group together fill the cache memory 200 so that a plurality of second data stored in the cache memory 200 is stored in the shared memory 300 to perform accelerated synchronization between the CPU 100 and the GPU 200.

인터페이스부(400)는 예를 들어, 노스 브리지와 통합 노스브리지를 포함할 수 있으며, GPU(200)로부터 복수의 제 2 데이터를 수신하여 메모리 컨트롤러(500)로 전송하고, 메모리 컨트롤러(500)는 인페이스부(400)로부터 수신한 복수의 제 2 데이터를 공유 메모리(300)로 전송할 수 있다.The interface unit 400 may include, for example, a north bridge and an integrated north bridge. The interface unit 400 receives a plurality of second data from the GPU 200 and transmits the second data to the memory controller 500, A plurality of second data received from the interface unit 400 can be transmitted to the shared memory 300. [

전형적인 내장 GPU는 적은 개수의 프로세싱 코어들을 가지고 있어 외장 GPU보다 더 낮은 계산 용량을 가지고 있다. 예를 들어, AMD Carrizo는 각각이 64 스트리밍 코어들을 포함하는 8개의 계산 유닛들(CUs)을 가지고 있다 (총 512개 코어). 본 발명의 실시예에 따른 캐쉬메모리인 L2 캐시는 계산 유닛(CU)들을 가로지르는 동기화 포인트로 이용되는 반면, L1 캐시와 레지스터들은 CU상의 스트리밍 코어들 안에서 공유된다. A typical embedded GPU has a smaller number of processing cores and has a lower computational capacity than an external GPU. For example, AMD Carrizo has eight calculation units (CUs) each containing 64 streaming cores (512 cores in total). The L2 cache, which is a cache memory according to an embodiment of the present invention, is used as a synchronization point across computing units (CUs), while the L1 cache and registers are shared within the streaming cores on the CU.

보다 적은 계산력에도 불구하고, 내장 GPU는 외장 GPU에 비해 훨씬 더 낮은 전력 소비량 (e.g., 35W for AMD Carrizo)과 더 낮은 가격 (e.g., $100-$150) 때문에 여전히 매력적인 플랫폼으로 인정받는다. 이후에, 내장 GPU는 가격당 성능의 가장 비용적으로 효율적인 가속기임을 보여줄 수 있다. Despite less computing power, built-in GPUs are still considered attractive platforms due to much lower power consumption (eg, 35W for AMD Carrizo) and lower prices (eg, $ 100- $ 150) compared to external GPUs. Later, the built-in GPU can show that it is the most cost-effective accelerator of performance per price.

내장 GPU의 가장 주목할만한 측면은 그것이 CPU와 함께 동일한 메모리 서브시스템을 공유한다는 것이다. 긍정적인 측면에서, CPU와 GPU 사이에서 효율적인 데이터 공유를 허락한다. 반대로, 외장 GPU는 프로세싱을 위한 메인 병목현상으로 정의되는 PCIe 상의 값비싼 CPU-GPU 메모리간 데이터 전송 작업들을 수행해야 한다. 효율적인 메모리 공유를 위해서, OpenCL은 CPU와 GPU 를 위한 동일한 가상의 주소 공간을 나타내는 공유 가상 메모리(SVM) 을 서포트한다. 공유 가상 메모리(SVM)은 CPU와 GPU 사이에서 버퍼 포인터들을 주고받을 수 있도록 함으로써, 데이터를 공유하기 위해 메모리를 전송(카피)하는 것을 잠재적으로 제거한다. 반면, 부정적인 측면에서, 공유 메모리는 메모리 컨트롤러상에 과부화를 상당히 증가시키고, 각각의 프로세서 당 사용 가능 메모리 대역폭을 감소시킨다. 이러한 문제점을 경감하기 위해서, 통합 GPU는 별개의 L1/L2 캐시를 이용하지만, 그것으로 인해 캐시 일관성이라는 또 다른 이슈를 제기한다. CPU와 GPU간 캐시 일관성은 OpenCL의 아토믹스(atomics) 명령어들을 통해 수행될 수 있다. 그러나, 직접적 동기화는 큰 과부하를 초래할 수 있다. 본 특허에서는, 이하에서 상기 두 가지 이슈를 추후 언급할 것이다. 첫째로, GPU 프로세싱을 위한 패킷 수용으로부터 확장된 제로 복사(zero-copying)와 함께, CPU와 GPU는 패킷 프로세싱을 위해 효율적으로 메모리 대역폭을 공유한다. 둘째로, GPU에서의 처리 결과를 CPU에게 낮은 오버헤드로 전달할 수 있도록, 내장 GPU 캐시안에 있는 결과 데이터를 공유 메모리로 내재적 동기화하는 기술을 이용한다. The most notable aspect of the embedded GPU is that it shares the same memory subsystem with the CPU. On the positive side, it allows efficient data sharing between CPU and GPU. Conversely, an external GPU must perform expensive CPU-to-GPU memory data transfers on PCIe, which is defined as the main bottleneck for processing. For efficient memory sharing, OpenCL supports shared virtual memory (SVM), which represents the same virtual address space for CPUs and GPUs. Shared virtual memory (SVM) allows buffer pointers to be exchanged between the CPU and the GPU, potentially eliminating the memory transfer (copying) to share data. On the negative side, on the other hand, shared memory significantly increases the overhead on the memory controller and reduces the usable memory bandwidth per processor. To alleviate this problem, the integrated GPU uses a separate L1 / L2 cache, but it poses another issue of cache coherency. Cache coherency between the CPU and the GPU can be done through OpenCL's atomics instructions. However, direct synchronization can result in large overloads. In the present patent, the above-mentioned two issues will be described later. First, with extended zero-copying from packet acceptance for GPU processing, the CPU and GPU share efficient memory bandwidth for packet processing. Second, we use a technique that implicitly synchronizes the result data in the embedded GPU cache to the shared memory so that the processing results on the GPU can be delivered to the CPU with low overhead.

- 참고 알고리즘 : 평가된 알고리즘들- Reference algorithm: Evaluated algorithms

CPU 기반 (베이스라인, 최적화된 CPU) 및 외장/내장 GPU에서 평가된 알고리즘들로 IP forwarding table lookup, Multi-string pattern matching, ChaCha20-Poly1305, SHA-1/SHA-2, RSA 알고리즘들이 있다. 그리고, 이들에 대한 성능 비교표는 도 3 및 도 4에 도시한 바와 같다. There are algorithms such as IP forwarding table lookup, Multi-string pattern matching, ChaCha20-Poly1305, SHA-1 / SHA-2, and RSA algorithms in CPU-based (baseline and optimized CPU) and external / embedded GPU. The performance comparison tables for these are shown in FIG. 3 and FIG.

-APUNet 디자인과 구현-APUNet Design and Implementation

본 특허에서는, APUNet이라는 APU-가속화된 네트워크 패킷 처리 시스템(APU-accelerated network packet processing system)에 대한 구현을 기술하고자 한다. 고성능을 위해, APUNet은 확장가능한 패킷 I/O 를 위해 CPU를 이용하는 반면, 병렬적 패킷 처리를 위해 내장 GPU를 이용한다. 일단, APU를 이용하는데 실체적 문제점을 기술한 후, 그것을 위한 해결책에 대해서 기술하고자 한다.In this patent, an implementation for an APU-accelerated network packet processing system (APU) called APUNet is described. For high performance, APUNet uses the CPU for scalable packet I / O, while the embedded GPU is used for parallel packet processing. Once we have described the practical problems of using the APU, we want to describe a solution for it.

- 도전과 업적- Challenges and achievements

APU는 CPU와 GPU간에 효율적인 데이터 공유가 가능하게 하지만, 고성능을 달성하기 위해 실체적인 문제가 남아있다. 첫째로, 메모리(DRAM)의 공유는 메모리 컨트롤러와 버스 상에 과부화를 가져와, 이는 잠재적으로 각각의 프로세서를 위한 효율적인 메모리 대역폭을 감소시킨다. 많은 패킷 처리 작업들이 메모리 집약적이고 패킷 I/O 그 자체가 메모리 대역폭을 소비하므로, 메모리 대역폭은 네트워크 어플리케이션들의 핵심 리소스 중 하나가 될 수 있다. 본 특허에서는, CPU와 GPU사이는 물론 네트워크카드(NIC)와 애플리케이션 버퍼들 사이 에서 불필요한 데이터 복사를 제거하는 광범위한 제로-복사(zero-copy) 패킷 처리에 의한 메모리 대역 과부화를 감소시키고자 한다. 둘째로, 빈번한 GPU 커널 시작(launch)와 종료(teardown)는 패킷 처리에 오버헤드를 초래함을 알 수 있다. 이는 APU 안에서의 GPU 커널 시작(launch)시 컨텍스트 레지스터들을 초기화하고, 종료(teardown)시 해당 결과를 CPU 측과 공유하는 공유 메모리에 동기화하는 명령어들을 실행하게 되기 때문이다. 이러한 문제점을 해결하기 위한 본 특허에서는, 지속적인 쓰레드 실행을 통해 GPU 커널 시작/종료를 제거하는 것으로 한다. 지속적인 GPU 쓰레드 실행은 커널을 오직 한번 시작(launch)하고, 패킷을 루프(loop)안에서 종료없이 처리하는 것을 지속한다. 하지만, APU는 캐시를 각각 따로 가지고 있는 CPU와 GPU간의 캐시 일관성을 보증할 수 없고, 상기 두개의 프로세서들의 캐시 안의 데이터를 동기화하기 위한 값비싼 아토믹스(atomics) 동작을 요구하는 문제가 있다. 본 특허에서는, 캐시에서 메모리로의 데이터 공유가 요구될 때만 캐시 데이터를 공유 메모리에 내재적으로 내보내는 그룹 동기화(group synchronization) 로 이 문제점을 극복하고자 한다. 이는 또한 동기화의 비용을 현저히 감소시킬 수 있다.APU enables efficient data sharing between the CPU and the GPU, but there is a real problem to achieve high performance. First, sharing of memory (DRAM) brings overhead on the memory controller and bus, potentially reducing the effective memory bandwidth for each processor. Since many packet processing tasks are memory intensive and packet I / O itself consumes memory bandwidth, memory bandwidth can be one of the core resources of network applications. This patent attempts to reduce memory bandwidth overhead by a wide range of zero-copy packet processing that eliminates unnecessary data copying between the CPU and the GPU, as well as between the network card (NIC) and application buffers. Second, it can be seen that frequent GPU kernel launch and teardown result in overhead in packet processing. This is because the GPU will initialize the context registers when the GPU kernel launches in the APU and will execute the instructions to synchronize the results to the shared memory shared with the CPU side during teardown. In order to solve this problem, it is assumed that the GPU kernel start / end is eliminated through continuous thread execution. A persistent GPU thread execution only launches the kernel once and continues to process the packet in a loop without termination. However, the APU can not guarantee cache coherency between the CPU and the GPU, each with its own cache, and has the problem of requiring costly atomics operations to synchronize the data in the cache of the two processors. This patent attempts to overcome this problem with group synchronization, in which cache data is implicitly exported to the shared memory only when data sharing from cache to memory is required. This can also significantly reduce the cost of synchronization.

-전반적인 시스템 아키텍쳐- Overall system architecture

도 5는 본 발명의 일 실시예에 따른 APUNet의 전반적 아키텍쳐에 대한 도면이다. 도 5에 도시한 바와 같이, 본 발명의 일 실시예에 따른 APUNet은 CPU(100), GPU(200), 공유 메모리(300', 예를 들어 가상 공유 메모리)를 포함할 수 있다. 그리고, CPU(100)는 하나의 마스터(master)와 복수의 워커(worker) 프레임을 포함할 수 있다. 워커들이 패킷 I/O를 수행하고 마스터를 통한 GPU와의 패킷 처리를 요구하면 마스터는 GPU와 직접적으로 통신할 수 있다. 마스터와 각각의 워커는 CPU 코어들 중 하나에 고정되는 쓰레드로 구현될 수 있다. CPU와 GPU는 패킷 포인터 어레이(array)와 패킷 페이로드(packet payload)를 저장하는 패킷 메모리 풀(packet memory pool)을 공유할 수 있다. 그들은 또한 IP 포워딩 테이블이나 암호 연산을 위한 키 값 같이 어플리케이션에 특화된 데이터 구조를 공유할 수 있다. 5 is a diagram of an overall architecture of an APUNet according to an embodiment of the present invention. As shown in FIG. 5, the APUNet according to an embodiment of the present invention may include a CPU 100, a GPU 200, and a shared memory 300 '(for example, a virtual shared memory). The CPU 100 may include one master and a plurality of worker frames. When the worker performs packet I / O and requests packet processing with the GPU through the master, the master can communicate directly with the GPU. The master and each worker can be implemented as threads fixed to one of the CPU cores. The CPU and GPU can share a packet memory pool that stores packet pointer arrays and packet payloads. They can also share application-specific data structures such as IP forwarding tables or key values for cryptographic operations.

본 발명은, 패킷이 어떻게 APUNet안에서 처리되는지를 기술한다. APUNet은 Intel DPDK packet I/O library를 이용하여 들어오는 패킷들을 일괄적으로 읽어들인다. 각각의 워커들은 수신측 배율(receive-side scaling (RSS))을 사용하여 로드 밸런싱되는 패킷들의 일부를 처리한다. 일괄 패킷들이 워커 쓰레드에 도착하게 되면, 워커 쓰레드는 각 패킷의 유효성을 점검하고, 패킷 포인터들을 마스터의 데이터 큐(data queue)로 넣는다. 그리고 나서, 마스터는 GPU에게 새로운 패킷들의 도착을 알리고, GPU 안에서 지속적으로 구동되고 있는 GPU 쓰레드들은 각각 패킷 처리를 수행한다. 패킷 처리가 완료되면, GPU는 이러한 결과를 마스터 쓰레드에 동기화한다. 그리고 나서, 마스터는 워커의 결과 큐(result queue)에 결과를 통지하고, 워커 쓰레드는 처리된 패킷들을 최종적으로 네트워크 포트로 내보낸다. 데이터 동기화의 상세한 내용은 이하 하부에서 상술한다. The present invention describes how a packet is processed in APUNet. APUNet uses the Intel DPDK packet I / O library to collect incoming packets in batches. Each worker processes some of the packets that are load balanced using receive-side scaling (RSS). When batch packets arrive at the worker thread, the worker thread checks each packet for validity and puts packet pointers into the master's data queue. The master then notifies the GPU of the arrival of new packets, and GPU threads that are continuously running within the GPU perform packet processing, respectively. When the packet processing is complete, the GPU synchronizes these results to the master thread. The master then notifies the worker of the result in the worker's result queue, and the worker thread finally sends the processed packets to the network port. Details of the data synchronization will be described in detail below.

-지속적인 GPU 쓰레드 실행- Continuous GPU thread execution

GPU에 기초한 패킷 처리는 전형적으로 GPU 쓰레드들의 높은 활용을 위해 많은 수의 패킷들을 수집한다. 그러나, 그러한 모델은 두가지 결점을 포함한다. 첫째로, 패킷들을 모으는 동안의 대기로 인하여 패킷 처리 지연 시간을 증가시킨다. 둘째로, 각각의 GPU 커널 시작(launch)과 종료(teardown)는 다음 일괄 패킷들의 처리 시간을 더욱 지연시키는 오버헤드를 초래한다. 각각의 GPU 커널 시작(launch)과 종료(teardown)에서 CPU와 GPU 간 업데이트 된 데이터를 동기화해야 하기 때문에 APU에서 오버헤드는 중요한 문제이다. GPU-based packet processing typically collects a large number of packets for high utilization of GPU threads. However, such a model involves two drawbacks. First, it increases the packet processing delay time due to waiting while collecting packets. Second, each GPU kernel launch and teardown results in an overhead that further delays the processing time of the next batch of packets. Overhead is an important issue in APU because each GPU kernel has to synchronize updated data between CPU and GPU at launch and teardown.

이 문제를 해결하기 위하여, 본 발명에서는 지속적(persistent) GPU 커널 실행 방법을 이용한다. 기본적으로, 입력 패킷 스트림을 처리하는 수많은 GPU 쓰레드들의 구동을 종료없이 지속적으로 유지하도록 한다. 이러한 접근은, 커널 시작(launch)과 종료(teardown)에서의 오버헤드를 완전히 피하고, 그들이 새로 도착한 패킷들을 바로 처리하도록 함으로써, 패킷 처리 지연 시간을 감소시키도록 하고 있다. 그러나, 이러한 순진한 구현은 많은 쓰레드들이 동일한 명령 스트림에서 새 패킷이 들어올 때마다 다른 경로를 실행하게 됨으로써, GPU의 병렬 프로세싱이 제대로 활용되지 못하게 될 수도 있다.To solve this problem, the present invention uses a persistent GPU kernel execution method. Basically, it keeps the running of many GPU threads processing the input packet stream continuously and without end. This approach avoids the overhead of kernel launch and teardown and reduces packet processing latency by allowing them to process newly arriving packets directly. However, this naive implementation may cause many threads to execute different paths each time a new packet arrives in the same command stream, which may prevent the GPU's parallel processing from being used properly.

APUNet은 효율적이고 일괄적인 쓰레드 실행을 위한 패킷 일괄처리와 병렬 처리 사이의 적절한 밸런스를 찾고자 한다. 이를 위하여, APU 하드웨어가 동작하는 방식에 대한 이해가 필요하다. GPU의 각각의 계산 유닛(CU)는 4개의 SIMT 유닛들을 가지고, 각각의 SIMT 유닛은 동일한 명령어 스트림을 병행하게 처리하기 위한 16개의 작업 아이템들(또는 쓰레드들)로 구성된다. 그래서, 본 발명에서는 패킷들을 SIMT 유닛의 배수 단위로 GPU에 넣어 모든 쓰레드들이 병렬적으로 동시에 실행되도록 한다. 마스터는 데이터 큐(Data Queue)에서 패킷들을 SIMT 단위의 개수로 패킷을 꺼내고(dequeue) 이를 그룹화하고, GPU로 일괄 전달한다. 예를 들어, 패킷을 32개씩 일괄처리 하도록 구현하고, 두개의 SIMT 유닛들(GPU 쓰레드 그룹 크기) 안에서 쓰레드들이 패킷들을 병렬처리한다. 마스터가 데이터 큐에서 꺼낸(dequeue) 패킷들의 수가 GPU 쓰레드 그룹 크기보다 작은 경우, 그룹 안에서 처리할 패킷이 없는 GPU 쓰레드들은 휴식(idle) 상태로 유지한다. 이러한 방식으로, 다음번 일괄처리 패킷들이 도달하는 경우, 그것들은 별개의 GPU 쓰레드 그룹에 의해 처리된다. 본 발명의 일 실시예에 따르면, 새로운 패킷들을 별개의 GPU 쓰레드 그룹으로 전송하는 것이, 활성화된 GPU 쓰레드 그룹 안에서 휴식(idle) 상태인 GPU 쓰레드들에게 전송하는 것보다 더 나은 결과를 가져올 수 있다.APUNet tries to find the right balance between packet batching and parallel processing for efficient and coherent thread execution. To this end, it is necessary to understand how APU hardware works. Each calculation unit (CU) of the GPU has four SIMT units, and each SIMT unit consists of 16 work items (or threads) for processing the same instruction stream in parallel. Thus, in the present invention, the packets are put into the GPU in multiples of the SIMT unit so that all the threads are executed in parallel simultaneously. The master dequeues packets into a number of SIMT units in the data queue, groups them, and delivers them to the GPU in batches. For example, you can implement a batch of 32 packets and the threads parallelize the packets within the two SIMT units (GPU thread group size). If the number of dequeue packets from the master queue is less than the GPU thread group size, the GPU threads that have no packets to process within the group remain idle. In this way, if the next batch of packets arrive, they are processed by a separate GPU thread group. In accordance with one embodiment of the present invention, transferring new packets to a separate GPU thread group may yield better results than transmitting to idle GPU threads within an activated GPU thread group.

본 발명의 일 실시예에 따르면, CPU(100)의 복수의 제 1 데이터로부터 전환된 복수의 제 2 데이터가 GPU(200)에 저장되고, 복수의 제 2 데이터를 공유 메모리(300)로 전송함으로써, GPU와 상기 공유 메모리간에 동기화를 가속화하여 수행하도록 할 수 있다. 본 발명의 일 실시예에 따른 제 1 데이터는 CPU(100)에서 생성, 처리되어 GPU(200)로 전송되는 데이터를 포함할 수 있고, 제 2 데이터는 후술할 더티 데이터 아이템(dirty data items)을 포함할 수 있다.According to an embodiment of the present invention, a plurality of second data converted from a plurality of first data of the CPU 100 is stored in the GPU 200, and a plurality of second data is transferred to the shared memory 300 , And may be performed by accelerating synchronization between the GPU and the shared memory. The first data according to an embodiment of the present invention may include data generated and processed by the CPU 100 and transmitted to the GPU 200, and the second data may include dirty data items .

예를 들어, GPU는 CPU로부터 데이터를 수신하고, 수신한 데이터가 처리되어 dirty data items로 전환되면, 전환된 dirty data items를 먼저 GPU 안에 저장한다. 또한, dirty data items 는 그룹 기반 내재적 플러시(implicit flush)를 통해 공유 메모리(300)로 전송됨으로써, CPU(100)와 GPU(200)간에 공유 메모리(300)를 통한 동기화가 가속화하여 수행될 수 있다.For example, when a GPU receives data from a CPU and the received data is processed and converted to dirty data items, the converted dirty data items are first stored in the GPU. In addition, the dirty data items may be transferred to the shared memory 300 through a group-based implicit flush so that the synchronization between the CPU 100 and the GPU 200 through the shared memory 300 may be accelerated .

본 발명의 일 실시예에 따르면, GPU(200)는 쓰레드 그룹들을 포함하고, 쓰레드 그룹들은 활성화된 액티브 쓰레드 또는 비활성화된 인액티브 쓰레드로 동작하며, GPU(200)에 저장된 복수의 제 2 데이터는 액티브 쓰레드를 통해 공유 메모리(300)로 전송될 수 있다.According to one embodiment of the present invention, the GPU 200 includes thread groups, the thread groups operate as active threads that are active or deactivated inactive threads, and a plurality of second data stored in the GPU 200 are active Thread may be sent to the shared memory 300 via the thread.

도 6에 따르면, 일관적인 쓰레드 처리의 전반적인 아키텍쳐를 보여주고 있다. CPU와 GPU는 활성화되거나(non-zero) 휴식상태(idle, ex> zero) 와 같은 GPU 쓰레드 그룹의 모드를 식별하는 그룹 마다의 상태(per-group state)를 공유한다. 이러한 상태 값은 각 GPU 쓰레드 그룹이 처리할 패킷들의 수를 가리킨다. 모든 GPU 쓰레드 그룹들은 휴식 상태로 초기화되고, 그것들이 활성화되기까지 지속적으로 폴-온(poll on)한다. 새로운 패킷들이 도달하면, 마스터 쓰레드는 휴식상태의 GPU 쓰레드 그룹을 찾아 패킷 처리가 가능한 상태(state) 값으로 세팅함으로써, 그 그룹을 활성화한다. GPU 쓰레드 그룹이 자신이 0이 아닌(non-zero) 상태인(state) 값을 감지하면, 해당 그룹의 각각의 GPU 쓰레드는 자신의 로컬 ID와 상태 값을 비교함으로써 자신이 처리할 패킷이 있는 지 여부를 점검한다. According to Fig. 6, the overall architecture of coherent threading is shown. The CPU and the GPU share a per-group state that identifies the mode of the GPU thread group, such as active (non-zero) and break (idle, ex> zero) This status value indicates the number of packets to be processed by each GPU thread group. All GPU thread groups are initialized to a break state and are continuously polled until they are activated. When new packets arrive, the master thread activates the group by locating the GPU thread group at rest and setting it to a state value that allows packet processing. When a GPU thread group detects a non-zero state, each GPU thread in the group compares its local ID with its state value to determine whether there is a packet to process .

로컬 ID가 상태값보다 작은 GPU 쓰레드들은 자신의 글로벌 ID에 의해 인덱스된 패킷 포인터를 패킷 포인터 어레이에서 찾아 처리하기 시작한다. 그리고 다른 쓰레드들은 메모리 장벽 상에서 대기하는 휴식(idle) 상태를 유지한다. 예를 들어, 도 6에 도시한 바와 같이, 상태값이 28인 경우, 28보다 작은 쓰레드 0부터 쓰레드 27은 유효 쓰레드로 분류되고, 쓰레드 28부터 쓰레드 31은 아이들 쓰레드로 분류되는 것이다. 이 그룹 내 모든 쓰레드들이 실행을 끝내고 이러한 장벽을 만나면, 최소값의 local ID를 가지는 쓰레드는 그룹 상태를 다시 0으로 변경시켜 CPU에게 패킷 처리가 끝났음을 알린다. 한편, 도 5에 도시한 바와 같이, CPU(100)는 하나의 마스터와 복수의 워커들을 포함할 수 있고, CPU(100)에 포함된 마스터가 정기적으로 GPU(200)의 상태를 모니터링한 결과, 활성화 쓰레드 그룹에 포함된 복수의 쓰레드 전부가 처리된 것으로 판단한 경우, 마스터는 이러한 판단 결과를 복수의 워커들에 전송할 수 있다. GPU threads whose local ID is less than the status value start to find and process the packet pointer array indexed by its global ID in the packet pointer array. And other threads remain idle waiting on the memory barrier. For example, as shown in FIG. 6, when the state value is 28, threads 0 through 27 smaller than 28 are classified as valid threads, and threads 28 through 31 are classified as idle threads. When all threads in this group have finished executing and encounter these barriers, the thread with the local ID of the minimum value changes the group status back to 0 to inform the CPU that the packet processing is finished. 5, the CPU 100 may include one master and a plurality of workers. As a result of the master included in the CPU 100 periodically monitoring the state of the GPU 200, If it is determined that all of the plurality of threads included in the activated thread group have been processed, the master can transmit the determination result to the plurality of workers.

-그룹 동기화- Group synchronization

지속적인 GPU 쓰레드에 관한 또 다른 이슈는 CPU와 GPU 사이의 캐시 일관성을 저 비용으로 어떻게 보증하는가에 관한 것이다. GPU가 패킷 프로세싱을 끝내면, 그것의 결과는 쉽게 CPU에 보여지지 않는다. 왜냐하면 결과가 CPU가 볼 수 있는 공유 메모리가 아닌 GPU 쓰레드의 동기화 포인트인 GPU의 L2 캐시에 머무르기 때문이다. GPU의 업데이트를 공유 메모리로 직접적으로 동기화하기 위해, OpenCL은 C++11 standard 과 함께 아토믹스(atomics) 명령어를 제공한다. 아토믹스 동작은 도 2에 도시한 점선 화살표와 같은 일관된 작업 경로를 통해 실행된다. 여기서 작업은 그래픽 노스 브리지(graphics north bridge)에 위치한 일관된 허브(coherent hub, CHUB) 에 의해 실행될 수 있다. 불행하게도, 그것들은 잠금(locking)과 같은 추가적인 명령어들을 요구하기에 값비싸고, CHUB는 한번에 오직 하나의 아토믹스 동작을 수행할 수 있다. 모든 아토믹스 동작들은 오버헤드를 초래하고, 수천개의 GPU 쓰레드들로부터의 요구를 직렬적으로 처리하는 것은 심각한 오버헤드를 초래하고, 전체적인 성능을 떨어뜨린다. Another issue with persistent GPU threads is how to guarantee cache coherency between the CPU and the GPU at low cost. When the GPU finishes packet processing, its results are not easily seen on the CPU. This is because the results stay in the GPU's L2 cache, which is the synchronization point of the GPU thread, not the shared memory that the CPU can see. To directly synchronize GPU updates to shared memory, OpenCL provides atomics instructions along with the C ++ 11 standard. The atomix operation is performed through a coherent work path as indicated by the dotted arrow in Fig. Where the work can be performed by a coherent hub (CHUB) located in the graphics north bridge. Unfortunately, they are expensive to require additional commands such as locking, and CHUB can only perform one atomic operation at a time. All atomics operations result in overhead, and serial processing of requests from thousands of GPU threads results in significant overhead and overall performance degradation.

이를 해결하기 위하여 그룹 동기화(group synchronization)를 수행할 수 있다. 그것은, GPU 쓰레드 그룹이 처리를 끝낸 패킷들의 메모리 영역을 내재적으로 동기화하도록 한다. 내재적 동기화를 위하여, 본 발명에서는 GPU 캐시 안의 dirty data items을 공유 메모리로 내보내는 GPU의 LRU(Least Recently Used) 캐시 교체 정책을 이용할 수 있다.To solve this problem, group synchronization can be performed. It allows the GPU thread group to implicitly synchronize the memory areas of the processed packets. For intrinsic synchronization, the present invention may utilize a GPU LRU (Least Recently Used) cache replacement policy for exporting dirty data items in the GPU cache to the shared memory.

예를 들어, CPU로부터 수신한 복수의 데이터가 순차적으로 GPU에서 dirty data item으로 변환되면, 순차적으로 변환된 dirty data item이 순차적으로 공유 메모리로 전송될 수 있다. 즉, 가장 먼저 변환된 GPU의 dirty data item이 순차적으로 공유메모리로 전송될 수 있는 것이다. 본 발명의 일 실시예에 따르면, 현재 상태값이 0인 휴식상태의 GPU 쓰레드 그룹들을 이용할 수 있고, 이로써, 그들은 더미(dummy) 데이터 I/O를 별개의 구분된 메모리 블록에서 수행할 수 있으며, 이 데이터가 L2 캐시의 용량을 가득 채우게 하여 기존에 L2 캐시에 남아있던 패킷 결과 데이터가 공유 메모리로 내보내지도록 할 수 있다. 이것은 메모리에 추가 과부화를 가져오기는 하지만, 아토믹스 명령을 통해 매 패킷 처리마다 동기화하는 것보다 그룹의 메모리 영역을 내재적으로 동기화하는 것이 보다 더 효율적임을 알 수 있다. For example, when a plurality of data received from a CPU is sequentially converted from a GPU to a dirty data item, the sequentially converted dirty data items may be sequentially transferred to the shared memory. That is, the dirty data item of the first converted GPU can be sequentially transferred to the shared memory. According to an embodiment of the present invention, it is possible to use resting GPU thread groups with a current state value of zero so that they can perform dummy data I / O in separate distinct memory blocks, This data can fill the capacity of the L2 cache so that the resultant data of the packet that was previously stored in the L2 cache can be exported to the shared memory. This brings additional overhead to memory, but it can be seen that it is more efficient to intrinsically synchronize the memory area of the group than to synchronize every packet through the Atomix command.

활성화된 GPU 쓰레드 그룹안에 있는 휴식상태(idle) 쓰레드들은 (예를 들어, 그것의 그룹 상태 값보다 큰 local ID를 가진 쓰레드), 더미 데이터 I/O를 수행하는 것이 활성화된 쓰레드들의 명령어 스트림으로부터 벗어나게 하여 작업을 직렬화 시키기 때문에 여전히 메모리 장벽에서 대기하고 있고, 이로서 패킷 프로세싱이 병렬화된다. 만일, 모든 GPU 쓰레드 그룹들이 활성화되어 있다면, 모든 GPU 쓰레드들이 GPU의 캐시에 결과를 저장할 것이고, 이로서 캐시 안의 dirty data는 더미 데이터 I/O 없이도 공유 메모리로 내보내질 것이다. 최종적으로, 패킷 처리결과가 업데이트 된 것을 CPU가 입증하는 것을 통해 CPU와 GPU 사이의 데이터 일관성이 보장될 수 있다. Idle threads in an active GPU thread group (for example, a thread with a local ID greater than its group state value) are allowed to perform dummy data I / O from the instruction stream of activated threads To serialize the work, it is still waiting on the memory barrier, which results in parallel processing of the packet processing. If all GPU thread groups are active, all GPU threads will store the results in the GPU's cache so that dirty data in the cache will be exported to shared memory without dummy data I / O. Finally, data validation between the CPU and the GPU can be assured by the CPU verifying that the packet processing results have been updated.

- 패킷 처리 대기 시간(packet processing latency)- Packet processing latency

도 7은 실시예에 따른 다양한 패킷 사이즈에 기반한 패킷 처리 대기시간에 대한 도면이다.7 is a diagram of packet processing latencies based on various packet sizes according to an embodiment.

- APUNet 동기화 실험 결과- APUNet synchronization experiment result

전술한 아토믹스(atomics) 와 비교한 그룹 동기화(group synchronization)의 성능 향상에 대해 평가하고자 한다. 이를 위하여, 본 발명에서는 IPsec kernel code를 구동하는 GPU에 64B IP 패킷들을 통과하는 테스트를 실행한다. IPsec 모듈은 암호화하는 동안 IP 페이로드를 완전히 업데이트할 수 있기 때문에, 본 발명에서는 IPsec 모듈을 디폴트 GPU 커널로 선택한다. 이로써, GPU의 전체적인 패킷 결과는 CPU가 보는 공유 메모리에 동기화될 필요가 있다. 제로 복사 패킷 처리와 지속적인 쓰레드 실행은 기본적으로 구현되어 있다. 측정을 통해, 본 발명에서는 APUNet으로 그룹 동기화하는 것이 아토믹스 방법으로 동기화하는 것에 비해 5.7배의 성능 향상을 가져옴을 발견하였다. 본 발명에서는 APUNet이 CPU와 GPU사이의 동기화시 오버헤드를 감소시켜 저 비용으로도 고성능을 획득할 수 있음을 발견하였다. We will evaluate the performance improvement of group synchronization compared with the above-mentioned atomics. To this end, the present invention executes a test for passing 64B IP packets to the GPU driving the IPsec kernel code. Since the IPsec module can completely update the IP payload during encryption, the present invention selects the IPsec module as the default GPU kernel. As a result, the overall packet result of the GPU needs to be synchronized to the shared memory that the CPU sees. Zero copy packet processing and continuous thread execution are implemented by default. Through the measurements, we found that group synchronization with APUNet results in a performance increase of 5.7 times compared to synchronizing with the atomics method. In the present invention, it has been found that APUNet can achieve high performance at low cost by reducing the overhead in synchronization between the CPU and the GPU.

본 발명에서는 CPU 베이스라인의 출력물과 G-Opt를 통해 최적화된 구현들을 상호 비교함으로써, 실제의 네트워크 어플리케이션들안의 APUNet의 실용성을 결정한다.The present invention determines the practicality of the APUNet in real network applications by comparing the CPU baseline output with the G-Opt optimized implementations.

- IPv4/IPv6 packet forwarding- IPv4 / IPv6 packet forwarding

본 발명에서는 IPv4/IPv6 packet을 랜덤한 목적지 IP 주소로 전송하는 네트워크 어플리케이션을 구현하였다. 그리고, APUNet은 IPv4/IPv6 테이블 룩업(table lookups)을 실행한 이후, 적당한 네트워크 포트로 패킷들을 전송한다. IPv6 테이블 룩업을 위해, longest prefix matching(LPM)에 기초한 알고리즘과 함께 해싱(hashing)에 기초한 lookup algorithm을 평가하였다. 도 8은 다양한 패킷들 사이즈에 의한 전송 결과물들을 보여준다. 본 발명에서는, G-Opt가 IPv4/IPv6 테이블 룩업들의 메모리 접근을 효율적으로 숨김으로써, CPU 베이스라인에 기초한 성능을 1.25배에서 2.0배까지 각각 향상시킬 수 있음을 알 수 있다. APUNet의 경우 불행히도, 도 8(a)와 같은 IPv4에 의한 전송은 여러가지 이유로 성능이 떨어질 수 있다. 첫째로, IPv4 table lookup은 간단한 동작으로, CPU와 GPU사이의 통신상 오버헤드가 전체 패킷 처리 시간의 상대적으로 많은 부분을 차지하고 있다. 둘째로, APUNet은 GPU와 통신하기 위한 1개의 마스터 CPU 코어를 독점하고, 오직 3개의 CPU 코어들이 패킷 I/O를 수행하도록 함으로써, IPv4의 4개의 CPU 코어들의 앞선 성능을 만족시키기에 불충분하게 된다. 또한, CPU와 GPU사이의 공유된 패킷 메모리 풀을 사용하기 위해 SVM을 이용할 때 성능상 단점이 있다. 반면에, 도 8(b)와 같은 IPv6 패킷 전송(IPv6 forwarding)은 보다 복잡한 동작을 필요로 한다. APUNet은 해싱에 기초한 IPv6 forwarding의 경우 최적화된 CPU 구현에(G-Opt) 비해 1.6배까지 능가할 수 있다. 여기서, LPM에 기초한 IPv6 forwarding은 해싱을 요구하지 않아 자원적으로 효율적이기 때문에, APUNet의 성능이 G-Opt와 비슷하다는 것을 알 수 있다. In the present invention, a network application for transmitting an IPv4 / IPv6 packet to a random destination IP address is implemented. APUNet then performs IPv4 / IPv6 table lookups and then sends packets to the appropriate network port. For the IPv6 table lookup, we evaluated the lookup algorithm based on hashing with an algorithm based on longest prefix matching (LPM). Figure 8 shows the transmission results by various packet sizes. In the present invention, it can be seen that G-Opt efficiently hides the memory access of the IPv4 / IPv6 table lookups, thereby improving the performance based on the CPU baseline from 1.25 times to 2.0 times. Unfortunately, in APUNet, the transmission by IPv4 as shown in Fig. 8 (a) may be degraded for various reasons. First, IPv4 table lookup is a simple operation, and the communication overhead between the CPU and the GPU accounts for a relatively large portion of the total packet processing time. Second, APUNet monopolizes one master CPU core to communicate with the GPU, and only three CPU cores perform packet I / O, which is insufficient to satisfy the advanced performance of the four CPU cores of IPv4 . Also, there is a performance penalty when using the SVM to use a shared packet memory pool between the CPU and the GPU. On the other hand, IPv6 forwarding as shown in FIG. 8 (b) requires more complicated operations. APUNet can outperform 1.6 times the optimized CPU implementation (G-Opt) for hashing-based IPv6 forwarding. Here, IPv6 forwarding based on LPM is resource efficient because it does not require hashing, so we can see that the performance of APUNet is similar to that of G-Opt.

- IPsec gateway- IPsec gateway

IPsec gateway를 통해 APUNet이 네트워크 어플리케이션을 얼마나 효율적으로 구동하는지에 대해 기술하고자 한다. IPsec gateway는 CBC 모드안의 128-bit AES scheme의 패킷 페이로드를 암호화하고, HMAC-SHA1과 함께 인증 다이제트스(authentication digest)를 생성한다. CPU 베이스라인과 G-Opt 버전은, 하나의 AESENC/AESDEC 명령어와 함께 각각의 AES 암호화/복호화를 구동하는 x86 명령어 셋인 Intel의 AES-NI를 이용할 수 있다. APUNet에서 지속적인 GPU 쓰레드 실행을 위해 AES-CBC와 HMAC-SHA1 커널 코드를 하나의 통합된 커널로 합쳐 IPsec gateway의 GPU 버전을 구현할 수 있다. 도 9는 해당 평과 결과를 보여준다. AES는 하드웨어 명령어와 함께 이미 최적화되고, HMAC-SHA1 명령어는 컴퓨팅 집약도가 높기 때문에, G-Opt의 경우, CPU 베이스라인의 성능을 향상시키는데 실패한다. 반면에, APUNet은 2.2배속의 스피드업 향상을 보이고, 1451B 패킷 크기에서 16.4 Gbps 처리속도를 달성한다. We will describe how efficiently APUNet runs network applications through the IPsec gateway. The IPsec gateway encrypts the packet payload of the 128-bit AES scheme in CBC mode and generates an authentication digest with HMAC-SHA1. The CPU baseline and G-Opt versions can use Intel's AES-NI, an x86 instruction set that drives each AES encryption / decryption with a single AESENC / AESDEC instruction. APUNet can implement the GPU version of IPsec gateway by combining AES-CBC and HMAC-SHA1 kernel code into one integrated kernel for continuous GPU thread execution. Fig. 9 shows the results of the evaluation. Since AES is already optimized with hardware instructions and HMAC-SHA1 instructions are computationally intensive, G-Opt fails to improve CPU baseline performance. APUNet, on the other hand, shows a 2.2x speed-up improvement and achieves 16.4 Gbps throughput at 1451B packet size.

- 네트워크 명령어 감지 시스템(Network instruction detection system, NIDS)- Network instruction detection system (NIDS)

APUNet에 NIDS를 적용하고자 한다. APUNet 기반 NIDS는 Aho-Corasick We want to apply NIDS to APUNet. APUNet based NIDS is Aho-Corasick

(AC) 패턴 일치 알고리즘을 사용하여 이미 알려진 공격 시그니처에 대한 진입 네트워크 트래픽을 스캔한다. 본 발명에서는 네트워크의 악성 활동을 모니터하고 AC 패턴 매칭 코드에 G-Opt를 적용한 Snort 기반 공격 룰셋을 사용하는 NIDS를 포팅 했다. 도 10은 랜덤화된 페이로드와 다양한 패킷 사이즈를 가진 무해한 합성 트래픽에 대한 처리결과를 보여준다. 여기서, full NIDS는 G-Opt로부터 이득을 얻지 않는다. 이것은 패킷 분석 동안 NIDS의 수많은 데이터 구조들(패킷 습득, 디코딩 및 감지 모듈들)에 접근하게 되고, 데이터 캐시에 과부화를 야기시킴으로써, 프리페치 된 (prefetched) 그것들이 사용되기 전에 다른 프리페치들에 의해 이미 캐시된 데이터를 제거되게 되는 결과를 가져오게 된다. 반면에, APUNet은 큰 패킷 사이즈의 경우 CPU 기반 NIDS에 비해 성능을 4배까지 올리는 것을 돕는다. 작은 패킷 사이즈의 경우, 계산 로드가 적기 때문에(64B 패킷에서 페이로드의 10B만 스캔된다), IPv4 forwarding과 유사하게 APUNet이 비효율적이다 (AC) pattern match algorithm to scan incoming network traffic for known attack signatures. In the present invention, we have ported NIDS using a Snort-based attack rule set that monitors malicious activity on the network and applies G-Opt to the AC pattern matching code. Figure 10 shows the processing results for randomized payloads and harmless synthetic traffic with various packet sizes. Here, full NIDS does not benefit from G-Opt. This allows access to numerous data structures (packet acquisition, decoding and detection modules) of the NIDS during packet analysis and by causing overloading of the data cache such that prefetched data can be accessed by other prefetches before they are used Resulting in the removal of already cached data. On the other hand, APUNet helps boost performance by up to 4 times compared to CPU-based NIDS for large packet sizes. For small packet sizes, APUNet is inefficient because of low computational load (only 10B of payload is scanned in 64B packets), similar to IPv4 forwarding

이상에서 실시예들에 설명된 특징, 구조, 효과 등은 본 발명의 하나의 실시예에 포함되며, 반드시 하나의 실시예에만 한정되는 것은 아니다. 나아가, 각 실시예에서 예시된 특징, 구조, 효과 등은 실시예들이 속하는 분야의 통상의 지식을 가지는 자에 의해 다른 실시예들에 대해서도 조합 또는 변형되어 실시 가능하다. 따라서 이러한 조합과 변형에 관계된 내용들은 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다.The features, structures, effects and the like described in the embodiments are included in one embodiment of the present invention and are not necessarily limited to only one embodiment. Furthermore, the features, structures, effects and the like illustrated in the embodiments can be combined and modified by other persons skilled in the art to which the embodiments belong. Therefore, it should be understood that the present invention is not limited to these combinations and modifications.

또한, 이상에서 실시예를 중심으로 설명하였으나 이는 단지 예시일 뿐 본 발명을 한정하는 것이 아니며, 본 발명이 속하는 분야의 통상의 지식을 가진 자라면 본 실시예의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 예를 들어, 실시예에 구체적으로 나타난 각 구성 요소는 변형하여 실시할 수 있는 것이다. 그리고 이러한 변형과 응용에 관계된 차이점들은 첨부된 청구 범위에서 규정하는 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is clearly understood that the same is by way of illustration and example only and is not to be taken by way of illustration, It can be seen that various modifications and applications are possible. For example, each component specifically shown in the embodiments can be modified and implemented. It is to be understood that all changes and modifications that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (6)

복수의 제 1 데이터를 처리하는 CPU(중앙처리장치);
복수의 계산 유닛과 캐쉬메모리를 포함하는 GPU(그래픽처리장치); 및
상기 CPU와 상기 GPU가 데이터 저장을 위해 공유하는 공유 메모리를 포함하고,
상기 복수의 계산 유닛 각각은 복수의 쓰레드를 포함하며, 상기 복수의 계산 유닛 중 적어도 일부는 활성화 쓰레드 그룹으로 동작하고 상기 복수의 계산 유닛 중 나머지는 비활성화 쓰레드 그룹으로 동작하며,
상기 활성화 쓰레드 그룹이 상기 복수의 제 1 데이터를 복수의 제 2 데이터로 변환하고,
상기 비활성화 쓰레드 그룹이 더미 데이터 입출력을 처리하도록 하여,
상기 활성화 쓰레드 그룹에서 변환된 상기 복수의 제 2 데이터와 상기 비활성화 쓰레드 그룹에서 처리된 상기 더미 데이터가 함께 상기 캐쉬메모리를 채우도록 함으로써, 상기 캐쉬메모리에 저장된 상기 복수의 제 2 데이터가 상기 공유 메모리로 전송되도록 하여 상기 CPU와 상기 GPU간에 가속화된 동기화를 수행하는 데이터 프로세서.
A CPU (central processing unit) for processing a plurality of first data;
A GPU (graphics processing unit) including a plurality of calculation units and a cache memory; And
And a shared memory shared by the CPU and the GPU for data storage,
Wherein each of the plurality of calculation units includes a plurality of threads, at least some of the plurality of calculation units operate as an activation thread group and the remainder of the plurality of calculation units operate as a deactivation thread group,
Said activation thread group converting said plurality of first data into a plurality of second data,
Allowing the inactive thread group to process dummy data input / output,
The plurality of second data converted in the activation thread group and the dummy data processed in the inactive thread group together fill the cache memory so that the plurality of second data stored in the cache memory is transferred to the shared memory And perform accelerated synchronization between the CPU and the GPU.
제 1항에 있어서,
인터페이스부; 및
메모리 컨트롤러를 더 포함하고,
상기 메모리 컨트롤러는 상기 인터페이스부로부터 수신한 상기 복수의 제 2 데이터를 상기 공유 메모리로 전송하는 데이터 프로세서.
The method according to claim 1,
An interface unit; And
Further comprising a memory controller,
And the memory controller transfers the plurality of second data received from the interface unit to the shared memory.
제 1항 또는 제 2항에 있어서,
상기 제 1 데이터는 패킷 데이터인 데이터 프로세서.
3. The method according to claim 1 or 2,
Wherein the first data is packet data.
제 1항에 있어서,
상기 복수의 쓰레드는 상기 복수의 쓰레드를 식별하는 식별자를 각각 포함하고 ,
상기 복수의 쓰레드는 상기 GPU에서 처리 가능한 쓰레드의 상태를 나타내는 상태값 을 기반으로 처리되며,
상기 식별자가 상기 상태값 보다 작은 쓰레드의 경우, 해당 쓰레드는 유효 쓰레드로서 상기 복수의 제 1 데이터를 상기 복수의 제 2 데이터로 변환하고,
상기 식별자가 상기 상태값 이상인 쓰레드의 경우, 해당 쓰레드는 아이들 쓰레드로써 제 1 메모리 장벽에 남게되는 데이터 프로세서.
The method according to claim 1,
The plurality of threads each including an identifier identifying the plurality of threads,
Wherein the plurality of threads are processed based on a state value indicating a state of a thread that can be processed by the GPU,
If the identifier is a thread smaller than the status value, the thread transforms the plurality of first data as the effective thread into the plurality of second data,
And if the identifier is a thread with a status value equal to or greater than the status value, the thread remains in the first memory barrier as an idle thread.
제 4항에 있어서,
상기 활성화 쓰레드 그룹에 포함된 상기 복수의 쓰레드 전부가 처리되어 제 2 메모리 장벽에 도달하게 되는 경우, 상기 복수의 쓰레드 중 최소의 식별자를 가진 쓰레드에 의해 상기 활성화 쓰레드 그룹이 초기화되는 데이터 프로세서.
5. The method of claim 4,
Wherein the activation thread group is initialized by a thread having a minimum identifier of the plurality of threads when all of the plurality of threads included in the activation thread group are processed and reach a second memory barrier.
제 1항에 있어서,
상기 CPU는 상기 GPU와 독점적으로 통신하는 마스터와 상기 마스터를 경유해 데이터 입출력을 수행하는 복수의 워커들을 포함하고,
상기 CPU에 포함된 상기 마스터가 정기적으로 상기 GPU의 상태를 모니터링한 결과, 상기 활성화 쓰레드 그룹에 포함된 상기 복수의 쓰레드 전부가 처리된 것으로 판단한 경우, 상기 마스터는 상기 판단 결과를 상기 복수의 워커들에 전송하는 데이터 프로세서.
The method according to claim 1,
Wherein the CPU comprises a master exclusively communicating with the GPU and a plurality of walkers performing data input / output via the master,
When the master included in the CPU periodically monitors the state of the GPU and determines that all of the plurality of threads included in the activation thread group have been processed, the master notifies the determination result to the plurality of walkers Lt; / RTI >
KR1020170065858A 2017-02-27 2017-05-29 Data processor proceeding of accelerated synchronization between central processing unit and graphics processing unit KR101908341B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20170025470 2017-02-27
KR1020170025470 2017-02-27

Publications (2)

Publication Number Publication Date
KR20180099420A KR20180099420A (en) 2018-09-05
KR101908341B1 true KR101908341B1 (en) 2018-10-17

Family

ID=63594785

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170065858A KR101908341B1 (en) 2017-02-27 2017-05-29 Data processor proceeding of accelerated synchronization between central processing unit and graphics processing unit

Country Status (1)

Country Link
KR (1) KR101908341B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102090141B1 (en) 2019-12-06 2020-03-18 한국건설기술연구원 Server system for distributed processing of image data
WO2022271541A1 (en) * 2021-06-24 2022-12-29 Advanced Micro Devices, Inc. Trusted processor for saving gpu context to system memory

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116167422A (en) * 2019-07-31 2023-05-26 华为技术有限公司 Integrated chip and method for processing sensor data
KR102646481B1 (en) * 2021-03-23 2024-03-11 서울시립대학교 산학협력단 Performance improvement method of deep learning inference
CN113821174B (en) * 2021-09-26 2024-03-22 迈普通信技术股份有限公司 Storage processing method, storage processing device, network card equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130283290A1 (en) 2009-07-24 2013-10-24 Apple Inc. Power-efficient interaction between multiple processors

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130283290A1 (en) 2009-07-24 2013-10-24 Apple Inc. Power-efficient interaction between multiple processors

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102090141B1 (en) 2019-12-06 2020-03-18 한국건설기술연구원 Server system for distributed processing of image data
WO2022271541A1 (en) * 2021-06-24 2022-12-29 Advanced Micro Devices, Inc. Trusted processor for saving gpu context to system memory

Also Published As

Publication number Publication date
KR20180099420A (en) 2018-09-05

Similar Documents

Publication Publication Date Title
KR101908341B1 (en) Data processor proceeding of accelerated synchronization between central processing unit and graphics processing unit
Go et al. {APUNet}: Revitalizing {GPU} as packet processing accelerator
Kalia et al. Raising the Bar for Using {GPUs} in Software Packet Processing
Han et al. PacketShader: a GPU-accelerated software router
KR101150928B1 (en) Network architecture and method for processing packet data using the same
Duato et al. An efficient implementation of GPU virtualization in high performance clusters
Jiang et al. Scalable high-performance parallel design for network intrusion detection systems on many-core processors
EP3493052A1 (en) Architecture and mechanisms to accelerate tuple-space search with integrated gpu
EP2192518B1 (en) System for securing multithreaded server applications
US20240127054A1 (en) Remote artificial intelligence (ai) acceleration system
Papadogiannaki et al. Efficient software packet processing on heterogeneous and asymmetric hardware architectures
Wu et al. A transport-friendly NIC for multicore/multiprocessor systems
US9390052B1 (en) Distributed caching system
US10873630B2 (en) Server architecture having dedicated compute resources for processing infrastructure-related workloads
Enberg et al. Partition-aware packet steering using XDP and eBPF for improving application-level parallelism
US20050091334A1 (en) System and method for high performance message passing
Fei et al. FlexNFV: Flexible network service chaining with dynamic scaling
Zhang et al. A holistic approach to build real-time stream processing system with GPU
Zhou et al. Optimizations for high performance network virtualization
Ren et al. irdma: Efficient use of rdma in distributed deep learning systems
Tseng et al. Exploiting integrated GPUs for network packet processing workloads
Cardellini et al. Overlapping communication with computation in MPI applications
Vaidyanathan et al. Improving communication performance and scalability of native applications on intel xeon phi coprocessor clusters
Chu et al. Dynamic kernel fusion for bulk non-contiguous data transfer on GPU clusters
Jung et al. Virtualizing GPU direct packet I/O on commodity Ethernet to accelerate GPU-NFV

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant