JP2007200288A - System and method for grouping execution threads - Google Patents
System and method for grouping execution threads Download PDFInfo
- Publication number
- JP2007200288A JP2007200288A JP2006338917A JP2006338917A JP2007200288A JP 2007200288 A JP2007200288 A JP 2007200288A JP 2006338917 A JP2006338917 A JP 2006338917A JP 2006338917 A JP2006338917 A JP 2006338917A JP 2007200288 A JP2007200288 A JP 2007200288A
- Authority
- JP
- Japan
- Prior art keywords
- thread
- instruction
- execution
- instructions
- buddy
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
- G06F9/3009—Thread control instructions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3851—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- G06F9/3885—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
- G06F9/3888—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled by a single instruction for multiple threads [SIMT] in parallel
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
- Multi Processors (AREA)
Abstract
Description
[0001]本発明の実施の形態は、広くマルチスレッド処理に係り、より詳細には、改良されたハードウェアの利用を達成するために実行スレッドをグループ化するシステム及び方法に係る。 [0001] Embodiments of the present invention relate generally to multi-threaded processing, and more particularly to systems and methods for grouping execution threads to achieve improved hardware utilization.
[0002]一般に、コンピュータの命令は、実行のために複数のクロックサイクルを必要とする。このために、マルチスレッドプロセッサは、命令の並列スレッドを連続的に実行して、命令を実行するためのハードウェアをできるだけビジー状態に保持することを可能にする。例えば、以下に示す特性を有する命令のスレッドを実行する場合には、マルチスレッドプロセッサは、四つの並列のスレッドを連続的にスケジュールすることができる。このようにスレッドをスケジュールすることによって、マルチスレッドプロセッサは、四つのスレッドの実行を、23個のクロックサイクルの後に完了することができる。ここで、第1スレッドは、クロックサイクル1−20の間に実行され、第2スレッドは、クロックサイクル2−21の間に実行され、第3スレッドは、クロックサイクル3−22の間に実行され、更に、第4スレッドは、クロックサイクル4−23の間に実行される。これに比して、プロセッサが、プロセス中のスレッドが実行を完了するまでスレッドをスケジュールしない場合には、四つのスレッドの実行を完了するのに80個のクロックサイクルを行うことになる。ここでは、第1スレッドがクロックサイクル1−20の間に実行され、第2スレッドがクロックサイクル21−40の間に実行され、第3スレッドがクロックサイクル41−60の間に実行され、第4スレッドがクロックサイクル61−80の間に実行される。
命令 待ち時間 必要なリソース
1 4クロックサイクル 3個のレジスタ
2 4クロックサイクル 4個のレジスタ
3 4クロックサイクル 3個のレジスタ
4 4クロックサイクル 5個のレジスタ
5 4クロックサイクル 3個のレジスタ
[0002] Generally, computer instructions require multiple clock cycles to execute. To this end, a multi-thread processor allows a parallel thread of instructions to run continuously, keeping the hardware for executing the instructions as busy as possible. For example, when executing a thread of instructions having the following characteristics, a multi-thread processor can schedule four parallel threads sequentially. By scheduling threads in this way, a multi-thread processor can complete the execution of four threads after 23 clock cycles. Here, the first thread is executed during clock cycle 1-20, the second thread is executed during clock cycle 2-21, and the third thread is executed during clock cycle 3-22. In addition, the fourth thread is executed during clock cycles 4-23. In contrast, if the processor does not schedule a thread until a thread in the process has completed execution, it will take 80 clock cycles to complete the execution of the four threads. Here, the first thread is executed during clock cycles 1-20, the second thread is executed during clock cycles 21-40, the third thread is executed during clock cycles 41-60, and the fourth The thread is executed during clock cycles 61-80.
Instruction wait time required
[0003]しかしながら、上述した並列処理は、多量のハードウェアリソース、例えば、多数のレジスタを必要とする。上述した例では、並列処理に要するレジスタの数が、非並列処理の場合の5に比して、20となる。 [0003] However, the parallel processing described above requires a large amount of hardware resources, eg, a large number of registers. In the example described above, the number of registers required for parallel processing is 20 compared to 5 for non-parallel processing.
[0004]多くの場合には、実行の待ち時間(latency)が均一でない。例えば、グラフィック処理のケースでは、命令のスレッドが、通常、10クロックサイクル未満の待ち時間をしばしば有する数学(math)オペレーションと、100クロックサイクル以上の待ち時間を有するメモリアクセスオペレーションとを含む。このようなケースでは、並列スレッドの実行を連続的にスケジュールしても、あまりうまく機能しない。連続的に実行される並列スレッドの数が少な過ぎる場合には、メモリアクセスオペレーションの待ち時間が長くなる結果として、実行ハードウェアの多くが過少利用となる。他方、連続的に実行される並列スレッドの数が、メモリアクセスオペレーションの長い待ち時間をカバーするに充分なほど多くされた場合には、実行中のスレッド(live thread)をサポートするに要するレジスタの数が著しく増加する。 [0004] In many cases, the latency of execution is not uniform. For example, in the case of graphics processing, instruction threads typically include math operations that often have a latency of less than 10 clock cycles and memory access operations that have a latency of 100 clock cycles or more. In such cases, continuously scheduling the execution of parallel threads will not work very well. If too few parallel threads are executed continuously, much of the execution hardware will be underutilized as a result of the increased latency of memory access operations. On the other hand, if the number of parallel threads running continuously is large enough to cover the long latency of memory access operations, the number of registers required to support a live thread The number increases significantly.
[0005]本発明は、実行ハードウェアがより効率的に利用されるように実行スレッドをグループ化する方法を提供する。また、本発明は、実行ハードウェアがより効率的に利用されるように実行スレッドをグループ化するよう構成されたメモリユニットを備えるコンピュータシステムも提供する。 [0005] The present invention provides a method for grouping execution threads so that execution hardware is utilized more efficiently. The present invention also provides a computer system comprising a memory unit configured to group execution threads so that execution hardware is utilized more efficiently.
[0006]本発明の一実施の形態によれば、複数のスレッドが、二つ以上のスレッドのバディー(buddy:仲間)グループに分割され、各スレッドには一以上のバディースレッドが割り当てられる。各バディーグループの一つのスレッドだけが命令をアクティブに実行する。アクティブなスレッドが、スワップ命令のようなスワップイベントに遭遇すると、アクティブなスレッドは、実行を保留し、そのバディースレッドのうちの一つが実行を開始する。 [0006] According to one embodiment of the present invention, a plurality of threads are divided into buddy groups of two or more threads, and each thread is assigned one or more buddy threads. Only one thread in each buddy group actively executes instructions. When an active thread encounters a swap event, such as a swap instruction, the active thread suspends execution and one of its buddy threads begins executing.
[0007]スワップ命令は、通常、待ち時間の長い命令の後に現われ、現在アクティブなスレッドを、アクティブな実行リストにおけるそのバディースレッドのうちの一つとスワップさせる。バディースレッドの実行は、当該バディースレッドがスワップ命令に遭遇するまで続き、この遭遇がバディースレッドをアクティブな実行リストにおけるそのバディースレッドのうちの一つとスワップさせる。グループに二つのバディースレッドしかない場合には、そのバディースレッドがアクティブな実行リストにおけるオリジナルスレッドとスワップされ、オリジナルスレッドの実行が再開する。グループにバディースレッドが三つ以上ある場合には、そのバディースレッドは、ある所定の順序に基づきグループにける次のバディースレッドとスワップされる。 [0007] A swap instruction usually appears after a long latency instruction and causes the currently active thread to swap with one of its buddy threads in the active execution list. Execution of a buddy thread continues until the buddy thread encounters a swap instruction, which causes the buddy thread to swap with one of its buddy threads in the active execution list. If there are only two buddy threads in the group, that buddy thread is swapped with the original thread in the active execution list and execution of the original thread resumes. If there are more than two buddy threads in the group, the buddy threads are swapped with the next buddy thread in the group based on some predetermined order.
[0008]レジスタファイルの使用を節約するために、各バディースレッドは、そのレジスタ割り当てを、プライベート及び共有の二つのグループに分割している。プライベートグループに属するレジスタだけがスワップが生じた場合でも値を保持する。共有レジスタは、常に、バディーグループの現在のアクティブなスレッドにより所有される。 [0008] To conserve register file usage, each buddy thread divides its register assignments into two groups, private and shared. Only the registers belonging to the private group retain their values even when swapping occurs. Shared registers are always owned by the current active thread of the buddy group.
[0009]バディーグループは、プログラムが実行のためにロードされるときにスレッドが設定されるテーブルを使用して編成される。このテーブルは、オンチップレジスタに維持されてもよい。このテーブルは、複数の行を有し、各バディーグループ内のスレッドの数に基づいて構成される。例えば、各バディーグループに二つのスレッドがある場合には、テーブルが二つの列で構成される。各バディーグループに三つのスレッドがある場合には、テーブルが三つの列で構成される。 [0009] Buddy groups are organized using tables in which threads are set when a program is loaded for execution. This table may be maintained in on-chip registers. This table has a plurality of rows and is configured based on the number of threads in each buddy group. For example, if there are two threads in each buddy group, the table consists of two columns. If each buddy group has three threads, the table consists of three columns.
[0010]コンピュータシステムは、本発明の一実施の形態によれば、上述したテーブルをメモリに記憶し、更に、第1及び第2の実行パイプラインを用いて構成された処理ユニットを備えている。第1の実行パイプラインは数学オペレーションを実行するために使用され、第2の実行パイプラインはメモリオペレーションを実行するために使用される。 [0010] According to an embodiment of the present invention, a computer system stores the above-described table in a memory, and further includes a processing unit configured using first and second execution pipelines. . The first execution pipeline is used to perform mathematical operations and the second execution pipeline is used to perform memory operations.
[0011]本発明の上述の特徴を詳細に理解できるように、上に要約した本発明を、実施の形態を参照して詳細に説明する。実施の形態のうち幾つかについては、添付図面に示す。添付図面は、本発明の典型的な実施形態を示すに過ぎず、それ故、本発明の範囲を限定するものではない。これは、本発明が、他の同様に有効な実施の形態にも通じるものであるからである。 [0011] In order that the foregoing features of the invention may be understood in detail, the invention summarized above will be described in detail with reference to embodiments. Some of the embodiments are shown in the accompanying drawings. The accompanying drawings only illustrate exemplary embodiments of the invention and therefore do not limit the scope of the invention. This is because the present invention leads to other equally effective embodiments.
[0019]図1は、本発明を実施し得る複数の処理ユニットを有するグラフィック処理ユニット(GPU)120を実装したコンピュータシステム100の簡単なブロック図である。GPU120は、複数の処理ユニット124−1、124−2、・・・124−Nに結合されたインタフェイスユニット122を備えている。ここで、Nは、1より大きな整数である。処理ユニット124は、メモリコントローラ126を介してローカルグラフィックメモリ130へアクセスすることができる。GPU120及びローカルグラフィックメモリ130は、システムメモリ112に記憶されたドライバを使用してコンピュータシステム100の中央処理ユニット(CPU)110によりアクセスされるグラフィックサブシステムである。
[0019] FIG. 1 is a simplified block diagram of a
[0020]図2は、処理ユニット124の一つを更に詳細に示す。図2に示す処理ユニットは、本明細書では参照符号200によって参照されており、図1に示す処理ユニット124のうち任意の一つを表わしている。処理ユニット200は、処理ユニット200によって実行されるべき命令を発行するための命令ディスパッチユニット212と、命令の実行に使用されるオペランドを記憶するレジスタファイル214と、一対の実行パイプライン222及び224と、を備えている。第1の実行パイプライン222は、数学オペレーションを実行するように構成されており、第2の実行パイプライン224は、メモリアクセスオペレーションを実行するように構成されている。一般的に、第2の実行パイプライン224で実行される命令の待ち時間は、第1の実行パイプライン222で実行される命令の待ち時間よりかなり長い。命令ディスパッチユニット212が命令を発行するときには、命令ディスパッチユニット212は、二つの実行パイプライン222及び224の一方にパイプラインコンフィギュレーション信号を送信する。命令が数学形式である場合には、パイプラインコンフィギュレーション信号は、第1の実行パイプライン222へ送信される。命令がメモリアクセス形式である場合には、パイプラインコンフィギュレーション信号は、第2の実行パイプライン224へ送信される。二つの実行パイプライン222及び224の実行結果は、レジスタファイル214へ書き戻される。
[0020] FIG. 2 shows one of the
[0021]図3は、命令ディスパッチユニット212の機能ブロック図である。命令ディスパッチユニット212は、複数のスロットを有する命令バッファ310を備えている。この実施の形態におけるスロットの数は、12であり、各スロットは、2個までの命令を保持することができる。スロットのうち何れか一つが別の命令のためのスペースを有する場合には、フェッチ312が、スレッドプール305から命令キャッシュ314へなされる。スレッドプール305には、プログラムが実行のためにロードされるときに、スレッドが設定される。命令キャッシュ314に記憶された命令が、現在実行中の命令、即ち発行されたが完了されておらず且つ命令バッファ310の空きスペースに置かれている命令を追跡するスコアボード322に追加される前に、命令はデコード316される。
FIG. 3 is a functional block diagram of
[0022]命令ディスパッチユニット212は、更に、発行(issue)ロジック320も備えている。この発行ロジック320は、スコアボード322を検査し、そして実行中の何れの命令にも依存しない命令を、命令バッファ310から発行する。命令バッファ310からの発行と共に、発行ロジック320は、パイプラインコンフィギュレーション信号を適切な実行パイプラインへ送信する。
[0022] The
[0023]図4は、本発明の第1の実施の形態に係るスレッドプール305の構成を示す。スレッドプール305は、12行2列のテーブルとして構成される。テーブルの各セルは、スレッドを記憶するメモリスロットを表わす。テーブルの各行は、バディーグループを表わす。従って、テーブルのセル0Aのスレッドは、テーブルのセル0Bのスレッドのバディースレッドである。本発明の実施の形態によれば、バディーグループのうちの一つのスレッドのみが、一度にアクティブとなる。命令フェッチの間に、アクティブなスレッドからの命令がフェッチされる。フェッチされた命令は、その後、デコードされ、命令バッファ310の対応スロットに記憶される。本明細書に示す本発明の実施の形態では、スレッドプール305のセル0A又はセル0Bの何れかからフェッチされた命令は、命令バッファ310のスロット0に記憶され、スレッドプール305のセル1A又はセル1Bの何れかからフェッチされた命令は、命令バッファ310のスロット1に記憶され、等々となる。また、命令バッファ310に記憶された命令は、発行ロジック320に従って連続するクロックサイクルで発行される。図6に示す簡単な例では、命令バッファ310に記憶された命令は、行0の命令、次いで、行1の命令、等々で始まる連続するクロックサイクルで発行される。
[0023] FIG. 4 shows a configuration of the
[0024]図5は、本発明の第2の実施の形態に係るスレッドプール305の構成を示す。スレッドプール305は、8行3列のテーブルとして構成される。テーブルの各セルは、スレッドを記憶するメモリスロットを表わす。テーブルの各行は、バディーグループを表わす。従って、テーブルのセル0A、0B及び0Cのスレッドは、バディーススレッドと考えられる。本発明の実施の形態によれば、バディーグループのうちの一つのスレッドのみが、一度にアクティブとなる。命令フェッチの間に、アクティブなスレッドからの命令がフェッチされる。フェッチされた命令は、その後、デコードされ、命令バッファ310の対応のスロットに記憶される。本明細書に示す本発明の実施の形態では、スレッドプール305のセル0A、セル0B又はセル0Cからフェッチされた命令が命令バッファ310のスロット0に記憶され、スレッドプール305のセル1A、セル1B又はセル1Cの何れかからフェッチされた命令が命令バッファ310のスロット1に記憶され、等々となる。また、命令バッファ310に記憶された命令は、発行ロジック320に従って連続するクロックサイクルで発行される。
[0024] FIG. 5 shows a configuration of a
[0025]スレッドプール305にスレッドが設定されるときには、当該スレッドプール305は列順(column major order)にロードされる。セル0Aが最初にロードされ、その後、セル1A、セル2A等々と続き、セルAが満たされるまでロードされる。次いで、セル0Bがロードされ、その後、セル1B、セル2B等々と続き、セルBが満たされるまでロードされる。スレッドプール305が追加の列をもって構成される場合には、このスレッドロードプロセスは、全ての列が満たされるまで同様に続けられる。スレッドプール305を列順にロードすることにより、バディースレッドを、一時的に、互いに可能な限り分離することができる。また、バディースレッドの各行は、他の行とは全く独立しており、命令バッファ310から命令が発行されるときに、行間の順序は発行ロジック320によって最小限に強制される。
[0025] When a thread is set in the
[0026]図6は、グループ当たり二つのバディースレッドがある場合のアクティブな実行スレッドのスワップを示すタイミングチャートである。実線の矢印は、アクティブなスレッドに対して実行される命令のシーケンスに対応する。このタイミング図は、スレッドプール305におけるセル0Aのスレッドが最初に開始され、そのスレッドからスワップ命令が発行されるまで当該スレッドからの命令のシーケンスが実行されることを示している。スワップ命令が発行されると、スレッドプール305のセル0Aのスレッドがスリープ状態に入り(即ち、インアクティブにされ)、そのバディースレッド、即ちスレッドプール305のセル0Bのスレッドがアクティブにされる。その後、スレッドプール305のセル0Bのスレッドからの命令のシーケンスが、そのスレッドからスワップ命令が発行されるまで、実行される。このスワップ命令が発行されると、スレッドプール305のセル0Bのスレッドがスリープ状態に入り、そのバディースレッド、即ちスレッドプール305のセル0Aのスレッドがアクティブにされる。これは、両スレッドがそれらの実行を完了するまで続けられる。バディースレッドへのスワップは、スレッドが実行を完了したがそのスレッドのバディースレッドが完了しないときにも行われる。
[0026] FIG. 6 is a timing chart showing swapping of active execution threads when there are two buddy threads per group. The solid arrow corresponds to the sequence of instructions executed for the active thread. This timing diagram shows that the thread in cell 0A in the
[0027]図6に示すように、スレッドプール305の他のアクティブなスレッドは、セル0Aのスレッドの後に連続して開始される。セル0Aのスレッドと同様に、他のアクティブなスレッドの各々も、そのスレッドからスワップ命令が発行されるまで実行され、スワップ命令が発行されたときに、当該スレッドはスリープ状態に入り、そのスレッドのバディースレッドがアクティブにされる。次いで、アクティブな実行が、バディースレッド間で、両スレッドがそれらの実行を完了するまで、交互に行われる。
[0027] As shown in FIG. 6, other active threads in the
[0028]図7は、バディーグループのスレッド(又は手短に言えば、バディースレッド)を実行するときに処理ユニットにより実行されるプロセスの各ステップを示すフローチャートである。ステップ710において、バディースレッドに対するハードウェアリソース、特に、レジスタが割り当てられる。割り当てられるレジスタは、バディースレッドの各々に対するプライベートレジスタ、及びバディースレッドにより共有されるべき共有レジスタを含む。共有レジスタの割り当ては、レジスタの使用を節約する。例えば、二つのバディースレッドがあり、且つ、バディースレッドの各々により24個のレジスタが必要とされる場合には、従来のマルチ処理方法を実行するには、合計48個のレジスタが必要になる。しかしながら、本発明の実施の形態では、共有レジスタが割り当てられる。これらのレジスタは、スレッドがアクティブであるときには必要であるが、スレッドが非アクティブであるとき、例えば、スレッドが待ち時間の長いオペレーションの完了を待機しているときには必要とされないレジスタに対応する。プライベートレジスタは、スワップとスワップとの間に保存する必要のある情報を記憶するために割り当てられる。二つのバディースレッドの各々により24個のレジスタが必要とされる実施例では、これらレジスタのうち16個を共有レジスタとして割り当てることができる場合に、両バディースレッドを実行するのに合計32個のレジスタしか必要とされない。バディーグループ当たり三つのバディースレッドがある場合には、節減が更に大きくなる。この実施例において、本発明では合計40個のレジスタが必要となるのに比して、従来のマルチ処理方法では合計72個のレジスタが必要になる。
[0028] FIG. 7 is a flowchart illustrating the steps of a process performed by a processing unit when executing a buddy group thread (or, in short, a buddy thread). In
[0029]バディースレッドのうち一つが、アクティブなスレッドとしてスタートし、このスレッドからの命令が実行のために取り出される(ステップ712)。ステップ714では、ステップ712で取り出された命令の実行が開始される。次いで、ステップ716において、その取り出された命令を検査して、スワップ命令であるかどうか調べる。スワップ命令である場合には、現在アクティブなスレッドが非アクティブにされ、バディーグループにおける他のスレッドのうちの一つがアクティブにされる(ステップ717)。スワップ命令でない場合には、ステップ714で開始された実行が完了しているか否かについて調べられる(ステップ718)。この実行が完了すると、現在アクティブなスレッドを検査して、実行されるべき命令が残っているかどうか調べる(ステップ720)。もし残っていれば、プロセスの流れがステップ712へ戻り、実行されるべき次の命令が現在アクティブなスレッドから取り出される。そうでなければ、全てのバディースレッドが実行を完了したか否かを調べるためにチェックがなされる(ステップ722)。完了した場合には、プロセスは終了となる。完了しない場合には、プロセスの流れがステップ717へ戻り、完了していないバディースレッドへのスワップが行われる。
[0029] One of the buddy threads starts as an active thread and instructions from this thread are retrieved for execution (step 712). In
[0030]上述した本発明の実施の形態では、プログラムがコンパイルされるときにスワップ命令が挿入される。スワップ命令は、通常、待ち時間の長い命令の直後に挿入され、好ましくは、プライベートレジスタの数に比して多数の共有レジスタを割り当てできるプログラム内の各ポイントにおいて挿入される。例えば、グラフィック処理では、スワップ命令がテクスチャ命令の直後に挿入される。本発明の別の実施の形態では、スワップイベントがスワップ命令でなく、ハードウェアが認識する何らかのイベントであってもよい。例えば、ハードウェアは、命令の実行において長い待ち時間を認識するように構成されていることがある。これを認識すると、長い待ち時間を生じさせる命令を発行したスレッドをインアクティブ状態に至らせ、同じバディーグループの別のスレッドをアクティブにさせることができる。また、スワップイベントは、長い待ち時間のオペレーション中の何らかの認識可能なイベント、例えば、長い待ち時間のオペレーション中に生じる第1のスコアボードの停止(ストール)であってもよい。 [0030] In the embodiment of the present invention described above, a swap instruction is inserted when a program is compiled. The swap instruction is usually inserted immediately after the high latency instruction and is preferably inserted at each point in the program where a large number of shared registers can be allocated relative to the number of private registers. For example, in graphic processing, a swap instruction is inserted immediately after a texture instruction. In another embodiment of the present invention, the swap event may not be a swap instruction but any event recognized by hardware. For example, the hardware may be configured to recognize long latencies in instruction execution. Recognizing this, the thread that issued the instruction causing the long wait time can be brought into the inactive state, and another thread in the same buddy group can be activated. The swap event may also be some recognizable event during a long latency operation, for example, a first scoreboard stall that occurs during a long latency operation.
[0031]以下の命令シーケンスは、スワップ命令がコンパイラーにより挿入され得るシェーダープログラムの箇所を例示するものである。
Inst_00: Interpolate iw
Inst_01: Reciprocal w
Inst_02: Interpolate s, w
Inst_03: Interpolate t, w
Inst_04: Texture s, t //Texturereturns r, g, b, a values
Inst_05: Swap
Inst_06: Multiply r, r, w
Inst_07: Multiply g, g, w
スワップ命令(inst_05)は、コンパイラーにより待ち時間の長いテクスチャ命令(inst_04)の直後に挿入される。このように、バディースレッドへのスワップは、待ち時間の長いテクスチャ命令(inst_04)が実行される間に行うことができる。スワップ命令を乗算命令(inst_06)の後に挿入するのは、あまり望ましくない。これは、乗算命令(inst_06)が、テクスチャ命令(Inst_04)の結果に依存し、バディースレッドへのスワップを、待ち時間の長いテクスチャ命令(Inst_04)がその実行を完了する後まで行えないからである。
[0031] The following instruction sequence illustrates the location of a shader program where a swap instruction can be inserted by the compiler.
Inst_00: Interpolate iw
Inst_01: Reciprocal w
Inst_02: Interpolate s, w
Inst_03: Interpolate t, w
Inst_04: Texture s, t // Texturereturns r, g, b, a values
Inst_05: Swap
Inst_06: Multiply r, r, w
Inst_07: Multiply g, g, w
The swap instruction (inst_05) is inserted by the compiler immediately after the long-latency texture instruction (inst_04). As described above, the swap to the buddy thread can be performed while the texture instruction (inst_04) having a long waiting time is executed. It is less desirable to insert a swap instruction after a multiply instruction (inst_06). This is because the multiply instruction (inst_06) depends on the result of the texture instruction (Inst_04) and cannot be swapped to the buddy thread until after the long-latency texture instruction (Inst_04) completes its execution. .
[0032]例示を簡単化するために、本発明の実施の形態の上述の説明で使用したスレッドは、単一スレッドの命令としている。しかしながら、本発明は、同様のスレッドが共にグループ化され、コンボイ(convoy)とも称されるこのグループからの同じ命令が、単一命令マルチデータ(SIMD)プロセッサを使用して複数の並列データパスを介して処理されるような実施形態にも適用することができる。 [0032] For simplicity of illustration, the threads used in the above description of the embodiments of the invention are single threaded instructions. However, the present invention allows similar instructions from this group, also referred to as convoys, grouped together, to use multiple single data paths using a single instruction multi-data (SIMD) processor. It can also be applied to embodiments that are processed via
[0033]以上、本発明の実施の形態を説明したが、本発明の基本的な範囲から逸脱せずに、他の及び更に別の実施形態を案出することも可能である。本発明の範囲は、特許請求の範囲により決定される。 [0033] While embodiments of the invention have been described above, other and further embodiments can be devised without departing from the basic scope of the invention. The scope of the invention is determined by the claims.
100…コンピュータシステム、110…中央処理ユニット(CPU)、112…システムメモリ、120…グラフィック処理ユニット(GPU)、122…インタフェイスユニット、124…処理ユニット、126…メモリコントローラ、130…ローカルグラフィックメモリ、200…処理ユニット、212…命令ディスパッチユニット、214…レジスタファイル、222,224…実行パイプライン、305…スレッドプール、310…命令バッファ、314…命令キャッシュ、320…発行ロジック、322…スコアボード。
DESCRIPTION OF
Claims (10)
前記処理ユニットのハードウェアリソースの第1のセット、第2のセット、及び共有のセットを、第1のスレッドの命令及び第2のスレッドの命令に割り当てるステップと、
前記ハードウェアリソースの第1のセット及び共有セットを使用して、所定のイベントが発生するまで、前記第1のスレッドの命令を実行するステップと、
前記所定のイベントの発生に応答して、前記第1のスレッドの命令の実行を保留すると共に、前記ハードウェアリソースの第2のセット及び共有セットを使用して、前記第2のスレッドの命令を実行するステップと、
を備えた方法。 A method of executing instructions of a plurality of threads in a processing unit,
Assigning a first set, a second set, and a shared set of hardware resources of the processing unit to instructions of a first thread and instructions of a second thread;
Using the first set of hardware resources and the shared set to execute instructions of the first thread until a predetermined event occurs;
In response to the occurrence of the predetermined event, the execution of the instruction of the first thread is suspended, and the second set of hardware resources and the shared set are used to execute the instruction of the second thread. Steps to perform;
With a method.
前記ハードウェアリソースの第3のセット及び第5のセットを使用して、前記第3のスレッドに対するスワップイベントが発生するまで、前記第3のスレッドの命令を実行するステップと、
前記3のスレッドに対する前記スワップイベントの発生に応答して、前記第3のスレッドの命令の実行を保留し、前記ハードウェアリソースの前記第4のセット及び前記第5のセットを使用して、前記第4のスレッドの命令を実行するステップと、
を更に備える請求項1に記載の方法。 Assigning a third set, a fourth set, and a fifth set of hardware resources of the processing unit to instructions of a third thread and instructions of a fourth thread;
Executing instructions of the third thread using the third and fifth sets of hardware resources until a swap event occurs for the third thread;
In response to the occurrence of the swap event for the third thread, the execution of instructions of the third thread is suspended, and the fourth set and the fifth set of hardware resources are used to Executing instructions of a fourth thread;
The method of claim 1, further comprising:
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US11/305,558 US20070143582A1 (en) | 2005-12-16 | 2005-12-16 | System and method for grouping execution threads |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007200288A true JP2007200288A (en) | 2007-08-09 |
| JP4292198B2 JP4292198B2 (en) | 2009-07-08 |
Family
ID=38165749
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006338917A Active JP4292198B2 (en) | 2005-12-16 | 2006-12-15 | Method for grouping execution threads |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20070143582A1 (en) |
| JP (1) | JP4292198B2 (en) |
| CN (1) | CN1983196B (en) |
| TW (1) | TWI338861B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012157786A1 (en) | 2011-05-19 | 2012-11-22 | 日本電気株式会社 | Parallel processing device, parallel processing method, optimization device, optimization method, and computer program |
| US8850168B2 (en) | 2009-02-24 | 2014-09-30 | Panasonic Corporation | Processor apparatus and multithread processor apparatus |
| JP2016511493A (en) * | 2013-03-15 | 2016-04-14 | クアルコム,インコーポレイテッド | Method and apparatus for saving and restoring system memory management unit context |
Families Citing this family (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090089564A1 (en) * | 2006-12-06 | 2009-04-02 | Brickell Ernie F | Protecting a Branch Instruction from Side Channel Vulnerabilities |
| GB2451845B (en) * | 2007-08-14 | 2010-03-17 | Imagination Tech Ltd | Compound instructions in a multi-threaded processor |
| US8589922B2 (en) | 2010-10-08 | 2013-11-19 | International Business Machines Corporation | Performance monitor design for counting events generated by thread groups |
| US8601193B2 (en) | 2010-10-08 | 2013-12-03 | International Business Machines Corporation | Performance monitor design for instruction profiling using shared counters |
| US8489787B2 (en) | 2010-10-12 | 2013-07-16 | International Business Machines Corporation | Sharing sampled instruction address registers for efficient instruction sampling in massively multithreaded processors |
| CN102520916B (en) * | 2011-11-28 | 2015-02-11 | 深圳中微电科技有限公司 | Method for eliminating texture retardation and register management in MVP (multi thread virtual pipeline) processor |
| JP5894496B2 (en) * | 2012-05-01 | 2016-03-30 | ルネサスエレクトロニクス株式会社 | Semiconductor device |
| US9710275B2 (en) | 2012-11-05 | 2017-07-18 | Nvidia Corporation | System and method for allocating memory of differing properties to shared data objects |
| KR20150019349A (en) * | 2013-08-13 | 2015-02-25 | 삼성전자주식회사 | Multiple threads execution processor and its operating method |
| GB2524063B (en) | 2014-03-13 | 2020-07-01 | Advanced Risc Mach Ltd | Data processing apparatus for executing an access instruction for N threads |
| GB2540937B (en) * | 2015-07-30 | 2019-04-03 | Advanced Risc Mach Ltd | Graphics processing systems |
| GB2544994A (en) * | 2015-12-02 | 2017-06-07 | Swarm64 As | Data processing |
| US11537397B2 (en) | 2017-03-27 | 2022-12-27 | Advanced Micro Devices, Inc. | Compiler-assisted inter-SIMD-group register sharing |
| US12033238B2 (en) | 2020-09-24 | 2024-07-09 | Advanced Micro Devices, Inc. | Register compaction with early release |
| CN114035847B (en) * | 2021-11-08 | 2023-08-29 | 海飞科(南京)信息技术有限公司 | Method and apparatus for parallel execution of kernel programs |
| US12353330B2 (en) | 2022-09-19 | 2025-07-08 | Apple Inc. | Preemption techniques for memory-backed registers |
| US12190151B2 (en) | 2022-09-19 | 2025-01-07 | Apple Inc. | Multi-stage thread scheduling |
| US12164927B2 (en) * | 2022-09-19 | 2024-12-10 | Apple Inc. | Thread channel deactivation based on instruction cache misses |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6092175A (en) * | 1998-04-02 | 2000-07-18 | University Of Washington | Shared register storage mechanisms for multithreaded computer systems with out-of-order execution |
| US6735769B1 (en) * | 2000-07-13 | 2004-05-11 | International Business Machines Corporation | Apparatus and method for initial load balancing in a multiple run queue system |
| US7681018B2 (en) * | 2000-08-31 | 2010-03-16 | Intel Corporation | Method and apparatus for providing large register address space while maximizing cycletime performance for a multi-threaded register file set |
| US7984268B2 (en) * | 2002-10-08 | 2011-07-19 | Netlogic Microsystems, Inc. | Advanced processor scheduling in a multithreaded system |
| US7430654B2 (en) * | 2003-07-09 | 2008-09-30 | Via Technologies, Inc. | Dynamic instruction dependency monitor and control system |
-
2005
- 2005-12-16 US US11/305,558 patent/US20070143582A1/en not_active Abandoned
-
2006
- 2006-12-15 JP JP2006338917A patent/JP4292198B2/en active Active
- 2006-12-15 CN CN2006101681797A patent/CN1983196B/en not_active Expired - Fee Related
- 2006-12-15 TW TW095147158A patent/TWI338861B/en active
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8850168B2 (en) | 2009-02-24 | 2014-09-30 | Panasonic Corporation | Processor apparatus and multithread processor apparatus |
| WO2012157786A1 (en) | 2011-05-19 | 2012-11-22 | 日本電気株式会社 | Parallel processing device, parallel processing method, optimization device, optimization method, and computer program |
| US9152462B2 (en) | 2011-05-19 | 2015-10-06 | Nec Corporation | Parallel processing device, parallel processing method, optimization device, optimization method and computer program |
| JP2016511493A (en) * | 2013-03-15 | 2016-04-14 | クアルコム,インコーポレイテッド | Method and apparatus for saving and restoring system memory management unit context |
Also Published As
| Publication number | Publication date |
|---|---|
| TW200745953A (en) | 2007-12-16 |
| JP4292198B2 (en) | 2009-07-08 |
| CN1983196A (en) | 2007-06-20 |
| CN1983196B (en) | 2010-09-29 |
| TWI338861B (en) | 2011-03-11 |
| US20070143582A1 (en) | 2007-06-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4292198B2 (en) | Method for grouping execution threads | |
| US20210349763A1 (en) | Technique for computational nested parallelism | |
| US9830156B2 (en) | Temporal SIMT execution optimization through elimination of redundant operations | |
| US8407454B2 (en) | Processing long-latency instructions in a pipelined processor | |
| US9158595B2 (en) | Hardware scheduling of ordered critical code sections | |
| US9069609B2 (en) | Scheduling and execution of compute tasks | |
| US20130232322A1 (en) | Uniform load processing for parallel thread sub-sets | |
| US20130166882A1 (en) | Methods and apparatus for scheduling instructions without instruction decode | |
| JPH08147165A (en) | Processor and processing method supporting multiple contexts | |
| JP2009525545A (en) | Thread-optimized multiprocessor architecture | |
| US9626191B2 (en) | Shaped register file reads | |
| US9286114B2 (en) | System and method for launching data parallel and task parallel application threads and graphics processing unit incorporating the same | |
| US9715413B2 (en) | Execution state analysis for assigning tasks to streaming multiprocessors | |
| CN103294449B (en) | The pre-scheduling dissipating operation is recurred | |
| CN116414464A (en) | Method and apparatus for scheduling tasks, electronic device and computer readable medium | |
| CN103197918B (en) | Hyperchannel timeslice group | |
| CN116414541B (en) | Task execution method and device compatible with multiple task working modes | |
| KR101420592B1 (en) | Computer system | |
| US20120246656A1 (en) | Scheduling of tasks to be performed by a non-coherent device | |
| CN103218253B (en) | Dissipate the replay in batches of operation | |
| JP2003167726A (en) | Coprocessor device and method for facilitating data transfer | |
| JP2008033490A (en) | Multithreaded processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080604 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080617 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080916 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20080916 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20081014 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090114 |
|
| 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: 20090310 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090406 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4292198 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120410 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120410 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130410 Year of fee payment: 4 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130410 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140410 Year of fee payment: 5 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |