JP7217341B2 - How processors and registers are inherited - Google Patents
How processors and registers are inherited Download PDFInfo
- Publication number
- JP7217341B2 JP7217341B2 JP2021514866A JP2021514866A JP7217341B2 JP 7217341 B2 JP7217341 B2 JP 7217341B2 JP 2021514866 A JP2021514866 A JP 2021514866A JP 2021514866 A JP2021514866 A JP 2021514866A JP 7217341 B2 JP7217341 B2 JP 7217341B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- thread
- area
- registers
- inherited
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 claims description 16
- 230000015654 memory Effects 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 17
- 238000013467 fragmentation Methods 0.000 description 6
- 238000006062 fragmentation reaction Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/34—Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Pure & Applied Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Devices For Executing Special Programs (AREA)
Description
本開示は、プロセッサおよびレジスタの継承方法に関する。 The present disclosure relates to processors and register inheritance methods.
本出願は、2019年4月18日に日本国に出願した特願2019-079383号に基づくものであって、その優先権の利益を主張するものであり、その特許出願のすべての内容が、参照により本明細書に組み入れられる。 This application is based on Japanese Patent Application No. 2019-079383 filed in Japan on April 18, 2019, and claims the benefit of its priority. incorporated herein by reference.
従来、CPU(Central Processing Unit)の負荷が大きな処理は、応答時間およびスループットを向上させるために、複数のスレッドに分割されて並列処理されることがある。複数のスレッドに分割される負荷の大きな処理では、前のスレッドの処理が終わるたびに、演算結果をレジスタからメモリにストアする。その後、演算結果をメモリからレジスタにリロードし、後のスレッドの処理を開始する(以下、「ロード/ストア処理」という。)。 Conventionally, processing with a large CPU (Central Processing Unit) load is sometimes divided into multiple threads and processed in parallel in order to improve response time and throughput. In heavy-load processing divided into multiple threads, each time the processing of the previous thread finishes, the result of the operation is stored from the register to memory. After that, the operation result is reloaded from the memory to the register, and processing of the subsequent thread is started (hereinafter referred to as "load/store processing").
このロード/ストア処理では、PE(Processing Element)が1つずつしかメモリにアクセスできない。特に、メモリが1つのとき、ロード/ストア処理に由来するメモリへのアクセスの競合が高い頻度で発生する。そのため、スレッドの数が多い負荷の大きな処理では、ロード/ストア処理の時間が長くなる。すなわち、ロード/ストア処理はコストが高く、スレッドの数が多いほど処理速度への影響が大きくなる。 In this load/store processing, only one PE (Processing Element) can access the memory. In particular, when there is only one memory, contention for memory access due to load/store processing frequently occurs. Therefore, load/store processing takes a long time in processing with a large number of threads and a large load. That is, load/store processing is expensive, and the greater the number of threads, the greater the impact on processing speed.
このロード/ストア処理に由来するメモリへのアクセスの競合を解消するために、メモリの数を増やすことが考えられる。しかし、プロセッサの面積の増大やコストの増加を引き起こし複雑性が高くなるため、根本的な解決にはならない。例えば、特許文献1では、スカラ演算に関する上述したロード/ストア処理の問題を改善するために、プロセッサにおけるレジスタ内容の継承装置が提案されている。 In order to eliminate memory access contention resulting from this load/store processing, it is conceivable to increase the number of memories. However, it is not a fundamental solution because it causes an increase in the area and cost of the processor and increases the complexity. For example, Patent Document 1 proposes a register content inheritance device in a processor in order to improve the above-described load/store processing problems related to scalar operations.
上記した特許文献1ではスカラ演算を対象としているが、ベクトル演算では、スカラ演算とは異なり、演算に利用するレジスタの領域が一定ではなくベクトル長に応じて可変となり、単純にレジスタ番号でレジスタの領域を指定できない。そのため、スカラ演算の技術をベクトル演算には利用できない。 The above-mentioned patent document 1 targets scalar operations, but unlike scalar operations, in vector operations, the area of registers used for operations is not fixed, but variable according to the vector length. Area cannot be specified. Therefore, the technique of scalar arithmetic cannot be used for vector arithmetic.
本開示は、ベクトル演算においてもロード/ストア処理を可能な限り削減し、処理性能を改善したプロセッサおよびレジスタの継承方法を提供することを目的とする。 An object of the present disclosure is to provide a processor and a register inheritance method that reduce load/store processing as much as possible even in vector operations and improve processing performance.
本開示は上記課題を解決するために以下の技術的手段を採用する。特許請求の範囲に記載した括弧内の符号は、ひとつの態様として後述する実施形態に記載の具体的手段との対応関係を示す一例であって、本開示の技術的範囲を限定するものではない。 The present disclosure employs the following technical means to solve the above problems. The symbols in parentheses described in the claims are an example showing the corresponding relationship with the specific means described in the embodiment described later as one aspect, and do not limit the technical scope of the present disclosure. .
上記目的を達成するために、本開示にかかるプロセッサは、複数の演算器と、複数の演算器に対してスレッドを振り分けるスレッドスケジューラと、複数の演算器で共有されるレジスタファイルと、レジスタファイルに、スレッドで用いるレジスタの領域を割り当てるレジスタコントローラと、スレッドおよびレジスタを識別する情報と当該レジスタが割り当てられたレジスタの領域のアドレスとを関連付けて記憶した管理テーブルとを備え、レジスタコントローラは、前のスレッドで用いたレジスタを後のスレッドで継承させるときには、前のスレッドの処理が終了した後も、継承すべきレジスタの領域を解放せず、当該継承すべきレジスタの領域のアドレスに関連付けられた管理テーブルの情報を後のスレッドおよびレジスタを識別する情報に書き換える。 To achieve the above object, a processor according to the present disclosure includes a plurality of arithmetic units, a thread scheduler that distributes threads to the plurality of arithmetic units, a register file shared by the plurality of arithmetic units, and , a register controller that allocates a register area used by a thread, and a management table that stores information identifying a thread and a register in association with the address of the register area to which the register is allocated, wherein the register controller allocates the previous When the registers used by a thread are to be inherited by a later thread, the area of the register to be inherited is not released even after the processing of the previous thread is completed, and the management associated with the address of the register area to be inherited is maintained. Rewrite the information in the table with information that identifies the later thread and register.
この構成により、レジスタコントローラは、前のスレッドから後のスレッドに継承される継承レジスタをスレッドおよびレジスタを識別する情報を用いて管理する。ベクトル演算では、ベクトル長に応じてレジスタのサイズ(容量)が変わるため、単純にレジスタ番号でレジスタの領域を指定できないが、本開示の構成により、ベクトル長に応じてレジスタの容量が変わるときでも後のスレッドは当該レジスタを継承できる。これにより、マルチスレッドのベクトル演算においてもロード/ストア処理を可能な限り削減し、処理性能を改善できる。 With this configuration, the register controller manages the inherited registers that are inherited from the previous thread to the subsequent threads using information that identifies the threads and registers. In vector operations, the register size (capacity) varies according to the vector length, so the register area cannot be specified simply by the register number. Later threads can inherit the register. As a result, load/store processing can be reduced as much as possible even in multithreaded vector operations, and processing performance can be improved.
以下、図面を参照して本実施形態を説明する。なお、以下に説明する本実施形態は、本実施する場合の一例を示すものであって、本発明を以下に説明する具体的構成に限定するものではない。本発明の実施にあたっては、実施形態に応じた具体的構成が適宜採用されてよい。 Hereinafter, this embodiment will be described with reference to the drawings. In addition, this embodiment described below shows an example of the case of carrying out this invention, Comprising: It does not limit this invention to the concrete structure demonstrated below. In carrying out the present invention, a specific configuration according to the embodiment may be appropriately adopted.
(第1の実施形態)
[プロセッサの構成]
図1は、第1の実施形態に係るプロセッサの構成を示すブロック図である。プロセッサ100は、キャッシュ102、レジスタファイル104、演算ユニット106、レジスタコントローラ108、スレッドスケジューラ110、ローカルRAM112を有する。(First embodiment)
[Processor configuration]
FIG. 1 is a block diagram showing the configuration of a processor according to the first embodiment.
第1の実施形態のプロセッサ100は、グラフ構造のプログラムを解析、分割して得られた多量のスレッドを処理する。グラフ構造を分割して複数のスレッドを生成しているので、あるスレッドで得られた演算結果出力を後続のスレッドで入力として用いるということが起こるため、スレッド間で演算結果の引継ぎが必要となる。さらに、この引継ぎのときに、処理性能を高めるためにロード/ストア処理を削減することも必要となる。
The
そこで、プロセッサ100は、多量のスレッドに対してレジスタ資源を動的に配置しつつ、スレッド間でレジスタを継承させる。これにより、プロセッサ100は、異なる命令ストリームに対してであっても複数のスレッドをPE114に割り当て並列実行し、さらに処理性能を高めることもできる。
Therefore, the
キャッシュ102は、ホストCPUと演算ユニット106との間に置かれるキャッシュである。キャッシュ102は、システムバスインターフェイスまたはROMインターフェイスと通信してもよい。
レジスタファイル104は、演算データを格納するレジスタファイルである(以下、スレッドに割り当てられる各レジスタを「レジスタ」、スレッドに割り当てられる複数のレジスタを「レジスタの領域」という。)。
The
このレジスタファイル104を、図2を用いて具体的に説明する。図2では特にベクトル演算におけるレジスタにフォーカスし説明する。図2Aは、第1の実施形態に係るスレッドにレジスタを割り当てる前のレジスタファイル104の概念図であり、図2Bは、第1の実施形態に係る第1のスレッドt1、第2のスレッドt2、第3のスレッドt3にレジスタを割り当てた後のレジスタファイル104の概念図であり、図2Cは、第1の実施形態に係る第1のスレッドt1にレジスタを割り当てた後のレジスタのサイズの概念図であり、図2Dは、第1の実施形態に係る第2のスレッドt2にレジスタを割り当てた後のレジスタのサイズの概念図である。
This
図2Aに示すように、スレッドにレジスタの領域を割り当てる前のレジスタファイル104は、第1のスレッドt1、第2のスレッドt2、第3のスレッドt3のいずれにも、レジスタの領域が割り当てられていない。
As shown in FIG. 2A, in the
一方、図2Bに示すように、スレッドにレジスタの領域を割り当てた後のレジスタファイル104は、第1のスレッドt1、第2のスレッドt2、第3のスレッドt3それぞれに、連続したレジスタの領域が割り当てられている。
On the other hand, as shown in FIG. 2B, the
1つの要素に対して順次演算をするスカラ演算とは異なり、ベクトル演算は複数個のデータを1つのレジスタとして1つの演算を全データに同時に実行する。データの要素数は、ベクトル長という。ベクトル演算に利用するレジスタのサイズは、このベクトル長に依存する。そのため、レジスタのサイズは、スレッドに割り当てるレジスタの最大サイズにより決まる。 Unlike scalar operations that sequentially operate on one element, vector operations simultaneously perform one operation on all data using a plurality of data as one register. The number of data elements is called vector length. The size of registers used for vector operations depends on this vector length. Therefore, the size of the registers is determined by the maximum size of the registers allocated to the threads.
例えば、第1のスレッドt1は、第2のスレッドt2よりも、ベクトル長が大きい。そのため、図2Cに示すように、第1のスレッドt1に割り当てるレジスタv0~v31のサイズは、図2Dに示すように、第2のスレッドt2に割り当てるレジスタv0~v31のサイズよりも大きい。 For example, the first thread t1 has a larger vector length than the second thread t2. Therefore, as shown in FIG. 2C, the size of the registers v0 to v31 allocated to the first thread t1 is larger than the size of the registers v0 to v31 allocated to the second thread t2, as shown in FIG. 2D.
図1に戻って説明を続ける。演算ユニット106は、スレッドの処理を実行する実行部である。演算ユニット106は、複数のPE114を有する。PE114は、演算器である。複数のPE114のうちの少なくとも1つは、ベクトル演算するベクトル演算器である。
Returning to FIG. 1, the description continues. The
レジスタコントローラ108は、スレッドにレジスタの領域を割り当てるレジスタのコントローラである。管理テーブル116は、スレッドの処理に用いられるレジスタを管理するテーブルである。上述したPE114は、管理テーブル116を参照して、レジスタを確保し、また、レジスタにアクセスする。
The
管理テーブル116は、スレッドおよびレジスタを識別する情報と当該レジスタが割り当てられたレジスタの領域のアドレスとを関連付けて記憶している。具体的には、管理テーブル116は、キーとレジスタのアドレスとを紐づけている。キーは、スレッドID(識別子)とレジスタ番号とを有する。すなわち、管理テーブル116は、スレッドIDで識別されるスレッドの処理に用いられるレジスタの値が、レジスタファイルのどこに記憶されているかを管理するテーブルである。 The management table 116 associates and stores information identifying a thread and a register with the address of the register area to which the register is allocated. Specifically, the management table 116 associates keys with register addresses. A key has a thread ID (identifier) and a register number. That is, the management table 116 is a table for managing where in the register file the values of the registers used for the processing of the thread identified by the thread ID are stored.
図3Aは、第1の実施形態に係るプロセッサ100で用いられる管理テーブル116の例を示す図である。図3Aに示すように、スレッド0のレジスタ番号v0のレジスタは、アドレス0xaaaa1234で始まる領域が割り当てられ(行202)、レジスタ番号v1のレジスタは、アドレス0xbbbb1234で始まる領域が割り当てられ(行204)、レジスタ番号v2のレジスタは、アドレス0xcccc1234で始まる領域が割り当てられている(行206)。
FIG. 3A is a diagram showing an example of the management table 116 used by the
レジスタコントローラ108は、例えば、スレッドの処理が終了した後に、レジスタを解放する。具体的には、レジスタコントローラ108は、スレッドの処理を終了するときに、そのスレッドで確保していた領域に対し、使用可能であることを示すフラグを立てることで領域を解放する。
The
また、第1の実施形態では、レジスタコントローラ108は、スレッドの処理が終了した後も、レジスタの領域を解放せず、当該スレッドで用いたレジスタを後のスレッドに継承できる。具体的には、レジスタコントローラ108は、承継すべきレジスタを解放しないように、使用不可のフラグを立てる。それと共に、レジスタコントローラ108は、継承すべきレジスタの領域のアドレスに関連付けられた管理テーブル116の情報を後のスレッドIDおよびレジスタ番号に書き換える。これにより、レジスタ番号とレジスタのアドレスとが紐づけられ、レジスタのサイズが可変でも、レジスタの継承を行える。
Further, in the first embodiment, the
この管理テーブル116の書き換えを、図3Bを用いて具体的に説明する。図3Bは、第1の実施形態に係る前のスレッドから後のスレッドにレジスタ番号v0の値を継承したときの管理テーブル116の例を示す図である。 Rewriting of the management table 116 will be specifically described with reference to FIG. 3B. FIG. 3B is a diagram showing an example of the management table 116 when inheriting the value of the register number v0 from the previous thread to the subsequent thread according to the first embodiment.
図3Bに示すように、前のスレッド0のレジスタ番号v0を後のスレッド1に継承するので、前のスレッド0のレジスタ番号v0に使用不可のフラグを立て、レジスタの領域を解放しないで保持する。管理テーブル116のキーは、「スレッド0_v0」から「スレッド1_v0」(行302)に変更される。これにより、スレッド1を処理するPE114は、スレッド1のレジスタ番号v0として、アドレス0xaaaa1234を参照する。そうすると、この領域は使用不可として保持されているので、この領域から前のスレッド0で使っていたレジスタ番号v0のレジスタの値を読み出せる。
As shown in FIG. 3B, since the register number v0 of the
このように、ベクトル演算でも、アドレス0xaaaa1234のレジスタv0に格納された前のスレッドの演算結果は、メモリに退避されることなく、後のスレッドに継承される。なお、後のスレッド1の処理が開始された後は、レジスタv0の値を書き換えてよいことは言うまでもない。 In this way, even in the vector operation, the operation result of the previous thread stored in register v0 at address 0xaaaa1234 is inherited by the subsequent thread without being saved in memory. It goes without saying that the value of the register v0 may be rewritten after the processing of the subsequent thread 1 is started.
一方、図3Aのレジスタ番号v1、v2については、後のスレッド1に継承しないので、割り当てられていた領域を解放する。具体的には、それらの領域を使用可能であることを示すフラグを立てる。 On the other hand, since the register numbers v1 and v2 in FIG. 3A are not inherited by the subsequent thread 1, the allocated areas are released. Specifically, flags are set to indicate that these areas are usable.
図3Bに示すように、スレッド1のレジスタ番号v1、レジスタ番号v2については、スレッド0からの継承はないので、新たな領域が割り当てられる。後のスレッド1のレジスタ番号v1にはアドレス0xbbbb5678の領域が割り当てられ(行304)、レジスタ番号v2にはアドレス0xcccc5678が割り当てられている(行306)。
As shown in FIG. 3B, register number v1 and register number v2 of thread 1 are not inherited from
図1に戻って説明を続ける。スレッドスケジューラ110は、PE114にスレッドを割り振るスケジューラである。具体的には、スレッドスケジューラ110は、PE114にスレッドを渡す。PE114は、レジスタコントローラ108が有する管理テーブル116を参照して、このスレッドを処理するレジスタを確保し、スレッドを処理する。
Returning to FIG. 1, the description continues. The
また、スレッドスケジューラ110は、レジスタの継承があるときは、レジスタコントローラ108に対して、前のスレッドに後続する後のスレッドと後のスレッドに継承されるレジスタ番号との対応関係を指定する。指定を受けたレジスタコントローラ108は、後のスレッドが前のスレッドで用いられたレジスタを継承するように管理テーブル116を書き換える。
Further, when there is register inheritance, the
ローカルRAM112は、読み書き用の揮発性メモリである。演算ユニット106の演算結果を記憶し、システムバスインターフェイスと通信を行う。また、後述するレジスタファイル104から退避された全データを記憶する場合にも使用される。
The
[プロセッサの動作]
以下では、上述したプロセッサ100の動作を示すフローを説明する。図4は、第1の実施形態に係るプロセッサ100が、スレッドの処理終了時に、レジスタの処理を行うフロー図である。PE114が前のスレッドを処理すると、フローが開始する。[Processor operation]
Below, the flow which shows operation|movement of the
まず、スレッドスケジューラ110が、レジスタコントローラ108に対して後のスレッドを指定し、レジスタコントローラ108が、後のスレッドに継承されるレジスタがあるか否かを判定する(ステップS102)。
First, the
レジスタコントローラ108が、後のスレッドに継承されるレジスタがあると判定すると(ステップS102:Yes)、継承されるレジスタに使用不可のフラグを立てる(ステップS104)。
When the
その後、レジスタコントローラ108が、管理テーブル116のキーを前のスレッドのキーから後のスレッドのキーに書き換え(ステップS106)、継承されるレジスタ以外のレジスタに使用可能のフラグを立て(ステップS108)、フローが終了する。
After that, the
一方、スレッドスケジューラ110が、レジスタコントローラ108に対して後のスレッドを指定せず、レジスタコントローラ108が、後のスレッドに継承されるレジスタがないと判定すると(ステップS102:No)、処理終了に係るスレッドが用いていたレジスタに使用可能のフラグを立て(ステップS110)、フローが終了する。
On the other hand, when the
図5は、第1の実施形態のプロセッサ100が、スレッドの処理開始時に、レジスタの割り当て処理を行うフロー図である。スレッドスケジューラ110が、PE114に対して後のスレッドを割り当てると、フローが開始する。
FIG. 5 is a flowchart of register allocation processing performed by the
まず、レジスタコントローラ108が、管理テーブル116において、使用可能フラグが立っているレジスタの領域にレジスタを割り当てる(ステップS202)。なお、前のスレッドから継承されるレジスタについては、ここで割り当てを行う必要はない。レジスタコントローラ108は、管理テーブル116のキーとアドレスを、後のスレッドのキーと後のスレッドを処理するレジスタのアドレスとに書き換える。
First, the
その後、PE114が、管理テーブル116を参照し、後のスレッドを処理し(ステップS204)、フローが終了する。
After that, the
このようにして、プロセッサ100は、レジスタ継承を利用することにより、前のスレッドを処理して得られた値を後のスレッドに継承できる。これにより、対象データに対してロード/ストア処理を削除し、プロセッサ100の処理性能を改善できる。
In this way,
また、プロセッサ100は、レジスタ番号に加えてレジスタのアドレスを用いて、継承させるレジスタを管理する。これにより、ベクトル長に応じてレジスタの容量が変わるベクトル演算においても、レジスタ継承を利用できる。
Also, the
(第2の実施形態)
[プロセッサの構成]
次に、第2の実施形態に係るプロセッサ100について説明する。第2の実施形態に係るプロセッサ100の基本的な構成は第1の実施形態のプロセッサ100と同じであるが(図1参照)、第2の実施形態のプロセッサ100は、第1の実施形態のプロセッサ100とは異なり、レジスタファイル104にフラグメンテーション(断片化)が発生したときに、連続したレジスタの領域を割り当てる処理を行う。(Second embodiment)
[Processor configuration]
Next, the
具体的には、レジスタコントローラ108は、例えば、レジスタファイル104において、レジスタファイル104に連続するレジスタの領域を確保できるか否かを判定する。レジスタコントローラ108は、フラグメンテーションにより、レジスタファイル104に連続するレジスタの領域を確保できないと判定したときは、レジスタファイル104に格納されたレジスタのデータをいったんローカルRAM112に退避する。
Specifically, the
そして、ローカルRAM112に退避させたデータをレジスタファイル104にリロードしてレジスタに連続した領域を割り当てることによりフラグメンテーションを解消すると共に、管理テーブル116の継承すべきレジスタのアドレスを更新する。
Then, by reloading the data saved in the
このレジスタの退避およびリロードを、図6を用いて具体的に説明する。図6は、レジスタの退避およびリロードを説明するための図である。図6に示すように、レジスタファイル104の面積はレジスタファイル104の容量を表す。レジスタコントローラ108が、レジスタファイル104にスレッドを処理するレジスタの領域を確保する。レジスタコントローラ108が、例えば、スレッドt1とスレッドt2とを演算するレジスタの領域を確保する。
Saving and reloading of this register will be specifically described with reference to FIG. FIG. 6 is a diagram for explaining saving and reloading of registers. As shown in FIG. 6, the area of
レジスタファイル104には、スレッドt3に必要なレジスタを確保するだけの空き領域がある。しかし、レジスタの空き領域は、フラグメンテーションが生じる。そのため、スレッドt3を処理できる連続したレジスタの空き領域を確保できないことがある。
特に、レジスタ継承を繰り返し行うと、レジスタの領域が部分的にしか解放されない。そのため、レジスタの領域のフラグメンテーションが発生しやすい。そうすると、レジスタコントローラ108が、スレッドを処理できる連続したレジスタの領域を確保することが難しくなる。
In particular, repeated register inheritance frees up space for registers only partially. Therefore, fragmentation of the register area is likely to occur. This makes it difficult for the
このようにスレッドに必要なレジスタのために連続した領域を確保できないときに、レジスタコントローラ108は、レジスタファイル104に格納されている全データをローカルRAM112に退避する。
When a continuous area cannot be secured for the registers required for the thread, the
レジスタコントローラ108は、ローカルRAM112から全データをリロードし、スレッド毎にレジスタの領域を確保しなおす。このとき、レジスタコントローラ108が、可能な限りレジスタの領域の空きがないように、スレッドt1とスレッドt2とを処理するレジスタの領域を確保する。これにより、後のスレッドt3の処理に必要なレジスタとして、連続したレジスタの領域が確保される。
The
レジスタコントローラ108は、ローカルRAM112から全データをリロードする際に、スレッドおよびレジスタと、レジスタ領域のアドレスの対応関係を管理テーブル116に書き込む。これにより、レジスタの再割当が行われレジスタのアドレスが変更されたときでも、スレッドは、管理テーブル116が有するキーに基づいて、レジスタにアクセスできるため処理に影響はない。なお、そもそもレジスタファイル104の空き容量が不足しているときは、処理中のスレッドが完了し対象レジスタ領域が解放され、次のスレッドに必要な空き容量が確保可能な時点で上述したレジスタの再割当の処理が実行される。
When reloading all the data from the
[プロセッサの動作]
第2の実施形態に係るプロセッサ100の動作は、第2のフローのみ上述した第1の実施形態に係る第2のフローとは相違する。以下では、この相違点のみ説明する。[Processor operation]
The operation of the
図7は、第2の実施形態に係るプロセッサ100が、スレッドの処理開始時に、レジスタの割り当て処理を行うフロー図である。第2の実施形態に係るフローは、第1の実施形態に係るフローとは異なり、連続したレジスタ領域を確保できないときに、レジスタファイル104から全データをローカルRAM112に退避し、改めて全データをレジスタファイル104にリロードするステップを含む。スレッドスケジューラ110が、PE114に対して後のスレッドを割り当てると、フローが開始する。
FIG. 7 is a flowchart of register allocation processing performed by the
まず、レジスタコントローラ108が、後のスレッドを処理するための連続したレジスタの領域を確保できるか否かを判定する(ステップS302)。
First, the
レジスタコントローラ108が、後のスレッドを処理するための連続したレジスタの領域を確保できると判定すると(ステップS302:Yes)、PE114が、使用可能フラグが立っているレジスタの領域にレジスタを割り当てる(ステップS304)。
When the
その後、レジスタコントローラ108が、管理テーブル116のキーとアドレスとを、後のスレッドのキーと後のスレッドを処理するレジスタのアドレスとに更新し(ステップS310)する。
After that, the
一方、レジスタコントローラ108が、後のスレッドを処理するための連続したレジスタの領域を確保できないと判定すると(ステップS302:No)、全データをレジスタファイル104からローカルRAM112に退避し(ステップS306)、改めて全データをローカルRAM112からレジスタファイルにリロードし(ステップS308)、スレッド毎に連続したレジスタの領域を確保しなおす。
On the other hand, when the
その後、レジスタコントローラ108が、管理テーブル116のキーとアドレスとを、後のスレッドのキーと後のスレッドを処理するレジスタのアドレスとに更新する(ステップS310)。
After that, the
レジスタコントローラ108によってレジスタ領域にレジスタが確保され、管理テーブル116にレジスタとそのアドレスの情報が記憶された後に、PE114は、後のスレッドを処理し(ステップS312)、フローが終了する。
After the registers are secured in the register area by the
このように、第2の実施形態に係る第2のフローでは、第1の実施形態に係る第2のフローとは異なり、連続したレジスタ領域を確保できないときに、レジスタファイル104から全データをローカルRAM112に退避し、改めて全データをレジスタファイル104にリロードするステップを有する。これにより、レジスタコントローラ108は、レジスタ継承を利用することで発生しやすくなったレジスタの領域のフラグメンテーションを解消し、ベクトル演算の演算効率を高く保持することができる。
As described above, in the second flow according to the second embodiment, unlike the second flow according to the first embodiment, all data is transferred from the
Claims (6)
前記複数の演算器に対してスレッドを振り分けるスレッドスケジューラ(110)と、
前記複数の演算器で共有されるレジスタファイル(104)と、
前記レジスタファイルに、前記スレッドで用いるレジスタの領域を割り当てるレジスタコントローラ(108)と、
前記スレッドおよび前記レジスタを識別する情報と当該レジスタが割り当てられたレジスタの領域のアドレスとを関連付けて記憶した管理テーブル(116)と、
を備え、
前記レジスタコントローラは、前のスレッドで用いたレジスタを後のスレッドに継承させるときには、前記前のスレッドの処理が終了した後も、継承すべきレジスタの領域を解放せず、当該継承すべきレジスタの領域のアドレスに関連付けられた前記管理テーブルの情報を前記後のスレッドおよびレジスタを識別する情報に書き換えるプロセッサ(100)。a plurality of calculators (114);
a thread scheduler (110) that distributes threads to the plurality of computing units;
a register file (104) shared by the plurality of computing units;
a register controller (108) allocating a register area used by the thread to the register file;
a management table (116) storing information identifying the thread and the register in association with the address of the register area to which the register is allocated;
with
When the register used in the previous thread is to be inherited by the subsequent thread, the register controller does not release the area of the register to be inherited even after the process of the previous thread is completed. A processor (100) that rewrites the information in the management table associated with the address of the area to the information that identifies the subsequent thread and register.
前記複数の演算器は、ベクトルレジスタも同様に処理可能な演算器を含む請求項1に記載のプロセッサ。The register file processes not only single data but also vector registers capable of collectively handling a plurality of data,
2. The processor according to claim 1, wherein said plurality of calculators include calculators capable of processing vector registers as well.
前記複数の演算器に対してスレッドを振り分けるスレッドスケジューラ(110)と、
前記複数の演算器で共有されるレジスタファイル(104)と、
前記レジスタファイルに、前記スレッドで用いるレジスタの領域を割り当てるレジスタコントローラ(108)と、
前記スレッドおよび前記レジスタを識別する情報と当該レジスタが割り当てられたレジスタの領域のアドレスとを関連付けて記憶した管理テーブル(116)と、
を備えるプロセッサ(100)において、
前記レジスタコントローラは、前記スレッドの処理が終了した後も、後のスレッドに継承すべきレジスタの領域を解放せず、当該継承すべきレジスタの領域のアドレスに関連付けられた前記管理テーブルの情報を前記後のスレッドおよびレジスタを識別する情報に書き換えるレジスタの継承方法。
a plurality of calculators (114);
a thread scheduler (110) that distributes threads to the plurality of computing units;
a register file (104) shared by the plurality of computing units;
a register controller (108) allocating a register area used by the thread to the register file;
a management table (116) storing information identifying the thread and the register in association with the address of the register area to which the register is allocated;
In a processor (100) comprising:
The register controller does not release the register area to be inherited by the subsequent thread even after the processing of the thread is completed, and stores the information in the management table associated with the address of the register area to be inherited. A register inheritance method that rewrites information that identifies later threads and registers.
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019079383 | 2019-04-18 | ||
JP2019079383 | 2019-04-18 | ||
PCT/JP2020/014996 WO2020213397A1 (en) | 2019-04-18 | 2020-04-01 | Processor and register inheritance method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2020213397A1 JPWO2020213397A1 (en) | 2020-10-22 |
JP7217341B2 true JP7217341B2 (en) | 2023-02-02 |
Family
ID=72837159
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021514866A Active JP7217341B2 (en) | 2019-04-18 | 2020-04-01 | How processors and registers are inherited |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP7217341B2 (en) |
WO (1) | WO2020213397A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113626205B (en) * | 2021-09-03 | 2023-05-12 | 海光信息技术股份有限公司 | Processor, physical register management method and electronic device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100161948A1 (en) | 2006-11-14 | 2010-06-24 | Abdallah Mohammad A | Apparatus and Method for Processing Complex Instruction Formats in a Multi-Threaded Architecture Supporting Various Context Switch Modes and Virtualization Schemes |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2970553B2 (en) * | 1996-08-30 | 1999-11-02 | 日本電気株式会社 | Multi-thread execution method |
-
2020
- 2020-04-01 JP JP2021514866A patent/JP7217341B2/en active Active
- 2020-04-01 WO PCT/JP2020/014996 patent/WO2020213397A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100161948A1 (en) | 2006-11-14 | 2010-06-24 | Abdallah Mohammad A | Apparatus and Method for Processing Complex Instruction Formats in a Multi-Threaded Architecture Supporting Various Context Switch Modes and Virtualization Schemes |
Also Published As
Publication number | Publication date |
---|---|
WO2020213397A1 (en) | 2020-10-22 |
JPWO2020213397A1 (en) | 2020-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5784698A (en) | Dynamic memory allocation that enalbes efficient use of buffer pool memory segments | |
US11550627B2 (en) | Hardware accelerated dynamic work creation on a graphics processing unit | |
US9804666B2 (en) | Warp clustering | |
US8166482B2 (en) | Scheduling method, scheduling apparatus and multiprocessor system | |
US9529632B2 (en) | Interlocked increment memory allocation and access | |
US20230196502A1 (en) | Dynamic kernel memory space allocation | |
US8375390B2 (en) | Scheduling method and scheduling apparatus | |
JP2013506179A (en) | Execution management system combining instruction threads and management method | |
US8966494B2 (en) | Apparatus and method for processing threads requiring resources | |
JP2009528610A (en) | Method and apparatus for dynamically resizing cache partition based on task execution phase | |
KR20110075297A (en) | Apparatus and method for parallel processing in consideration of degree of parallelism | |
US8806168B2 (en) | Producer-consumer data transfer using piecewise circular queue | |
US20170344398A1 (en) | Accelerator control device, accelerator control method, and program storage medium | |
KR20110075296A (en) | Job allocation method on multi-core system and apparatus thereof | |
US7971041B2 (en) | Method and system for register management | |
KR20070090649A (en) | Apparatus and method for providing cooperative scheduling on multi-core system | |
JP7217341B2 (en) | How processors and registers are inherited | |
JP2024500779A (en) | Address mapping aware task processing mechanism | |
JP2005209206A (en) | Data transfer method for multiprocessor system, multiprocessor system, and processor for executing the method | |
US20090187911A1 (en) | Computer device with reserved memory for priority applications | |
US20020029800A1 (en) | Multiple block sequential memory management | |
US20100299672A1 (en) | Memory management device, computer system, and memory management method | |
WO2021253875A1 (en) | Memory management method and related product | |
JP3991443B2 (en) | Task switching method and data processing apparatus | |
JP2005327007A (en) | Integrated computer control program, recording medium for recording its program and integrated system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211008 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220113 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20221227 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230123 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7217341 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313115 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |