JP5863426B2 - Information processing apparatus, information processing method, and program - Google Patents
Information processing apparatus, information processing method, and program Download PDFInfo
- Publication number
- JP5863426B2 JP5863426B2 JP2011265049A JP2011265049A JP5863426B2 JP 5863426 B2 JP5863426 B2 JP 5863426B2 JP 2011265049 A JP2011265049 A JP 2011265049A JP 2011265049 A JP2011265049 A JP 2011265049A JP 5863426 B2 JP5863426 B2 JP 5863426B2
- Authority
- JP
- Japan
- Prior art keywords
- node
- determination
- information processing
- thread
- processing apparatus
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、情報処理装置、情報処理方法およびプログラムに関する。 The present invention relates to an information processing apparatus, an information processing method, and a program.
決定木はデシジョンツリー(Decision Tree)とも呼ばれ、決定理論の分野における意思決定のほか、機械学習や最近では物体認識にもよく使われる手法である。決定木の実行は単純である。ルートノードと呼ばれる唯一のノードから始め、入力に対する判断を行い、その結果に従って複数ある子ノードのうちの一つを選択する。これを再帰的に繰り返すことにより、最終的に子ノードを持たないノードにたどり着く。 A decision tree is also called a decision tree, and is a technique often used for machine learning and recently object recognition in addition to decision making in the field of decision theory. Executing a decision tree is simple. Starting from a single node called the root node, the input is judged and one of a plurality of child nodes is selected according to the result. By repeating this recursively, it finally reaches a node having no child nodes.
子ノードを持たないノードをリーフノードと呼び、決定木の結果(ここではクラスと呼ぶ)と結びついている。子ノードを持つノードをここでは判断ノードと呼ぶことにする。判断ノードでは入力データを基に複数ある子ノードのうち、どれを選択するかを判断する。このように決定木とは複数あるクラス候補のうちの一つを、入力データを基に選択する手法である。全ての判断ノードが2つの子ノードを持ち、全ての子ノードは唯一つの親ノードを持つとすると、n回の判断で最大2nクラスへの分類ができるため、従来から決定木は効率的な分類器として用いられてきた。 A node that does not have a child node is called a leaf node, and is associated with a decision tree result (here called a class). Here, a node having child nodes is referred to as a decision node. The determination node determines which of a plurality of child nodes is selected based on the input data. Thus, the decision tree is a method of selecting one of a plurality of class candidates based on input data. Assuming that all decision nodes have two child nodes and all child nodes have only one parent node, it is possible to classify into a maximum of 2 n classes with n judgments. It has been used as a classifier.
一方で計算機の実行環境はGPU(Graphics Processing Unit)を用いるようになってきている。GPUをグラフィクス描画以外の計算に使うものをGPGPU(General Purpose computing on GPU)と呼ぶ。GPGPUにおいては通常数十から1000を超える計算コアを同時に動かす(並列処理)ことにより速度向上を図っている。 On the other hand, a GPU (Graphics Processing Unit) is used as an execution environment of a computer. What uses GPU for calculations other than graphics drawing is called GPGPU (General Purpose computing on GPU). In GPGPU, the speed is usually improved by simultaneously moving several tens to over 1000 computational cores (parallel processing).
しかし多くの計算アルゴリズムには、計算の実行に依存関係があり、並列処理を行うことが難しい。決定木の実行に関しても同様である。その結果、計算に参加しない計算コア(アイドルコアと呼ぶ)が増え、処理の高速化が図れないという問題が生じる。例えば、特許文献1には決定木の処理を高速に行なう構成が開示されている。
However, many computation algorithms have a dependency on the execution of computation, and it is difficult to perform parallel processing. The same applies to the execution of decision trees. As a result, the number of calculation cores that do not participate in the calculation (referred to as idle cores) increases, and there is a problem that the processing speed cannot be increased. For example,
しかしながら特許文献1の手法はデータのメモリ配置を工夫したものであり、決定木の実行に際しては、一つのスレッドが判断ノードを渡り歩きながら、判断を繰り返すことで結果を得ている。多くの計算コア(スレッド)がある状況では、いかに多くの計算コアを同時に計算に参加させ、アイドルコアを減らすことができるかが重要である。決定木の実行に関する従来の技術では、アイドルコアを減らすことができず、並列化による実行の高速化が図れない、という課題がある。
However, the technique of
本発明は、アイドルコアを減らし、処理の高速化を図ることが可能な情報処理技術を提供する。 The present invention provides an information processing technique that can reduce idle cores and increase the processing speed.
本発明の一つの側面にかかる情報処理装置は、入力データを受け付けて複数の子ノードのうち一つの子ノードを入力データに従って選択するルートノードと、複数の子ノードのうち一つの子ノードを入力データに従って選択する判断ノードおよび子ノードを有さないリーフノードのうち少なくとも一方と、が階層的に接続された決定木により前記入力データを処理する情報処理装置であって、
前記ルートノード、判断ノード、およびリーフノードのそれぞれを識別するために、識別情報を二進数の表記により設定する設定手段と、
それぞれの判断ノードによって、入力データに対する判断処理を行い、当該判断処理によって選択された子ノードの前記識別情報をそれぞれの判断ノードの選択結果として出力する判断手段と、
同一階層に含まれる前記判断ノードの選択結果として求められた前記子ノードの識別情報に対してビットワイズ論理和演算を行う演算手段と、
前記ビットワイズ論理和演算の結果に対して全ての階層についてビットワイズ論理積演算を行い、当該ビットワイズ論理積演算により求められた二進数の表記を識別情報として有するリーフノードを検索し、当該検索されたリーフノードに関連付けられたクラスを前記入力データに対する決定木の実行結果として決定する決定手段と、
を備えることを特徴とする。
The information processing apparatus according to one aspect of the present invention includes a root node that selected in accordance with the input data one of the child nodes of the plurality of child nodes accepts input data, one of the child nodes of the plurality of child nodes An information processing apparatus that processes the input data by a decision tree in which at least one of a determination node selected according to input data and a leaf node having no child nodes is hierarchically connected,
Setting means for setting identification information in binary notation to identify each of the root node, decision node, and leaf node;
A determination unit that performs a determination process on input data by each determination node, and outputs the identification information of a child node selected by the determination process as a selection result of each determination node;
A calculation means for performing a bitwise OR operation on the identification information of the child node obtained as a selection result of the determination node included in the same hierarchy;
A bitwise logical product operation is performed for all the hierarchies on the result of the bitwise logical OR operation, a leaf node having a binary notation obtained by the bitwise logical product operation as identification information is searched, and the search is performed. Determining means for determining a class associated with the designated leaf node as an execution result of a decision tree for the input data;
It is characterized by providing.
本発明によれば、アイドルコアを減らし、処理の高速化を図ることができる。 According to the present invention, idle cores can be reduced and the processing speed can be increased.
(第1実施形態)
図1を参照して決定木を用いた本発明の第1実施形態にかかる情報処理方法および情報処理装置決定木の実行方法を説明する。子ノードの選択はルートノード11から行われる。ルートノード11は入力データを受け付け、その入力データに対する判別結果として子ノード121、122のどちらを選択すべきかを判断する。複数の子ノードのうち一つを選択するノードを判断ノードと呼ぶ。図1において、判断ノードは線幅の細い円で示されている。判断ノードが何を基に判断するかは決定木によって異なるが、例えば、入力データに複数の値(変数)があり、それらの値と予め定めた値との比較を行って決定する。その比較の結果により、変数から求められた値により適合する子ノードを選択する。
(First embodiment)
An information processing method and a method for executing an information processing apparatus decision tree according to the first embodiment of the present invention using a decision tree will be described with reference to FIG. A child node is selected from the
図1では判断ノードから出る太い矢印が選択結果を示している。ルートノード11では、子ノード121、122のうち、子ノード121が選択されている。同様に判断ノード121では子ノード123、124のうち、子ノード124が選択されている。そして判断ノード124では子ノード130が選択されている。判断ノード130では子ノード141が選択されているが、ノード141は子ノードを有さないリーフノードである。リーフノードでは選択は行われず、関連付けられたクラスがそのまま結果となる。図1では「9」というクラスが決定木の実行結果となる。
In FIG. 1, a thick arrow coming out from the decision node indicates the selection result. In the
図2(a)は決定木を用いた第1実施形態にかかる情報処理方法の流れを説明する図であり、図2(b)は情報処理装置20の機能構成を示す図である。情報処理装置20は、決定木により入力データを処理する。決定木はルートノードと、複数の子ノードのうち一つの子ノードを入力データに従って選択する判断ノードおよび下位の階層に子ノードを有さないリーフノードのうち少なくともいずれか一方と、が階層的に接続されたものである。
FIG. 2A is a diagram illustrating the flow of the information processing method according to the first embodiment using a decision tree, and FIG. 2B is a diagram illustrating the functional configuration of the
設定部21は、ルートノード、判断ノード、およびリーフノードのそれぞれを識別するために、識別情報を二進数の表記により設定する。判断部22は、それぞれの判断ノードによって、入力データに対する判断処理を行い、判断処理によって選択された子ノードの識別情報をそれぞれの判断ノードの選択結果として出力する。演算部23は、同一階層に含まれる判断ノードの選択結果として求められた子ノードの識別情報に対してビットワイズ論理和演算を行う。
The
決定部24は、ビットワイズ論理和演算の結果に対してビットワイズ論理積演算を行い、ビットワイズ論理積演算により求められた二進数の表記を識別情報として有するリーフノードを検索する。そして、決定部24は、検索されたリーフノードに関連付けられたクラスを入力データに対する決定木の実行結果として決定する。記憶部25は、それぞれの判断ノードの処理を、プログラム実行主体のスレッドが一つのシングルスレッド環境、または、複数のスレッドが同時、並列に処理を行うマルチスレッド環境で実行するために入力データを保持する。
The
制御部26は、決定木による入力データの処理を、マルチスレッド環境を提供するGPGPU(General-purpose computing on graphics processing units)上の一つのワークグループ(Open CL)上で実行する。制御部26は、マルチスレッド環境における一のスレッドの処理と他のスレッドの処理とを同期させるために各スレッドの実行タイミングを制御する。
The
情報処理装置20の制御部26(図2(b))が図2(a)の処理の全体的な処理を制御する。ノードID付与ステップS1では、決定木の各ノードに内部処理用に、決定木を構成する各ノードを識別するために、ノードの識別情報(ノードID)を設定する。設定部21はノードIDはまずリーフノードから付与する。設定部21は重複のないよう整数値を適当に割り付ける。図1の場合、リーフノードのクラスがn(nは整数)=0〜15の16個の整数値であるので、リーフノードに関連付けられるクラスの値をn=0〜15としている。クラスの関連付けは特にこの値に拘るものではない。設定部21は、最終的にn個のリーフノードの識別情報をnビットの二進数の表記により設定する。図1においてノードIDは関連付けられたクラスに基づく16桁の二進数として各ノードの近傍に表記されている。
The control unit 26 (FIG. 2B) of the
リーフノードのノードIDの付与が終了後、設定部21は判断ノードのノードIDを付与する。判断ノードのノードIDには全ての子ノードのリーフノードのノードIDをビットワイズOR(ビットワイズ論理和演算)したものを付与する。例えば、判断ノード127の場合、子ノードはふたつあり、それぞれ二進数の表記で示すと“10000000 00000000”と“01000000 00000000”である。これらのOR(論理和演算)をとると“11000000 00000000”となる。これがノードIDとなる。同様に全ての判断ノードにノードIDを付与する。このようにリーフノードのノードIDが決定すれば、全ての判断ノードのノードIDは自動的に決定できる。ルートノードのノードIDは、ルートノードに接続しているノード(判断ノード、リーフノード)のノードIDを論理和演算することにより求めることができる。
After giving the node ID of the leaf node, the setting
次に入力データ準備ステップS2を行う。本発明はIntel社やAMD社のマルチコアCPU、NVIDIA社やAMD社のGPGPU等を搭載したコンピュータ(情報処理装置20)上で実行可能であるが、特にそれらに拘るものではない。本発明はプログラムの実行主体であるスレッドが一つであるシングルスレッド環境でも実行可能である。また、本発明は、複数のスレッドが同時、並列に処理を行うマルチスレッド環境でも実行可能であり、処理の同時、並列化により処理の高速化を図ることが可能である。 Next, input data preparation step S2 is performed. The present invention can be executed on a computer (information processing apparatus 20) equipped with a multi-core CPU of Intel or AMD, a GPGPU of NVIDIA or AMD, but is not particularly limited thereto. The present invention can also be executed in a single thread environment in which there is one thread that is the execution subject of the program. The present invention can also be executed in a multi-thread environment in which a plurality of threads perform processing simultaneously and in parallel, and the processing speed can be increased by simultaneous and parallel processing.
各々のスレッドは続く判断ステップS3での判断を行うにあたり、その拠り所となる入力データが必要である。入力データ準備ステップS2ではこの判断に必要な入力データを各スレッドがアクセスできる記憶領域にセットする。判断ノードごとに判断内容が異なるため、各判断ノードで必要な入力データも異なる。 Each thread needs input data as a basis for making a determination in the subsequent determination step S3. In the input data preparation step S2, the input data necessary for this determination is set in a storage area accessible by each thread. Since the determination contents are different for each determination node, the input data required for each determination node is also different.
Intel社やAMD社のマルチコアCPUに代表されるようなSMP(Symmetric Multiprocessing)アーキテクチャにおいては、判断のための入力データ保管場所として共有メモリを用いる。そのため、典型的にはスレッド専用のデータ保管場所にスレッドごとに異なる入力データをセットする必要はない。そのため、このステップは省略できる。一方、NVIDIA社やAMD社のGPGPUの場合、各スレッドが排他的にアクセスできるレジスタに値をセットする高速化テクニックが用いられる。 In an SMP (Symmetric Multiprocessing) architecture represented by a multi-core CPU of Intel or AMD, a shared memory is used as an input data storage location for determination. Therefore, it is typically not necessary to set different input data for each thread in a data storage location dedicated to the thread. Therefore, this step can be omitted. On the other hand, in the case of a GPGPU of NVIDIA or AMD, a high-speed technique is used in which a value is set in a register that can be exclusively accessed by each thread.
続いて、判断ステップS3では、各判断ノードにおいて、記憶領域にセットされた入力データに対し予め定められた判断処理を行い、複数ある子ノードのうち、いずれか一つを選択し、結果として返すものである。判断処理とは、例えば、入力データに含まれるある変数の値と予め定められた値とを比較し、一致するか否かでどの子ノードを選択するかというものである。より具体的な例としては、入力データ内の変数「天気」が、予め定められた値「晴れ」であるか否かにより、二つある子ノードのうちのいずれかを選ぶようなものが挙げられる。 Subsequently, in the determination step S3, a predetermined determination process is performed on the input data set in the storage area in each determination node, and any one of a plurality of child nodes is selected and returned as a result. Is. The determination process is, for example, comparing a value of a certain variable included in input data with a predetermined value and selecting which child node is selected depending on whether or not they match. More specific examples include selecting one of two child nodes depending on whether or not the variable “weather” in the input data has a predetermined value “sunny”. It is done.
このように判断処理は単に変数の値を用いて比較することもあるが、さらに複雑な計算を必要とする判断もある。例えば、入力データに輝度画像と、この画像上の2点の座標が与えられ、各座標を中心とする3×3の範囲の画素値の平均値を比較し、前者の方が大きいか否かによって選択する子ノードを決定するようなものである。いずれの場合においても、子ノードを一つ選択するが、選択した子ノードのノードIDを判断ステップS3の選択結果とする。 In this way, the determination process may be performed by simply using the value of the variable, but there may be a determination that requires more complicated calculation. For example, the input image is given a luminance image and the coordinates of two points on this image, and an average value of pixel values in a 3 × 3 range centered on each coordinate is compared. Is used to determine the child node to select. In either case, one child node is selected, and the node ID of the selected child node is set as the selection result in the determination step S3.
判断ステップS3の処理は並列実行が可能である。マルチスレッド環境において、一つのスレッドが一つまたは複数の判断ノードの処理を担当する。判断ステップS3では各判断ノードの判断結果を多くのスレッドが分散して保持している。次のORステップS4とANDステップS5とによって、各スレッドが保持している結果を集計して、決定木の実行結果を算出する。 The process of determination step S3 can be executed in parallel. In a multi-thread environment, one thread is responsible for processing one or more decision nodes. In the determination step S3, the determination result of each determination node is held by many threads in a distributed manner. In the next OR step S4 and AND step S5, the results held by each thread are totaled, and the execution result of the decision tree is calculated.
ORステップS4において、演算部23は同一階層の判断ノードの結果を集計する。「階層」とはルートノード11から判断ノードに至るまでに通過するブランチの数である。ブランチとは決定木内で親ノードと子ノードを繋ぐ矢印で示される。図1ではルートノード11は第0階層、判断ノード121,122は第1階層、判断ノード123,124,125,126は第2階層、その他の判断ノードは第3階層である。ORステップS4では同一階層の判断ノードの選択結果(ビット表示の子ノードの識別情報)に対してビットワイズOR演算(ビットワイズ論理和演算)を行う。図1の場合における、ORステップS4の集計結果を図3に示す。集計結果は階層ごと二進数表記でまとめられる。
In the OR step S4, the
最後にANDステップS5において、決定部24はORステップS4で同一階層ごとに集計された結果を全ての階層についてビットワイズAND(ビットワイズ論理積演算)する。図1の場合、図3に示した集計結果を全てビットワイズAND(ビットワイズ論理積)演算をすればよい。その結果、二進表記で“00000010 00000000”を得る。このノードIDを持つリーフノードに関連付けられたクラスが決定木の実行結果である。図1の場合、リーフノード141がこれに該当し、結果のクラスは「9」となる。
Finally, in the AND step S5, the
図1の場合、従来技法のシングルスレッド処理では4回の判断処理が必要となり、決定木の実行には4TD+Tαの時間がかかる。ここでTDは1回の判断にかかる時間で、Tαは分岐等その他の処理にかかる時間である。 In the case of FIG. 1, the single-thread processing of the conventional technique requires four determination processes, and it takes 4T D + T α to execute the decision tree. Here T D is the time for one determination, T alpha is the time for other processing branch or the like.
一方、本発明の実施形態にかかる判断ステップS3において各判断ノードにおける判断処理を異なるスレッドで同時に行った場合、TD+TT+Tβの時間がかかる。TTは集計のためのスレッド間データ転送にかかる時間で、Tβはその他の処理にかかる時間である。判断処理が十分複雑でTD≫TT,Tα,Tβの場合には、本実施形態は従来技法に比べ、約4倍高速に決定木の実行処理を行うことが可能である。 On the other hand, in the determination step S3 according to the embodiment of the present invention, when the determination process in each determination node is performed simultaneously in different threads, it takes time of T D + T T + T β . T T is the time required for data transfer between threads for aggregation, and T β is the time required for other processing. When the determination process is sufficiently complicated and T D >> T T , T α , T β , the present embodiment can execute the decision tree execution process about four times faster than the conventional technique.
図1の場合では15本のスレッドを使うが、従来技法ではアイドルコアとして使われなかった余剰の演算リソースである。このように本発明の実施形態ではアイドルコアを積極的に使用することにより、従来技法に比べ高速に判断木の実行を行うことが可能になる。 In the case of FIG. 1, 15 threads are used, but this is a surplus computing resource that was not used as an idle core in the conventional technique. As described above, according to the embodiment of the present invention, it is possible to execute the decision tree at a higher speed than in the conventional technique by actively using the idle core.
(第2実施形態)
先に説明した第1実施形態の決定木は平衡二分木であったが、本発明の趣旨はこの例に限定されず、例えば図4のような決定木の構造でもよい。ルートノード41の子ノードには判断ノード421とリーフノード431があり、判断ノード421の子ノードには、判断ノード423、判断ノード422、およびリーフノード432を有る。また、判断ノード423はリーフノード435、434を有し、判断ノード422はリーフノード433、434を有する。
(Second Embodiment)
Although the decision tree of the first embodiment described above is a balanced binary tree, the gist of the present invention is not limited to this example, and a decision tree structure as shown in FIG. Child nodes of the
判断ノード421の子ノードは422,423,432と3つのノードがあるが、このように子ノードの数はいくつでもよい。判断ノード422,423の子ノードは共通のノード434であるが、このように親ノードの数はいくつでもよい。このように、一つのルートノードを持つループ経路のない決定木であれば、決定木の構造は問わない。図4の場合、TD≫TT,Tα,Tβとすると、従来技法では入力データによりTD〜3TD程度の時間がかかる。本実施形態ではTDであり、従来技法に比べて最大で3倍程度の高速化を図ることが可能になる。
The
(第3実施形態)
TD≫TT,Tα,Tβの場合は、一つのスレッドで一つの判断ノードに関する判断ステップS3を同時に実行することにより、高速に判断木の実行を行うことができる。従来技法ではアイドルコアとして使われなかったn本のスレッドを演算リソースとして積極的に使用することにより、従来技法に比べ高速に判断木の実行を行うことが可能になる。2nの判断ノードがある平衡二分決定木を実行する場合、従来技法に比べ約n倍の高速化が図れる。
(Third embodiment)
In the case of T D >> T T , T α , T β , the decision tree can be executed at a high speed by simultaneously executing the decision step S3 for one decision node in one thread. By actively using n threads that were not used as idle cores in the conventional technique as computation resources, it is possible to execute a decision tree at a higher speed than in the conventional technique. When a balanced binary decision tree with 2 n decision nodes is executed, the speed can be increased by about n times compared to the conventional technique.
第1実施形態の処理の流れでは判断ステップS3の並列実行処理のあと、ORステップS4およびANDステップS5によって、各判断ノードの選択結果を集計している。この集計処理にはスレッド間の通信を伴うため、並列実行処理に比べて十分に決定木の実行の高速化が図れないこともある。判断ステップS3における各判断ノードでの判断が時間のかかる処理であれば、スレッド間通信による律速よりも並列処理による高速化が効果的である。逆に各判断ノードでの判断が単純であまり時間がかからない処理であれば、並列化による高速化よりもスレッド間通信による律速の影響が大きくなる。 In the processing flow of the first embodiment, after the parallel execution process of the determination step S3, the selection results of the respective determination nodes are aggregated by the OR step S4 and the AND step S5. Since this aggregation process involves communication between threads, it may not be possible to sufficiently speed up the execution of the decision tree compared to the parallel execution process. If determination at each determination node in determination step S3 is time-consuming processing, speeding up by parallel processing is more effective than rate control by inter-thread communication. Conversely, if the determination at each decision node is simple and does not take much time, the rate-limiting effect due to inter-thread communication is greater than the speed-up due to parallelization.
TDとTTに関して、TD≫TTであれば処理ステップS3を最大限に並列化することによる高速化が有効である。そうではない場合には多少並列化を犠牲にしてもTTを小さくすることが有効である。 Regarding T D and T T , if T D >> T T , speeding up by parallelizing processing step S3 to the maximum is effective. If this is not the case, it is effective to reduce T T even if some parallelization is sacrificed.
これには判断ステップS3において、複数の判断ノードにおける判断処理を一つのスレッドで行う。これにより、処理並列度を下げる代わりにスレッド間通信での律速の影響を減らすことができる。 For this purpose, in the determination step S3, determination processing in a plurality of determination nodes is performed by one thread. Thereby, it is possible to reduce the influence of rate-limiting in inter-thread communication instead of lowering the processing parallelism.
いくつの判断ノードでの判断処理を一つのスレッドで行うかはトレードオフであり、実行環境に大きく依存するため、多くの場合試行を繰り返して実験的に求めることになるが、詳細は本発明の範囲外であるため省略する。 The number of decision nodes to perform the decision processing in one thread is a trade-off and greatly depends on the execution environment. Therefore, in many cases, it is experimentally obtained by repeating trials. Omitted because it is out of range.
スレッド間通信を効果的に減らすにはORステップS4で行う同一階層内の判断ノードでの処理を一つのスレッドで行うか、ANDステップS5で行う階層間の結果を集計する処理を一つのスレッドで行うのがよい。しかしながら、ANDステップS5におけるスレッド間通信は高々判断ステップの階層数のノードしか関与しておらず、効果は限定的となる上に、並列度を実験的に変更する際の柔軟度が低い。そこで、同一階層内の判断ノードの処理を、一つのスレッドで行う。図1において、どのスレッドがどの判断ノードの処理を行うかを図5に例示する。図5の例1では、一つのスレッドには1〜2個の判断ノードの判断処理が割り当てられている。例2では、一つのスレッドには3〜4個の判断ノードの判断処理が割り当てられている。例2ではスレッド番号1のスレッドには階層を跨って判断ノードの判断処理が割り当てられているが、同一階層内処理をした上で、さらに異なる階層の判断処理を行うように担当が割り当てられている。例1の場合にスレッド間通信にかかる時間が先の実施形態の半分であるとすると、決定木の実行にかかる時間は約2TD+TT/2である。TT=2.5TDとすると、実施形態では従来技法に比べ14%程度の高速化であったのが、約23%の高速化が達成できる。
In order to effectively reduce inter-thread communication, the processing at the decision node in the same hierarchy performed in the OR step S4 is performed with one thread, or the processing of totaling the results between the layers performed in the AND step S5 is performed with one thread. Good to do. However, the inter-thread communication in the AND step S5 involves only the nodes of the number of hierarchies in the determination step, and the effect is limited, and the flexibility when experimentally changing the parallelism is low. Therefore, the processing of the decision node in the same hierarchy is performed with one thread. FIG. 5 exemplifies which thread performs processing of which determination node in FIG. In Example 1 of FIG. 5, one thread or two determination nodes are assigned to one thread. In example 2, 3 to 4 decision nodes are assigned to one thread. In the example 2, the determination process of the determination node is assigned to the thread of the
図5の例では使用スレッド数は8本であり、使用スレッド数が15本の場合に比べてアイドルコアの利用率は減るが、従来技法に比べるとアイドルコアを積極的に活用した高速化が可能になる。 In the example of FIG. 5, the number of threads used is 8, and the utilization rate of idle cores is reduced compared to the case where the number of threads used is 15. However, the speedup that actively uses idle cores is higher than the conventional technique. It becomes possible.
(第4実施形態)
図1において、下位の階層に子ノードを有さないリーフノードの数は16個、図4においてリーフノードの数は5個である。本実施形態においてノードIDは1リーフノードあたり1ビット要する。そのためノードIDのサイズとして、図1の場合は16ビット、図4の場合は5ビットが最低でも必要となる。
(Fourth embodiment)
In FIG. 1, the number of leaf nodes having no child nodes in the lower hierarchy is 16, and in FIG. 4, the number of leaf nodes is 5. In this embodiment, the node ID requires 1 bit per leaf node. Therefore, the size of the node ID is 16 bits in the case of FIG. 1 and 5 bits in the case of FIG.
またORステップS4およびANDステップS5ではビット演算を用いる。そこでノードIDを情報処理装置20が一度に読み書きできる単位のサイズを持つ整数値とすることで、情報処理装置20は効率よく処理を行うことができる。現在、よく使われているIntelやAMDのマルチコアCPUや、NVIDIAやAMDのGPGPUでは、8、16、32ビットといったサイズのデータを一度に読み書きできる。
In the OR step S4 and the AND step S5, bit operation is used. Therefore, by setting the node ID to an integer value having a unit size that the
そこで図1の決定木では16ビット長、図4の決定木では8ビット長の整数とする。なお情報処理装置20によっては、複数のサイズのデータを一度に読み書きできるが、その中でも最も効率のよいサイズが存在する場合がある。そのサイズが32ビットであるとすると、図1、図4のどちらの場合も32ビット長の整数とすることで、データの読み書きを効率的に行うことが可能になる。
Therefore, the decision tree of FIG. 1 is an integer having a 16-bit length and the decision tree of FIG. 4 is an 8-bit length. Depending on the
(第5実施形態)
NVIDIAのGPGPU(General-purpose computing on graphics processing units)開発環境であるCUDAや、AMDがGPGPU開発言語として採用しているOpenCL(Open Computing Language)ではGPUの構造を反映したスレッドの階層構造を持つ。詳細は各々のドキュメント(非特許文献1〜4)に記載があるのでここでは省略するが、実行主体であるスレッドをCUDAではスレッド、OpenCLではワークアイテムと呼ぶ。さらにこれらをいくつかまとめたものをブロック(CUDA)、ワークグループ(OpenCL)と呼ぶ。以下ではOpenCLの用語を用いる。CUDAの場合は適宜読み替えることで、同様の説明となる。ワークグループとはワークアイテムをまとめたもので、ワークグループ内のワークアイテムは論理的に同時並列処理が行われる。また同一ワークグループ内のワークアイテムは、ローカルメモリ(CUDAでは共有メモリ)を介して高速なワークアイテム間通信ができる。
(Fifth embodiment)
CUDA, which is an NVIDIA general-purpose computing on graphics processing units (GPGPU) development environment, and OpenCL (Open Computing Language), which AMD adopts as a GPGPU development language, have a thread hierarchy that reflects the structure of the GPU. Since details are described in each document (
異なるワークグループが同時に実行されることは保障されておらず、そのためワークグループを跨いだワークアイテム間通信は原則として行えない。 It is not guaranteed that different workgroups are executed at the same time. Therefore, communication between work items across workgroups cannot be performed in principle.
そこで一つの決定木の実行を一つのワークグループ上で行うことで、ワークアイテム間通信を行いつつ、並列処理により実行結果を算出することができる。 Therefore, by executing one decision tree on one work group, the execution result can be calculated by parallel processing while performing communication between work items.
(第6実施形態)
具体的なGPU(Graphics Processing Unit)との対応も考慮するとさらに細かい規則がある。基本的には同一ワークグループ内のワークアイテム(スレッド)は同一プログラムの同一位置の命令を実行することで、プログラムを高速に実行できる。そこで処理を早く終わった判断ノードに対するワークアイテムが次の処理を先行して実行しないように、各ステップ間で全ての全ワークアイテム(スレッド)の待ち合わせ同期を行う。制御部26(図2(b))は、一のワークアイテム(スレッド)の処理と他のワークアイテム(スレッド)の処理とを同期させるために各スレッドの実行タイミングを制御する。こうすることにより各ステップの実行タイミングを合わせることができ、少なくとも各ステップの先頭では全ワークアイテムが同一プログラムの同一位置の命令を実行することが可能となる。
(Sixth embodiment)
Considering the correspondence with a specific GPU (Graphics Processing Unit), there are more detailed rules. Basically, work items (threads) in the same work group can execute a program at high speed by executing instructions at the same position in the same program. Therefore, all the work items (threads) are wait-synchronized between the steps so that the work item corresponding to the determination node that has finished processing does not execute the next process in advance. The control unit 26 (FIG. 2B) controls the execution timing of each thread in order to synchronize the process of one work item (thread) and the process of another work item (thread). This makes it possible to synchronize the execution timing of each step, and at least at the beginning of each step, all work items can execute instructions at the same position in the same program.
(その他の実施形態)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other embodiments)
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (11)
前記ルートノード、判断ノード、およびリーフノードのそれぞれを識別するために、識別情報を二進数の表記により設定する設定手段と、
それぞれの判断ノードによって、入力データに対する判断処理を行い、当該判断処理によって選択された子ノードの前記識別情報をそれぞれの判断ノードの選択結果として出力する判断手段と、
同一階層に含まれる前記判断ノードの選択結果として求められた前記子ノードの識別情報に対してビットワイズ論理和演算を行う演算手段と、
前記ビットワイズ論理和演算の結果に対して全ての階層についてビットワイズ論理積演算を行い、当該ビットワイズ論理積演算により求められた二進数の表記を識別情報として有するリーフノードを検索し、当該検索されたリーフノードに関連付けられたクラスを前記入力データに対する決定木の実行結果として決定する決定手段と、
を備えることを特徴とする情報処理装置。 Accepts input data have a root node that selected in accordance with the input data one of the child nodes of the plurality of child nodes, the decision node and child node selects according to the input data to one of the child nodes of the plurality of child nodes An information processing apparatus that processes the input data by a decision tree in which at least one of the non-leaf nodes is hierarchically connected,
Setting means for setting identification information in binary notation to identify each of the root node, decision node, and leaf node;
A determination unit that performs a determination process on input data by each determination node, and outputs the identification information of a child node selected by the determination process as a selection result of each determination node;
A calculation means for performing a bitwise OR operation on the identification information of the child node obtained as a selection result of the determination node included in the same hierarchy;
A bitwise logical product operation is performed for all the hierarchies on the result of the bitwise logical OR operation, a leaf node having a binary notation obtained by the bitwise logical product operation as identification information is searched, and the search is performed. Determining means for determining a class associated with the designated leaf node as an execution result of a decision tree for the input data;
An information processing apparatus comprising:
子ノードとして有するリーフノードの識別情報に対するビットワイズ論理和演算により求めた二進数の表記を前記判断ノードの識別情報として設定することを特徴とする請求項1に記載の情報処理装置。 The setting means sets identification information of n leaf nodes by n-bit binary notation,
The information processing apparatus according to claim 1, wherein a binary notation obtained by bitwise OR operation with respect to identification information of a leaf node included as a child node is set as identification information of the determination node.
ことを特徴とする請求項1または2に記載の情報処理装置。 In order to execute the processing of each decision node in a single thread environment in which the thread that executes the program is one thread or in a multi-thread environment in which a plurality of threads perform processing simultaneously, the input to the storage area that can be accessed by each thread The information processing apparatus according to claim 1, further comprising storage means for holding data.
前記情報処理装置の設定手段が、前記ルートノード、判断ノード、およびリーフノードのそれぞれを識別するために、識別情報を二進数の表記により設定する設定工程と、
前記情報処理装置の判断手段が、それぞれの判断ノードによって、入力データに対する判断処理を行い、当該判断処理によって選択された子ノードの前記識別情報をそれぞれの判断ノードの選択結果として出力する判断工程と、
前記情報処理装置の演算手段が、同一階層に含まれる前記判断ノードの選択結果として求められた前記子ノードの識別情報に対してビットワイズ論理和演算を行う演算工程と、
前記情報処理装置の決定手段が、前記ビットワイズ論理和演算の結果に対して全ての階層についてビットワイズ論理積演算を行い、当該ビットワイズ論理積演算により求められた二進数の表記を識別情報として有するリーフノードを検索し、当該検索されたリーフノードに関連付けられたクラスを前記入力データに対する決定木の実行結果として決定する決定工程と、
を有することを特徴とする情報処理方法。 Accepts input data have a root node that selected in accordance with the input data one of the child nodes of the plurality of child nodes, the decision node and child node selects according to the input data to one of the child nodes of the plurality of child nodes An information processing method in an information processing apparatus that processes the input data by a decision tree in which at least one of the leaf nodes is hierarchically connected,
A setting step in which the setting means of the information processing apparatus sets identification information by binary notation in order to identify each of the root node, determination node, and leaf node;
A determination step in which a determination unit of the information processing apparatus performs a determination process on input data by each determination node, and outputs the identification information of the child node selected by the determination process as a selection result of each determination node; ,
A calculation step in which the calculation means of the information processing apparatus performs a bitwise OR operation on the identification information of the child node obtained as a selection result of the determination node included in the same hierarchy;
The determination unit of the information processing apparatus performs a bitwise logical product operation on all the hierarchies on the result of the bitwise logical sum operation, and uses a binary notation obtained by the bitwise logical product operation as identification information. A determination step of searching for a leaf node having, and determining a class associated with the searched leaf node as an execution result of a decision tree for the input data;
An information processing method characterized by comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011265049A JP5863426B2 (en) | 2011-12-02 | 2011-12-02 | Information processing apparatus, information processing method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011265049A JP5863426B2 (en) | 2011-12-02 | 2011-12-02 | Information processing apparatus, information processing method, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2013117862A JP2013117862A (en) | 2013-06-13 |
| JP5863426B2 true JP5863426B2 (en) | 2016-02-16 |
Family
ID=48712383
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011265049A Active JP5863426B2 (en) | 2011-12-02 | 2011-12-02 | Information processing apparatus, information processing method, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5863426B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12175242B2 (en) | 2020-06-25 | 2024-12-24 | Nec Corporation | Decision tree node instruction unification for parallel processing |
| US20230130239A1 (en) * | 2021-10-25 | 2023-04-27 | International Business Machines Corporation | Inflating decision tree to facilitate parallel inference processing |
-
2011
- 2011-12-02 JP JP2011265049A patent/JP5863426B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2013117862A (en) | 2013-06-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6605573B2 (en) | Parallel decision tree processor architecture | |
| US8400458B2 (en) | Method and system for blocking data on a GPU | |
| WO2021057746A1 (en) | Neural network processing method and apparatus, computer device and storage medium | |
| WO2021057720A1 (en) | Neural network model processing method and apparatus, computer device, and storage medium | |
| CN112711478B (en) | Task processing method and device based on neural network, server and storage medium | |
| Wei et al. | Stmatch: accelerating graph pattern matching on gpu with stack-based loop optimizations | |
| US20230418673A1 (en) | Method and apparatus for gnn-acceleration for efficient parallel processing of massive datasets | |
| CN107247628B (en) | Data flow program task dividing and scheduling method for multi-core system | |
| US11960982B1 (en) | System and method of determining and executing deep tensor columns in neural networks | |
| US12288141B2 (en) | Multi-level caching for dynamic deep learning models | |
| Yi et al. | Fast training of deep learning models over multiple gpus | |
| Jiang et al. | A parallel fp-growth algorithm based on gpu | |
| Krömer et al. | Many-threaded implementation of differential evolution for the CUDA platform | |
| US11941437B2 (en) | Graph partitioning to exploit batch-level parallelism | |
| CN105637482A (en) | GPU-based data stream processing method and device | |
| CN106484532B (en) | GPGPU parallel calculating method towards SPH fluid simulation | |
| JP5863426B2 (en) | Information processing apparatus, information processing method, and program | |
| CN106155799B (en) | Codelet dispatching method based on genetic algorithm | |
| Kamath et al. | M5: Multi-modal multi-task model mapping on multi-FPGA with accelerator configuration search | |
| US12524212B2 (en) | Control of storage aliasing via automatic application of artificial dependences during program compilation | |
| Huynh et al. | TP-PARSEC: A task parallel PARSEC benchmark suite | |
| CN105573834B (en) | A kind of higher-dimension vocabulary tree constructing method based on heterogeneous platform | |
| Kuhrt et al. | iGPU-accelerated pattern matching on event streams | |
| CN115964164A (en) | Computer-implemented method, hardware accelerator, and storage medium | |
| Nurnoby et al. | Distributed deep learning-based model for large image data classification |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20141201 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150803 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150807 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151005 |
|
| 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: 20151124 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20151222 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 5863426 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |