JP2024042360A - Data processing program, data processing method, and data processing device - Google Patents
Data processing program, data processing method, and data processing device Download PDFInfo
- Publication number
- JP2024042360A JP2024042360A JP2022147028A JP2022147028A JP2024042360A JP 2024042360 A JP2024042360 A JP 2024042360A JP 2022147028 A JP2022147028 A JP 2022147028A JP 2022147028 A JP2022147028 A JP 2022147028A JP 2024042360 A JP2024042360 A JP 2024042360A
- Authority
- JP
- Japan
- Prior art keywords
- data
- calculation
- pieces
- partner
- unit
- 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.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 138
- 238000003672 processing method Methods 0.000 title claims description 4
- 238000004364 calculation method Methods 0.000 claims abstract description 250
- 230000001174 ascending effect Effects 0.000 claims abstract description 14
- 230000015654 memory Effects 0.000 claims description 47
- 238000010586 diagram Methods 0.000 abstract description 39
- 239000011159 matrix material Substances 0.000 description 62
- 238000000034 method Methods 0.000 description 50
- 238000013500 data storage Methods 0.000 description 11
- 238000005065 mining Methods 0.000 description 11
- 230000000052 comparative effect Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 3
- 230000010365 information processing Effects 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 238000010187 selection method Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 238000005401 electroluminescence Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Landscapes
- Complex Calculations (AREA)
Abstract
【課題】複数の演算部の処理量のばらつきを低減する。
【解決手段】記憶部11は、複数の相手データそれぞれとの組み合わせによる演算に用いられる2N(Nは2以上の整数)個のデータを記憶する。処理部12は、2N個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定する。処理部12は、上位のN個の第1データそれぞれを、演算対象の相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。処理部12は、下位のN個の第2データそれぞれを、演算対象の相手データの数の昇順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。処理部12は、N個の演算部に対する2N個のデータの割り当て結果に基づいて、2N個のデータのうちのN個のデータに対する演算をN個の演算部により並列に実行する。
【選択図】図1
An object of the present invention is to reduce variations in processing amount of a plurality of calculation units.
A storage unit 11 stores 2N (N is an integer greater than or equal to 2) pieces of data used for calculations in combination with each of a plurality of partner data. From the 2N pieces of data, the processing unit 12 identifies the top N first data and the bottom N second data in the result of sorting based on the number of partner data to be operated on. The processing unit 12 sends each of the N first data items to each of the N calculation units from the first calculation unit to the N-th calculation unit in descending order of the number of partner data to be calculated. assign. The processing unit 12 sends each of the lower N second data to each of the N calculation units from the first calculation unit to the N-th calculation unit in ascending order of the number of partner data to be calculated. assign. The processing unit 12 uses the N calculation units to execute operations on N data out of the 2N data in parallel based on the results of allocation of the 2N data to the N calculation units.
[Selection diagram] Figure 1
Description
本発明はデータ処理プログラム、データ処理方法およびデータ処理装置に関する。 The present invention relates to a data processing program, a data processing method, and a data processing device.
データの分析にパターンマイニングと呼ばれる手法が用いられている。パターンマイニングでは、データ集合の中から、ある条件を満たすデータの組み合わせを抽出することがある。データの複数の組み合わせそれぞれに対する演算は、例えばコンピュータが備えるCPU(Central Processing Unit)などの複数の演算部により並列に実行することができる。ここで、コンピュータによる並列処理の実行を効率化する方法が考えられている。 A method called pattern mining is used to analyze data. In pattern mining, combinations of data that satisfy certain conditions may be extracted from a data set. Operations on each of a plurality of combinations of data can be executed in parallel by a plurality of arithmetic units such as a CPU (Central Processing Unit) included in a computer, for example. Here, methods are being considered to make the execution of parallel processing by computers more efficient.
例えば、マルチプロセッサシステムにおいて、OS(Operating System)のスケジューラにより、中断中のスレッドを最も少ない負荷のCPUに割り当てることで、中断中のスレッドの割り当てと同時に負荷分散処理を行うスケジュール制御方法の提案がある。 For example, in a multiprocessor system, a schedule control method has been proposed in which the OS (Operating System) scheduler allocates suspended threads to the CPU with the least load, thereby simultaneously allocating suspended threads and performing load distribution processing. be.
また、スレッドをまとめてディスパッチする際に、前回と同じCPUにディスパッチするようにディスパッチ時期を調整することで、CPUごとに設けられたキャッシュの中のデータが再利用される可能性を高めるスケジューリング方式の提案もある。 In addition, when dispatching threads in batches, the dispatch timing is adjusted so that the threads are dispatched to the same CPU as the previous time, thereby increasing the possibility that data in the cache provided for each CPU will be reused. There is also a proposal.
また、マルチコアプロセッサを備えたコンピュータシステムで、OSスケジューラによりCPI(Cycles Per Instruction)レートと呼ばれる命令ごとのサイクル数を用いて、各スレッドを各コアに動的に割り当てる方法の提案もある。 Also, in a computer system with a multi-core processor, a method has been proposed in which the OS scheduler dynamically assigns each thread to each core using the number of cycles per instruction, called the CPI (Cycles Per Instruction) rate.
更に、タスクが実行されているときに発行されたオブジェクト、メモリ、またはレジスタのロックの数などの統計データを収集し、統計データを基に後続の処理サイクルでのスレッド数を調整するマルチスレッド処理システムの提案もある。 Additionally, multithreaded processing collects statistical data, such as the number of object, memory, or register locks issued while a task is executing, and adjusts the number of threads in subsequent processing cycles based on the statistical data. There are also system proposals.
第1のデータ集合の要素と第2のデータ集合の要素との全ての組み合わせに対する演算を複数の演算部を用いて行う場合、第1のデータ集合の要素ごとに、当該要素に関する演算を担当する演算部を割り当てることが考えられる。この場合、重複する組み合わせの演算は省略され得る。このため、第1のデータ集合の要素ごとに、組み合わせ相手として用いる第2のデータ集合の要素の数が変わり得る。したがって、例えば第1のデータ集合の要素を、組み合わせ相手となる第2のデータ集合の要素の数が多い順に、各演算部にサイクリックに割り当てると、各演算部が実行する処理量にばらつきが生じる。各演算部の処理量のばらつきは、全ての組み合わせに対する演算の終了を遅延させる要因となる。 When performing calculations on all combinations of elements of the first data set and elements of the second data set using multiple calculation units, each element of the first data set is responsible for the calculation regarding that element. It is conceivable to allocate an arithmetic unit. In this case, redundant combination operations may be omitted. Therefore, the number of elements of the second data set used as a combination partner may vary for each element of the first data set. Therefore, for example, if the elements of the first data set are cyclically assigned to each calculation unit in descending order of the number of elements of the second data set to be combined, the amount of processing performed by each calculation unit will vary. arise. Variations in the processing amount of each calculation unit become a factor that delays the completion of calculations for all combinations.
1つの側面では、本発明は、複数の演算部の処理量のばらつきを低減することを目的とする。 In one aspect, the present invention aims to reduce variations in processing amount of a plurality of arithmetic units.
1つの態様では、データ処理プログラムが提供される。このデータ処理プログラムは、コンピュータに、次の処理を実行させる。コンピュータは、複数の相手データそれぞれとの組み合わせによる演算に用いられる2N(Nは2以上の整数)個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定する。コンピュータは、上位のN個の第1データそれぞれを、演算対象の相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。コンピュータは、下位のN個の第2データそれぞれを、演算対象の相手データの数の昇順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。コンピュータは、N個の演算部に対する2N個のデータの割り当て結果に基づいて、2N個のデータのうちのN個のデータに対する演算をN個の演算部により並列に実行する。 In one aspect, a data processing program is provided. This data processing program causes a computer to execute the following process. The computer identifies the top N first data and the bottom N second data in the sorting result by the number of the partner data to be operated on, from 2N (N is an integer of 2 or more) pieces of data used in the operation by combination with each of the multiple partner data. The computer assigns each of the top N first data to each of the N operation units from the first operation unit to the Nth operation unit in descending order of the number of the partner data to be operated on. The computer assigns each of the bottom N second data to each of the N operation units from the first operation unit to the Nth operation unit in ascending order of the number of the partner data to be operated on. The computer executes the operation on N data of the 2N data in parallel by the N operation units based on the result of the assignment of the 2N data to the N operation units.
また、1つの態様では、コンピュータが実行するデータ処理方法が提供される。また、1つの態様では、記憶部と処理部とを有するデータ処理装置が提供される。 Also, in one aspect, a computer-implemented data processing method is provided. Further, in one aspect, a data processing device including a storage section and a processing section is provided.
1つの側面では、複数の演算部の処理量のばらつきを低減できる。 In one aspect, variations in the amount of processing of the plurality of calculation units can be reduced.
以下、本実施の形態について図面を参照して説明する。
[第1の実施の形態]
第1の実施の形態を説明する。
The present embodiment will be described below with reference to the drawings.
[First embodiment]
A first embodiment will be described.
図1は、第1の実施の形態のデータ処理装置を説明する図である。
データ処理装置10は、第1のデータ集合の要素と第2のデータ集合の要素との組み合わせに対する演算を複数の演算部を用いて行う。データ処理装置10は、記憶部11および処理部12を有する。
FIG. 1 is a diagram illustrating a data processing apparatus according to a first embodiment.
The
記憶部11は、RAM(Random Access Memory)などの揮発性の半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。
The
ここで、複数のプロセッサの集合を「マルチプロセッサ」と言うことがある。また、複数のプロセッサコアを有するプロセッサを「マルチコアプロセッサ」と言うことがある。処理部12は、例えばマルチプロセッサまたはマルチコアプロセッサである。
Here, a set of multiple processors is sometimes referred to as a "multiprocessor." Further, a processor having multiple processor cores is sometimes referred to as a "multi-core processor." The
処理部12は、N個の演算部を有する。Nは2以上の整数である。図1ではN=2の場合が例示される。N=2の場合、処理部12は、演算部12a,12bを有する。例えば処理部12がマルチプロセッサの場合、演算部12a,12bは、処理部12が有するプロセッサでもよい。例えば処理部12がマルチコアプロセッサの場合、演算部12a,12bは、処理部12が有するプロセッサコアでもよい。演算部12a,12bは、組み合わせの演算に用いられる。
The
ここで、対象となる組み合わせは第1のデータ集合の要素と第2のデータ集合の要素の組み合わせとする。この対象の組み合わせの演算に用いられる第1のデータ集合は2N個のデータを含む。N=2の例では、第1のデータ集合は、第1のデータ集合の要素として4つのデータd1,d2,d3,d4を含む。第1のデータ集合の要素との組み合わせ対象となる第2のデータ集合の要素を「相手データ」と言う。組み合わせの演算では、第1のデータ集合の要素ごとに当該要素の演算を担当する演算部が割り当てられる。第1のデータ集合の1つの要素に対応する全組み合わせの演算を1スレッドで実行することで、演算に使用するデータの入れ替えが少なくて済み、演算を効率的に行えるためである。 Here, the target combination is a combination of elements of the first data set and elements of the second data set. The first data set used for this target combination calculation includes 2N pieces of data. In the example of N=2, the first data set includes four data d1, d2, d3, and d4 as elements of the first data set. The elements of the second data set that are to be combined with the elements of the first data set are referred to as "partner data." In the combination calculation, a calculation unit is assigned to each element of the first data set in charge of calculation of the element. This is because by executing the calculations for all combinations corresponding to one element of the first data set in one thread, there is less need to replace data used in the calculations, and the calculations can be performed efficiently.
また、組み合わせの演算では、重複する組み合わせに対する演算が省略される。重複する組み合わせに対する演算の省略により、余計な演算を省ける。例えば、データd1とある相手データとの組み合わせと、データd2と他の相手データとの組み合わせが、同一の組み合わせに相当する場合、データd1についてだけ該当の相手データとの演算を行えばよく、データd2と当該他の相手データとの演算は省略される。このため、データd1~d4は、組み合わせによる演算対象となる相手データの数が異なる。そこで、処理部12は各演算部に対して、次のようにデータd1~d4を割り当てる。
Furthermore, in the calculation of combinations, calculations for overlapping combinations are omitted. By omitting operations for duplicate combinations, unnecessary operations can be omitted. For example, if the combination of data d1 and certain partner data and the combination of data d2 and other partner data correspond to the same combination, it is only necessary to perform calculations on data d1 with the corresponding partner data; The calculation between d2 and the other partner data is omitted. For this reason, the data d1 to d4 differ in the number of partner data to be calculated in combination. Therefore, the
処理部12は、N個のデータから、演算対象の相手データの数(相手データとの組み合わせ数)でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定する。テーブル11aは、N=2の例において、データd1~d4それぞれの相手データとの組み合わせ数を例示する。データd1~d4それぞれの演算対象の相手データの数は、データd1~d4それぞれの組み合わせ対象の相手データの数とも言える。例えば、テーブル11aは記憶部11に記憶されてもよい。データd1~d4それぞれの相手データとの組み合わせ数は次の通りであると仮定する。
From the N pieces of data, the
データd1の相手データとの組み合わせ数はm1である。データd2の相手データとの組み合わせ数はm2である。m2<m1である。データd3の相手データとの組み合わせ数はm3である。m3<m2である。データd4の相手データとの組み合わせ数はm4である。m4<m3である。なお、m1~m4は何れも正の整数である。この場合、処理部12は、組み合わせ数の上位2個のデータd1,d2、および、下位2個のデータd3,d4を特定する。
The number of combinations of data d1 and partner data is m1. The number of combinations of data d2 and partner data is m2. m2<m1. The number of combinations of data d3 and partner data is m3. m3<m2. The number of combinations of data d4 and partner data is m4. m4<m3. Note that m1 to m4 are all positive integers. In this case, the
処理部12は、上位のN個の第1データそれぞれを、組み合わせ数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。処理部12は、下位のN個の第2データそれぞれを、組み合わせ数の昇順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。
The
上記のN=2の例では、演算部12aが第1の演算部でもよく、演算部12bが第2の演算部でもよい。処理部12は、組み合わせ数の上位2個のデータd1,d2それぞれを、組み合わせ数の降順となるように、演算部12a,12bそれぞれに割り当てる。すなわち、処理部12は、演算部12aにデータd1を割り当て、演算部12bにデータd2を割り当てる。また、処理部12は、組み合わせ数の下位2個のデータd3,d4それぞれを、組み合わせ数の昇順となるように、演算部12a,12bそれぞれに割り当てる。すなわち、処理部12は、演算部12aにデータd4を割り当て、演算部12bにデータd3を割り当てる。
In the above example of N=2, the
なお、上記の割り当てについて、演算部12b,12aの順序でみれば、演算部12b,12aそれぞれにデータd2,d1それぞれが組み合わせ数の昇順となるように割り当てられていると言える。同様に、演算部12b,12aそれぞれにデータd3,d4それぞれが組み合わせ数の降順となるように割り当てられていると言える。
Regarding the above allocation, when looking at the order of the
また、上記の処理部12による割り当て処理は、演算部12a,12bの何れかにより実行されてもよいし、処理部12が備える他の演算部(制御用の演算部)により実行されてもよい。図1では当該他の演算部の図示は省略されている。
Further, the allocation processing by the
処理部12は、N個の演算部に対する2N個のデータの割り当て結果に基づいて、2N個のデータのうちのN個のデータに対する演算をN個の演算部により並列に実行する。上記のN=2の例では、処理部12は、演算部12a,12bに対するデータd1~d4の割り当て結果に基づいて、2個のデータに対する演算を、演算部12a,12bにより並列に実行する。
The
図1には、演算部12a,12bによる演算の実行例20が示されている。実行例20は、演算部12a,12bそれぞれによる演算の実行時間の例を示す。横軸の左から右向かう方向が時間の正方向である。例えば、演算部12aは、データd1の演算を実行し、その後データd4の演算を実行する。演算部12bは、データd2の演算を実行し、その後データd3の演算を実行する。このように、処理部12は、演算部12a,12bを用いて、同時に2個のデータに対する演算を並列に実行する。
FIG. 1 shows an example 20 of execution of calculations by the
第1の実施の形態のデータ処理装置10によれば、複数の相手データそれぞれとの組み合わせによる演算に用いられる2N個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとが特定される。上位のN個の第1データそれぞれが、演算対象の相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てられる。下位のN個の第2データそれぞれが、演算対象の相手データの数の昇順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てられる。N個の演算部に対する2N個のデータの割り当て結果に基づいて、2N個のデータのうちのN個のデータに対する演算がN個の演算部により並列に実行される。これにより、複数の演算部の処理量のばらつきを低減できる。
According to the
ここで、例えば、データd1,d2,d3,d4を、相手データとの組み合わせ数(演算対象の相手データの数)の多い順に、演算部12a,12bにサイクリックに割り当てることも考えられる。サイクリックに割り当てる場合、演算部12aにデータd1,d3が、演算部12bにデータd2,d4がそれぞれ割り当てられる。しかし、この場合、演算部12aが担当するデータd1,d3に対する処理量と、演算部12bが担当するデータd2,d4に対する処理量との差は比較的大きくなる。その結果、演算部12aによるデータd1,d3に対する合計の計算時間が比較的長くなり、全体の演算の終了が遅延する。
Here, for example, it is conceivable to cyclically allocate the data d1, d2, d3, and d4 to the
一方、データ処理装置10によれば、実行例20に示されるように、演算部12aが担当するデータd1,d4に対する処理量と、演算部12bが担当するデータd2,d3に対する処理量との差を低減できる。その結果、演算部12aの計算時間と演算部12bの計算時間との差が低減され、全体の演算の終了の遅延が低減される。
On the other hand, according to the
[第2の実施の形態]
次に、第2の実施の形態を説明する。
図2は、第2の実施の形態のデータ処理装置のハードウェア例を示す図である。
[Second embodiment]
Next, a second embodiment will be described.
FIG. 2 is a diagram illustrating a hardware example of a data processing device according to the second embodiment.
データ処理装置100は、CPU101、RAM102、HDD103、GPU104、入力インタフェース105、媒体リーダ106および通信インタフェース107を有する。データ処理装置100が有するこれらのユニットは、データ処理装置100の内部でバスに接続されている。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。
The
CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。CPU101は複数のプロセッサコアを含むマルチコアプロセッサである。プロセッサコアはCPUコアと言われてもよい。以下ではプロセッサコアをコアと称する。
The
RAM102は、CPU101が実行するプログラムやCPU101が演算に用いるデータを一時的に記憶する揮発性の半導体メモリである。なお、データ処理装置100は、RAM以外の種類のメモリを備えてもよく、複数個のメモリを備えてもよい。
The
HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性の記憶装置である。なお、データ処理装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の記憶装置を備えてもよく、複数の不揮発性の記憶装置を備えてもよい。
The
GPU104は、CPU101からの命令に従って、データ処理装置100に接続されたディスプレイ111に画像を出力する。ディスプレイ111としては、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、プラズマディスプレイ、有機EL(OEL:Organic Electro-Luminescence)ディスプレイなど、任意の種類のディスプレイを用いることができる。
The
入力インタフェース105は、データ処理装置100に接続された入力デバイス112から入力信号を取得し、CPU101に出力する。入力デバイス112としては、マウス、タッチパネル、タッチパッド、トラックボールなどのポインティングデバイス、キーボード、リモートコントローラ、ボタンスイッチなどを用いることができる。また、データ処理装置100に、複数の種類の入力デバイスが接続されていてもよい。
The
媒体リーダ106は、記録媒体113に記録されたプログラムやデータを読み取る読み取り装置である。記録媒体113として、例えば、磁気ディスク、光ディスク、光磁気ディスク(MO:Magneto-Optical disk)、半導体メモリなどを使用できる。磁気ディスクには、フレキシブルディスク(FD:Flexible Disk)やHDDが含まれる。光ディスクには、CD(Compact Disc)やDVD(Digital Versatile Disc)が含まれる。
The
媒体リーダ106は、例えば、記録媒体113から読み取ったプログラムやデータを、RAM102やHDD103などの他の記録媒体にコピーする。読み取られたプログラムは、例えば、CPU101によって実行される。なお、記録媒体113は可搬型記録媒体であってもよく、プログラムやデータの配布に用いられることがある。また、記録媒体113やHDD103を、コンピュータ読み取り可能な記録媒体と言うことがある。
For example, the
通信インタフェース107は、ネットワーク114に接続され、ネットワーク114を介して他の情報処理装置と通信する。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースでもよいし、基地局やアクセスポイントなどの無線通信装置に接続される無線通信インタフェースでもよい。
なお、データ処理装置100は、複数のCPU101を有し、大規模な演算に用いられるHPC(High-Performance Computing)システムでもよい。
データ処理装置100は、パターンマイニングに用いられる。パターンマイニングでは、データ処理装置100は、パターンマイニングにより、条件を満たすサンプルが所定数以上ある条件の組み合わせを求める。以下では、一例として、マーケティング分野における購買予測や広告、web掲載などの計画を行うために行われるパターンマイニングを例示する。ただし、データ処理装置100は、選挙投票率の予測といった政治分野や病気の原因発見といった医療分野など、他分野におけるパターンマイニングに適用することもできる。
Note that the
The
図3は、商品の組み合わせの抽出例を示す図である。
例えば、マーケティング分野では、次のような場合にパターンマイニングが行われ得る。第1の例は、商品の組み合わせに関し、組み合わせ内の全ての商品を購入した人数が、例えば100人など一定数以上いるような組み合わせを求める場合である。第2の例は、特定の2つの商品の両方を購入した人数が、例えば100人など一定数以上であるか否かを調査する場合である。あるいは、第1の例、第2の例以外の他の目的でパターンマイニングが行われることもある。
FIG. 3 is a diagram showing an example of extracting product combinations.
For example, in the marketing field, pattern mining may be performed in the following cases. The first example is a case where a combination of products is sought in which the number of people who purchased all the products in the combination is equal to or greater than a certain number, such as 100 people. A second example is a case where it is investigated whether the number of people who have purchased both of two specific products is greater than or equal to a certain number, such as 100 people. Alternatively, pattern mining may be performed for purposes other than the first and second examples.
第2の実施の形態の例では、データ処理装置100により、任意のk個の商品の組み合わせを選択し、それら全てを購入した顧客の人数がs_min以上である商品の組み合わせを抽出する場合を例示する。kは2以上の整数である。s_minは1以上の整数である。
In the example of the second embodiment, a case is exemplified in which the
商品購入履歴データ200は、顧客IDに対する「商品1」、「商品2」、「商品3」、…の購入履歴を示す。商品の列の「0」は購入しなかったことを示し、「1」は購入したことを示す。出力リスト210は、商品購入履歴データ200に基づいてデータ処理装置100により出力される。出力リスト210は、あるk個の商品の組み合わせを全て購入した人数がs_min以上である当該k個の商品の組み合わせを示す。次に、k=3の場合の計算例を説明する。
The product
図4は、3種類の商品を全て購入した人数の計算例を示す図である。
例えば、商品購入履歴データ200に基づいて「商品1」、「商品2」、「商品3」の全てを購入した人数を次のように計算する。まず、データ処理装置100は、商品購入履歴データ200の「商品1」の列と「商品2」の列との論理積(AND)を計算する(ステップST1)。各商品の列に相当するデータは、0,1が並ぶベクトルとなる。And(1,2)は、「商品1」の列と「商品2」の列との論理積の計算結果である。例えば、「商品1」の列が「1111」であり、「商品2」の列が「0110」の場合、And(1,2)は、「0110」となる。
FIG. 4 is a diagram showing an example of calculating the number of people who purchased all three types of products.
For example, based on the product
次に、データ処理装置100は、And(1,2)と「商品3」の列との論理積And(1,2,3)を計算する(ステップST2)。「商品3」の列が「0100」の場合、And(1,2,3)は「0100」となる。
Next, the
そして、データ処理装置100は、ステップST2の結果、すなわち、And(1,2,3)の要素の総和Sum(1,2,3)を計算する(ステップST3)。And(1,2,3)に対して、Sum(1,2,3)=0+1+0+0=1となる。データ処理装置100は、例えば、Sum(1,2,3)がs_min以上の場合、「商品1」、「商品2」、「商品3」の組み合わせを出力リスト210に追加する。
Then, the
次に、ステップST1に例示される2種類の商品の組み合わせに対する演算の例を説明する。
図5は、2種類の商品の組み合わせに対する演算例を示す図である。
Next, an example of calculation for the combination of two types of products exemplified in step ST1 will be described.
FIG. 5 is a diagram showing an example of a calculation for a combination of two types of products.
一例として、商品数d_x=10とする。マトリクス201は、2つの商品x,yの組み合わせに対応する論理積And(x,y)の各演算を例示する。列xは、商品購入履歴データ200の商品xに対応する。行yは、商品購入履歴データ200の商品yに対応する。すなわち、「列1」、「列2」、…、「列10」は、それぞれ「商品1」、「商品2」、…、「商品10」に対応する。また、「行1」、「行2」、…、「行10」は、それぞれ「商品1」、「商品2」、…、「商品10」に対応する。
As an example, the number of products d_x=10. The
マトリクス201の1つのマスが、商品x,yそれぞれの列の組み合わせに対する1つの論理積And(x,y)の演算を示す。例えば、マトリクス201の7行8列目のマスは、商品購入履歴データ200の「商品7」の列と同「商品8」の列との論理積And(8,7)を示す。商品数d_x=10の場合、2つの商品の列の組み合わせ総数は、10C2=45通りとなる。なお、マトリクス201の斜線が記載されたマスは、当該マスに対応する演算が実行されないことを示す。
One square of the
データ処理装置100は、論理積And(x,y)に基づいて、3種類の商品の組み合わせに対する演算を行う。
図6は、3種類の商品の組み合わせに対する演算例を示す図である。
The
FIG. 6 is a diagram showing an example of calculation for a combination of three types of products.
マトリクス202は、And(x,y)のデータと、商品x,yとは異なる商品zのデータ(相手データ)との組み合わせに対応する論理積And(x,y,z)の各演算を例示する。マトリクス202における列zは、商品購入履歴データ200の商品zに対応する。マトリクス202の行は、And(x,y)に相当する。なお、図中、マトリクス202の行は、And(x,y)に対応するラベル(x,y)により識別される。マトリクス202の横軸におけるzの値の数はd_x個である。マトリクス202の縦軸における(x,y)の数はd_xC2である。
The
マトリクス202の行は、(9,10),(8,10),(8,9),(7,10),(7,9),…,(1,2)の順に並べられる。列は、zの10~1の順に並べられる。And(x,y)ごとに計算する組み合わせ数、すなわち、演算対象の相手データの数は、(x,y)に対して組み合わせるzの数として、組み合わせの重複がないように予め特定される。マトリクス202の行に対応する(x,y)の並び順は、当該行に対応するAnd(x,y)のデータを、当該And(x,y)に対して計算する組み合わせ数(zの数)の降順にソートした結果に相当する。
The rows of the
マトリクス202の1つのマスが、And(x,y)と商品zの列との組み合わせに対する1つの論理積And(x,y,z)の演算を示す。商品数d_x=10の場合、And(x,y)と商品zの列との組み合わせ総数は、10C3=120通りとなる。なお、マトリクス202の斜線が記載されたマスは、当該マスに対応する演算が実行されないことを示す。
One square of the
マトリクス201やマトリクス202で示される論理積の演算は、1行に対応する演算を1スレッドとしてCPU101の各コアに割り振ることで、マルチスレッドで並列に実行可能である。
The logical AND operations shown in the
図7は、CPUのハードウェア例を示す図である。
CPU101は、コア121,122,123,124およびキャッシュメモリ125を有する。コア121~124は、それぞれが並列に演算を実行するプロセッサコアである。キャッシュメモリ125は、コア121~124それぞれの演算に使用されるデータが格納される。キャッシュメモリ125は、コア121~124から、RAM102よりも高速にアクセス可能である。キャッシュメモリ125には演算に用いられるデータがRAM102からロードされる。また、キャッシュメモリ125に格納されたデータがRAM102に書き込まれることもある。キャッシュメモリ125は、コア121~124により共有される。例えば、あるコアの演算のためにキャッシュメモリ125にロードされたデータは、他のコアの演算にも再利用できる。
FIG. 7 is a diagram showing an example of CPU hardware.
例えば、マトリクス202に対して、コア121~124には、次のように演算に用いられるデータが割り当てられる。
図8は、複数のコアに対するデータ割り当て例を示す図である。
For example, with respect to the
FIG. 8 is a diagram illustrating an example of data allocation to multiple cores.
マトリクス300は、マトリクス202の一部を記載したものである。第2の実施の形態の例では、4つのコア121~124に対し、ソート順位が隣接する8つ(4×2=8)のAnd(x,y)のデータを1セットとし、次のように各データが各コアに割り当てられる。
具体的には、組み合わせ数が上位の4個のデータそれぞれが、組み合わせ数の降順となるように、1番目のコア121から4番目のコア124までの4個のコアそれぞれに割り当てられる。また、組み合わせ数が下位の4個のデータそれぞれが、組み合わせ数の昇順となるように、1番目のコア121から4番目のコア124までの4個のコアそれぞれに割り当てられる。なお、「組み合わせ数」は、演算対象の相手データの数に相当する。
Specifically, each of the four pieces of data with the highest number of combinations is allocated to each of the four cores from the
すると、マトリクス300の例では、コア121~124に対して、次のように入れ子状にデータが割り当てられる。組み合わせ数「8」であるAnd(9,10)がコア121に割り当てられる。組み合わせ数「7」であるAnd(8,10)がコア122に割り当てられる。組み合わせ数「7」であるAnd(8,9)がコア123に割り当てられる。組み合わせ数「6」であるAnd(7,10)がコア124に割り当てられる。また、組み合わせ数「6」であるAnd(7,9)がコア124に割り当てられる。組み合わせ数「6」であるAnd(7,8)がコア123に割り当てられる。組み合わせ数「5」であるAnd(6,10)がコア122に割り当てられる。組み合わせ数「5」であるAnd(6,9)がコア121に割り当てられる。
Then, in the example of the
マトリクス300における行に対応する他のデータについても、同様にコア121~124が入れ子状に割り当てられる。
すると、コア121~124により4スレッドでマトリクス300の行方向の演算を並列に実行することができる。例えば、コア121は、And(9,10)と商品z=8~1の列それぞれとを組み合わせた8通り分の論理積の演算を1スレッドで実行する。コア122は、And(8,10)と商品z=7~1の列それぞれとを組み合わせた7通り分の論理積の演算を1スレッドで実行する。コア123は、And(8,9)と商品z=7~1の列それぞれとを組み合わせた7通り分の論理積の演算を1スレッドで実行する。コア124は、And(7,10)と商品z=6~1の列それぞれとを組み合わせた6通り分の論理積の演算を1スレッドで実行する。
For other data corresponding to rows in
Then, the
コア124は、当該6通りの分の論理積の演算が終了すると、And(7,9)と商品z=6~1の列それぞれとを組み合わせた6通り分の論理積の演算を1スレッドで実行する。コア121~123も同様に、割り当てられたデータに対する演算を順次実行する。
When the
なお、データ処理装置100は、マトリクス201に関しても、図8で例示した方法と同様に、コア121~124へマトリクス201の行yに対応するデータ、すなわち、商品購入履歴データ200の商品yの列を割り当てることができる。
Regarding the
図9は、データ処理装置の機能例を示す図である。
データ処理装置100は、データ記憶部130、キャッシュ記憶部140、割り当て部150および演算制御部160を有する。データ記憶部130は、RAM102やHDD103の記憶領域により実現される。キャッシュ記憶部140はキャッシュメモリ125の記憶領域により実現される。割り当て部150および演算制御部160は、RAM102に記憶されたプログラムをCPU101が実行することで実現される。
FIG. 9 is a diagram illustrating a functional example of the data processing device.
The
データ記憶部130は、マトリクス201やマトリクス202で使用されるデータの全体を記憶する。例えば、データ記憶部130は、商品購入履歴データ200を記憶する。
キャッシュ記憶部140は、データ記憶部130に記憶されたデータのうちの一部を記憶する。キャッシュ記憶部140には、データ記憶部130に記憶されたデータのうちの一部が、演算制御部160による演算実行に応じてロードされる。キャッシュ記憶部140は一定のサイズを有する。
The
割り当て部150は、コア121~124それぞれに対して、マトリクス201やマトリクス202の行に対応するデータを割り当てる。データの割り当て方法には、図8で例示した方法が用いられる。
The
演算制御部160は、割り当て部150によるデータの割り当て結果に基づき、コア121~124を用いて並列に各データに関する演算を実行する。演算制御部160は、演算結果をデータ記憶部130に格納する。
The
次に、データ処理装置100による処理手順を説明する。
図10は、組み合わせ計算例を示すフローチャートである。
(S10)演算制御部160は、コア121~124を用いてk=2の組み合わせ計算を行い、各組み合わせの論理積And(x,y)をリストAとして出力する。
Next, a processing procedure by the
FIG. 10 is a flowchart showing an example of combination calculation.
(S10) The
(S11)割り当て部150は、リストAの各データ、すなわち、論理積And(x,y)を各コアに入れ子状に割り当てる。ステップS11の割り当てでは、図8で例示した方法が用いられる。
(S11) The
(S12)演算制御部160は、下記ステップS13~S16で示される任意の3個の商品の組み合わせ計算をコア121~124を用いて繰り返し実行する。組み合わせ計算の総回数は、d_xC3回である。
(S12) The
(S13)コア121~124それぞれは、当該コアにて担当する組み合わせAnd(x,y)を選択し、未選択の組み合わせ(x,y,z)となる商品zを選択する。
(S14)コア121~124それぞれは、3個の商品x,y,zの論理積And(x,y,z)を計算する。
(S13) Each of the
(S14) Each of the
(S15)コア121~124それぞれは、論理積And(x,y,z)から3つの商品x,y,zを購入した人数Sum(x,y,z)を計数する。
(S16)コア121~124それぞれは、Sum(x,y,z)をリストBに追加する。
(S15) Each of the
(S16) Each of the
(S17)演算制御部160は、ステップS13~S16で示される任意の3個の商品の全ての組み合わせに対する計算を終了すると、ステップS18に処理を進める。
(S18)演算制御部160は、リストBを出力する。リストBは、データ記憶部130に格納される。そして、組み合わせ計算の処理が終了する。
(S17) When the
(S18) The
例えば、ステップS18で出力されたリストBの中から、Sum(x,y,z)がs_min以上である商品x,y,zの組み合わせが、出力リスト210に追加される。
次に、図8のデータ割り当てに対する比較例を説明する。
For example, from the list B output in step S18, a combination of products x, y, z for which Sum (x, y, z) is greater than or equal to s_min is added to the
Next, a comparative example for the data allocation shown in FIG. 8 will be described.
図11は、複数のコアに対するデータ割り当ての比較例を示す図である。
マトリクス400は、マトリクス202の一部を記載したものである。例えば、マトリクス400の各行に対応するデータを、組み合わせ数の多い順に、4つのコアC1,C2,C3,C4にサイクリックに割り当てることも考えられる。この場合、コアC1にAnd(9,10)、コアC2にAnd(8,10)、コアC3にAnd(8,9)、コアC4にAnd(7,10)、コアC1にAnd(7,9)、…というような割り当てとなる。しかし、比較例の割り当て方法では、コア数が増えるほど、各コアの処理量の差は大きくなる。コア間の処理量の差が大きくなると、処理が特定のコアに偏り、全体の処理時間が長くなる。
FIG. 11 is a diagram illustrating a comparative example of data allocation to a plurality of cores.
The
また、他の比較例の方法として、マトリクス400の一部を4分割してコアC1~C4に割り当てる例も考えられる。例えば、マトリクス400の上から1行目~5行目かつ左から1列目~5列目の第1領域、1行目~5行目かつ6列目~10列目の第2領域、6行目~10行目かつ1列目~5列目の第3領域、6行目~10行目かつ6列目~10列目の第4領域のように分割され得る。そして、分割した領域に含まれる各論理積の演算を、領域ごとにコアC1~C4に割り振る。しかし、このような割り当て方法でも、コアC1~C4の処理量の差は大きくなる。例えば、コアC1に第1領域、コアC2に第2領域、コアC3に第3領域、コアC4に第4領域を割り当てる場合、コアC2,C4が担当する組み合わせ数が25となり、コアC1が担当する組み合わせ数が9となり、コアC3が担当する組み合わせ数が1となる。このため、マトリクス400の1行目~10行目かつ1列目~10列目の部分だけでもコアC1,C3間の処理量の差が非常に大きくなってしまい、当該差を埋めることが難しくなる。また、この方法では、4つのコアのうちの高々2つのコアでしか、同じ商品zのデータを使用できない。
Furthermore, as another method for comparison, a part of the
図12は、各コアが計算する組み合わせ数の比較を示す図である。
テーブル500は、図11で示した比較例の方法を用いた場合と、図8で例示したデータ処理装置100の方法を用いた場合とにおける、コア121~124それぞれが計算する組み合わせ数を示す。コア数=4である。商品数d_x=10である。あるコアが計算する組み合わせ数は、当該コアに割り当てられる(x,y)の各データに対応する組み合わせ数の総和である。
FIG. 12 is a diagram showing a comparison of the number of combinations calculated by each core.
Table 500 shows the number of combinations calculated by each of
図11の比較例の方法では、コア121,122,123,124それぞれが計算する組み合わせ数は、33,31,29,27である。比較例の方法では、コア間の処理量の差の最大値は6となる。
In the method of the comparative example shown in FIG. 11, the number of combinations calculated by each of the
一方、図8のデータ処理装置100の方法では、コア121,122,123,124それぞれが計算する組み合わせ数は、30,30,30,30である。データ処理装置100では、コア間の処理量の差の最大値は0となる。このため、データ処理装置100では、比較例の方法に比べ、全体として3組み合わせ分(=33-30)の計算時間を削減可能になる。
On the other hand, in the method of the
以上説明したように、第2の実施の形態のデータ処理装置100によれば、複数のコアの処理量のばらつきを低減できる。その結果、全体の組み合わせに対する演算の終了の遅延を低減できる。
As described above, according to the
ところで、コア121~124は、上記の演算において例えば次のようにキャッシュ記憶部140を共用する。
図13は、第2の実施の形態のキャッシュ使用例(その1)を示す図である。
By the way, the
FIG. 13 is a diagram showing an example (part 1) of cache use according to the second embodiment.
ここで、And(x,y)とzとの1つの組み合わせに対する演算を1ステップとする。テーブル600は、各ステップにおけるコア121~124の演算対象の組み合わせ(z,(x,y))を示す。ステップはステップ1,2,…というようにステップ番号の昇順に進む。また、図中、コア121を「コア1」、コア122を「コア2」、コア123を「コア123」、コア124を「コア4」と略記する。1つの組み合わせの計算にかかる時間は、コア121~124で同じであるとする。
Here, the calculation for one combination of And (x, y) and z is defined as one step. Table 600 shows combinations (z, (x, y)) of calculation targets of
更に、各ステップにおける各コアのキャッシュ記憶部140へのデータのロード順は、コア121が最も早く、2番目にコア122が早く、3番目にコア123が早く、コア124が最も遅いものとする。キャッシュ記憶部140に空きがなくなると、キャッシュ記憶部140のデータは、最後に使用されてからの経過時間が長いデータが優先的に削除される。
Furthermore, the order of loading data into the
例えば、ステップ1では、コア121~124は次の組み合わせ(z,(x,y))の演算を実行する。コア121は(8,(9,10))の演算を実行する。コア122は(7,(8,10))の演算を実行する。コア123は(7,(8,9))の演算を実行する。コア124は(6,(7,10))の演算を実行する。
For example, in
ステップ1終了直後、キャッシュ記憶部140に保持されるデータは古い方から順に、And(9,10)、「商品8」、And(8,10)、And(8,9)、「商品7」、And(7,10)、「商品6」となる。ここで、「商品z」は商品購入履歴データ200の商品zの列に相当する。なお、図中では、キャッシュ記憶部140に格納されているデータは、図の左側へ向かうほど最後に使用されてからの時間が長く(使用履歴が古く)、図の右側へ向かうほど最後に使用されてからの時間が短い(使用履歴が新しい)。
Immediately after
次に、ステップ2では、コア121~124は次の組み合わせ(z,(x,y))の演算を実行する。コア121は(7,(9,10))の演算を実行する。コア122は(6,(8,10))の演算を実行する。コア123は(6,(8,9))の演算を実行する。コア124は(5,(7,10))の演算を実行する。
Next, in
ステップ2終了直後、キャッシュ記憶部140に保持されるデータは古い方から順に、「商品8」、And(9,10)、「商品7」、And(8,10)、「商品6」、And(7,10)、「商品5」となる。
Immediately after
このように、第2の実施の形態では、コア121~124はマトリクス300の行方向について、zの大きい方から小さい方へ向かう順で演算を行う。図13のマトリクス300の各マスには、当該マスの演算が実行されるステップ番号が記載されている。
In this way, in the second embodiment, the
図14は、第2の実施の形態のキャッシュ使用例(その2)を示す図である。
例えば、ステップxの実行中に、キャッシュ記憶部140に新たにデータDが追加される際、キャッシュ記憶部140に空き容量がない場合、キャッシュ記憶部140において、使用履歴が最も古いデータ(例えば、「商品8」のデータ)が削除される。
FIG. 14 is a diagram showing an example (part 2) of cache use according to the second embodiment.
For example, when new data D is added to the
「商品8」のデータは、キャッシュ記憶部140から削除されると、他の演算でキャッシュ記憶部140のデータを再利用できなくなる。このため、他の演算で「商品8」のデータを使用する場合、「商品8」のデータは、キャッシュ記憶部140に再ロードされる。例えば、コア121~124が担当するマトリクス300の各行を、4行ずつブロックに区切る。この場合、各コアが、マトリクス300の第1ブロックの演算後に、次の第2ブロックの演算に移る際、キャッシュ上に「商品z」のデータが無い場合がある。その場合、「商品z」のデータが再ロードされる。
When the data for "
[第3の実施の形態]
次に、第3の実施の形態を説明する。前述の第2の実施の形態と相違する事項を主に説明し、共通する事項の説明を省略する。
[Third embodiment]
Next, a third embodiment will be described. The points that are different from the second embodiment described above will be mainly explained, and the explanations of the common points will be omitted.
第3の実施の形態のデータ処理装置100は、第2の実施の形態よりもキャッシュメモリ125へのデータのロード回数を低減する機能を提供する。
図15は、第3の実施の形態の組み合わせ計算の実行順序の例を示す図である。
The
FIG. 15 is a diagram illustrating an example of the execution order of combination calculations according to the third embodiment.
マトリクス700は、マトリクス202の一部を記載したものである。
第3の実施の形態では、コア121~124は、マトリクス700における、ある行の演算を、zを第1の順序で用いて実行する。そして、コア121~124は、次の行の演算を、zを第1の順序とは逆の順序で用いて実行する。第1の順序は、例えばzの降順である。第1の順序はzの昇順でもよい。
In the third embodiment,
マトリクス700の各マスには、行に対応するデータAnd(x,y)に対する組み合わせ計算の実行順序を示すステップ数が記載されている。コア121~124には、第2の実施の形態と同様の方法で、各行に対応するデータAnd(x,y)が割り当てられる。例えば、コア121~124は、自身が担当するデータAnd(x,y)について、相手データをzの降順に用いて演算を実行すると、次に自身が担当するデータAnd(x’,y’)について、相手データをzの昇順に用いて演算を実行する。
Each cell of the
より具体的には、And(9,10),And(6,9)がコア121に割り当てられる例では、コア121はAnd(9,10)に対しz=…,3,2,1の順で演算を実行した後、And(6,9)に対しz=1,2,3,…の順で演算を実行する。このように、第3の実施の形態では、コア121~124は、組み合わせの相手データを折り返し順で使用して演算を実行する。これにより、ある組合せの演算の際に、他の組み合わせの演算のためにキャッシュメモリ125にロード済の相手データが利用され易くなる。
More specifically, in an example in which And (9, 10) and And (6, 9) are assigned to the
図16は、商品数が10個の場合の組み合わせ計算の実行順序の例を示す図である。
マトリクス700aは、商品数d_x=10の場合における、コア121~124による全ての組み合わせ計算の実行順序を示す。なお、And(9,10)にはコア121が、And(8,10)にはコア122が、And(8,9)にはコア123が、And(7,10)にはコア124がそれぞれ割り当てられるとする。以降、図8で例示した第2の実施の形態の方法で各コアに入れ子状にデータが割り当てられる。
FIG. 16 is a diagram showing an example of the execution order of combination calculations when the number of products is 10.
図17は、第3の実施の形態のキャッシュ使用例を示す図である。
テーブル800は、キャッシュ記憶部140におけるデータの格納状態を、マトリクス700aの各ステップ番号(step)に対して例示する。テーブル800の(x,y)の項目は、And(x,y)のデータを示す。テーブル800のzの項目は、商品購入履歴データ200の「商品z」の列に相当するデータを示す。
FIG. 17 is a diagram showing an example of cache use according to the third embodiment.
Table 800 illustrates the storage state of data in
テーブル800の太枠線で囲われたマスは、キャッシュ記憶部140に格納されたデータ、すなわち、キャッシュ上のデータを示す。なお、キャッシュ記憶部140には、各ステップにおいて、最大10個のデータを格納できるものとする。すなわち、And(x,y)のデータおよび「商品z」の列に相当する、キャッシュ上のデータの総数が10個を超える場合、最後に使用されてからの時間が最も長いデータがキャッシュ記憶部140から削除される。
Cells surrounded by thick frames in the table 800 indicate data stored in the
また、テーブル800の薄いドットのハッチングのマスは、データ記憶部130からキャッシュ記憶部140にロードされるデータ、すなわち、RAM102からキャッシュメモリ125にロードされるデータを示す。
Furthermore, hatched cells with thin dots in the table 800 indicate data loaded from the
また、テーブル800の斜線のハッチングのマスは、キャッシュ溢れにより、キャッシュ記憶部140から削除されるデータを示す。当該削除されるデータは、キャッシュ記憶部140内で使用履歴が最古のデータである。
Furthermore, the diagonally hatched cells in the table 800 indicate data deleted from the
更に、テーブル800の濃いドットのハッチングのマスは、各ステップの計算で使用されるデータを示す。計算で使用されるデータは、キャッシュ記憶部140内で使用履歴が最新に更新される。
Furthermore, the darkly dotted hatched cells in table 800 indicate data used in calculations at each step. The usage history of the data used in the calculation is updated to the latest in the
テーブル800は、マトリクス700aにおける各ステップのうち、ステップ番号1~18(step=1~18)のステップを例示する。
図18は、第3の実施の形態のキャッシュ使用例(続き)を示す図である。
Table 800 exemplifies steps with
FIG. 18 is a diagram showing an example of cache usage (continued) according to the third embodiment.
テーブル800aは、マトリクス700aにおける各ステップのうち、ステップ番号19~26(step=19~26)のステップを例示する。
図19は、第3の実施の形態のキャッシュ使用例(続き)を示す図である。
Table 800a exemplifies
FIG. 19 is a diagram showing an example of cache use (continued) according to the third embodiment.
テーブル800bは、マトリクス700aにおける各ステップのうち、ステップ番号27~30(step=27~30)のステップを例示する。なお、テーブル800bは、最終的に各データをキャッシュ記憶部140から削除するステップ番号31(step=31)のステップも例示する。
Table 800b exemplifies steps with
テーブル800~800bの例において、RAM102からキャッシュメモリ125へのロード回数は全部で53回となる。
図20は、組み合わせ計算例を示すフローチャートである。
In the examples of tables 800 to 800b, the number of loads from
FIG. 20 is a flowchart showing an example of combination calculation.
第3の実施の形態では、図10の手順のステップS13に代えて、ステップS13aが実行される点が第2の実施の形態と異なる。そこで、以下ではステップS13aを主に説明し、他のステップの説明を省略する。ステップS13aは、ステップS12の次に実行される。 The third embodiment differs from the second embodiment in that step S13a of the procedure in FIG. 10 is replaced with step S13a. Therefore, step S13a will be mainly explained below, and explanations of other steps will be omitted. Step S13a is executed next to step S12.
(S13a)コア121~124それぞれは、当該コアにて担当する組み合わせAnd(x,y)を選択し、未選択の組み合わせ(x,y,z)となる商品zを、折り返しとなる順序で選択する。ここで、折り返しとなる順序での選択方法には、図15のマトリクス700や図16のマトリクス700aで例示した方法が用いられる。そして、ステップS14に処理が進む。
(S13a) Each of the
このように、データ処理装置100は、組み合わせの相手データをzの折り返し順で用いて組み合わせ計算を実行することで、キャッシュメモリ125にロードされているデータの再利用可能性を高め、キャッシュメモリ125へのロードの回数を低減できる。その結果、データ処理装置100は、キャッシュメモリ125へのロードに伴うオーバーヘッドを低減でき、組み合わせ計算の高速化を図れる。
In this way, the
[第4の実施の形態]
次に、第4の実施の形態を説明する。前述の第2,第3の実施の形態と相違する事項を主に説明し、共通する事項の説明を省略する。
[Fourth embodiment]
Next, a fourth embodiment will be described. Items that are different from the second and third embodiments described above will be mainly described, and descriptions of common items will be omitted.
第4の実施の形態では、データ処理装置100は、キャッシュメモリ125へのデータのロード回数を更に低減する機能を提供する。第4の実施の形態は、k≧3以上の場合に適用される。
In the fourth embodiment, the
図21は、第4の実施の形態のセクタキャッシュの例を示す図である。
第4の実施の形態のキャッシュ記憶部140は、セクタ141,142を有する。セクタ141,142は、キャッシュ記憶部140の記憶領域全体を更に分割した記憶領域である。セクタ141の識別番号は「#0」である。セクタ142の識別番号は「#1」である。セクタキャッシュはソフトウェア制御可能なキャッシュ機構である。セクタキャッシュを用いると、このように、キャッシュメモリ125の記憶領域を複数のセクタに分割し、再利用性のあるデータと再利用性のないデータをセクタごとに住み分けることができる。
FIG. 21 is a diagram showing an example of a sector cache according to the fourth embodiment.
The
ここで、図17~図19で例示したテーブル800~800bの例において、And(x,y)よりも「商品z」のデータの方が再利用性は高い。k≧3の場合において、And(x,y)は、マトリクス700aの1行の処理が完了した後、二度と参照されることはないためである。
Here, in the examples of tables 800 to 800b illustrated in Figures 17 to 19, the data of "product z" is more reusable than And (x, y ), because when k ≥ 3, And (x, y) is never referenced again after processing of one row of
そこで、コア121~124は、And(x,y)と「商品z」のデータとを異なるセクタに格納する。例えば、コア121~124は、And(x,y)のデータを、セクタ141に格納する。コア121~124は、「商品z」のデータを、セクタ142に格納する。例えば、データaの配列をセクタ141に配置する、というように、何れのデータを何れのセクタに配置するかは、コア121~124が実行するプログラムのソースコード上で指定することができる。セクタ141,142それぞれの容量の割合は、例えばWAYという単位で指定可能である。WAY当たりの単位サイズsに当該セクタのWAYの値wを乗じた値が、当該セクタのサイズM(=w×s)となる。s,wは正の実数である。
Therefore, the
例えば、セクタ141のサイズは、コア数分のデータサイズ(例えば、4コアでは4データ分のサイズ)よりも大きくなるWAYの値w相当のサイズ(=w×s)のうちの最小のサイズM1(=w1×s)に対応するWAYの値w1とされる。w1は正の実数である。割り当て部150は、データサイズに基づいて、キャッシュ記憶部140の記憶領域のうちセクタ141に割り当てるWAYの値を決定し、残りのWAYの値をセクタ142に割り当てるようにしてもよい。
For example, the size of the
図22は、第4の実施の形態のキャッシュ使用例を示す図である。
テーブル900は、キャッシュ記憶部140におけるデータの格納状態を、マトリクス700aの各ステップ番号(step)に対して例示する。テーブル900の(x,y)の項目は、And(x,y)のデータを示す。テーブル900のzの項目は、商品購入履歴データ200の「商品z」の列に相当するデータを示す。
FIG. 22 is a diagram showing an example of cache use according to the fourth embodiment.
The table 900 illustrates the storage state of data in the
コア数は4である。商品数d_x=10である。また、キャッシュ記憶部140の記憶領域は、最大で10データを保持可能であるとする。更に、キャッシュ記憶部140の当該記憶領域はセクタ#0:セクタ#1=4:6の割合で分割されるものとする。
The number of cores is 4. The number of products is d_x = 10. Also, the memory area of the
第4の実施の形態では、And(x,y)のデータがセクタ141(セクタ#0)に載り、「商品z」のデータがセクタ142(セクタ#1)に載る点が、第3の実施の形態と異なる。 In the fourth embodiment, the data of And (x, y) is placed in sector 141 (sector #0), and the data of "product z" is placed in sector 142 (sector #1), which is different from the third embodiment. The form is different from that of
テーブル900の太枠線で囲われたマスは、キャッシュ記憶部140に格納されたデータ、すなわち、キャッシュ上のデータを示す。なお、キャッシュ記憶部140には、各ステップにおいて、最大10個のデータを格納できるものとする。
Squares surrounded by thick frames in the table 900 indicate data stored in the
また、テーブル900の薄いドットのハッチングのマスは、データ記憶部130からキャッシュ記憶部140にロードされるデータ、すなわち、RAM102からキャッシュメモリ125にロードされるデータを示す。
Furthermore, hatched cells with thin dots in the table 900 indicate data loaded from the
また、テーブル900の斜線のハッチングのマスは、キャッシュ溢れにより、キャッシュ記憶部140から削除されるデータを示す。データの削除は、セクタごとに行われる。当該削除されるデータは、該当のセクタ内で使用履歴が最古のデータである。
Further, the diagonally hatched cells in the table 900 indicate data deleted from the
更に、テーブル900の濃いドットのハッチングのマスは、各ステップの計算で使用されるデータを示す。計算で使用されるデータは、該当のセクタ内で使用履歴が最新に更新される。 Furthermore, the darkly dotted hatched cells in the table 900 indicate data used in the calculation of each step. The usage history of the data used in calculations is updated to the latest within the corresponding sector.
テーブル900は、マトリクス700aにおける各ステップのうち、ステップ番号1~19(step=1~19)のステップを例示する。
図23は、第4の実施の形態のキャッシュ使用例(続き)を示す図である。
Table 900 exemplifies steps with
FIG. 23 is a diagram showing an example of cache use (continued) according to the fourth embodiment.
テーブル900aは、マトリクス700aにおける各ステップのうち、ステップ番号20~28(step=20~28)のステップを例示する。
図24は、第4の実施の形態のキャッシュ使用例(続き)を示す図である。
Table 900a exemplifies steps with
FIG. 24 is a diagram showing an example of cache usage (continued) according to the fourth embodiment.
テーブル900bは、マトリクス700aにおける各ステップのうち、ステップ番号29,30(step=29,30)のステップを例示する。
図25は、組み合わせ計算例を示すフローチャートである。
Table 900b exemplifies steps with
FIG. 25 is a flowchart showing an example of combination calculation.
第4の実施の形態では、図20の手順のステップS10の前にステップS10aが実行される点が第3の実施の形態と異なる。そこで、以下ではステップS10aを主に説明し、他のステップの説明を省略する。 The fourth embodiment differs from the third embodiment in that step S10a is executed before step S10 in the procedure of FIG. Therefore, step S10a will be mainly explained below, and explanations of other steps will be omitted.
(S10a)割り当て部150は、セクタキャッシュの割合、すなわち、セクタ141,142の割合を指定し、データzをセクタ142(セクタ#1)に割り当てるように指定する。前述のように、割り当て部150は、コア数と、商品購入履歴データ200の1列当たりのデータサイズとに基づいて、キャッシュ記憶部140のうちのセクタ141(セクタ#0)のサイズを決定し、残りをセクタ142(セクタ#1)のサイズとする。そして、ステップS10に処理が進む。
(S10a) The
このように、データ処理装置100は、セクタキャッシュを用いることで、キャッシュメモリ125へのロード回数を一層低減できる。例えば、図22~図24のテーブル900~900bにおいて、RAM102からキャッシュメモリ125へのロード回数は全部で44回となる。
In this way, by using the sector cache, the
第3の実施の形態の図17~図19の例では、ロード回数は全部で53回である。例えば、第3の実施の形態では、図18のstep=22,23のように、再利用可能性の高いデータ(例えばz=1のデータ)がキャッシュ上から削除された後に、再びロードされるケースが発生している。このようなケースはロード回数が増える要因となる。
In the example of the third embodiment shown in Figures 17 to 19, the total number of loads is 53. For example, in the third embodiment, there are cases where data with high reusability (e.g. data with z=1) is deleted from the cache and then loaded again, as in
一方、データ処理装置100は、セクタキャッシュを用いることで、And(x,y)のデータのロードにより、「商品z」のデータがキャッシュ上から追い出されることを抑えられる。例えば、And(x,y)のデータをロードするときには、最終使用時からの時間が最長であるAnd(x,y)のデータがセクタ141から追い出されて、新たなAnd(x,y)のデータがセクタ141に格納される。その結果、「商品z」のデータが、キャッシュメモリ125のセクタ142上に長く保持されるようになり、RAM102からキャッシュメモリ125へのロード回数を一層低減できる。
On the other hand, by using the sector cache, the
このように、第4の実施の形態では、セクタキャッシュを用いることで、第3の実施の形態よりもロード回数を低減できる。また、その結果、データ処理装置100は、キャッシュメモリ125へのロードに伴うオーバーヘッドを一層低減でき、組み合わせ計算の一層の高速化を図れる。
In this way, in the fourth embodiment, by using the sector cache, the number of loads can be reduced more than in the third embodiment. Moreover, as a result, the
ところで、パターンマイニング処理をマルチスレッドで実行する際に、スレッド(コア)ごとの処理負荷のばらつきや、キャッシュメモリ125の非効率な使用のため、処理時間が長くなることがある。
By the way, when pattern mining processing is executed in multiple threads, processing time may become long due to variations in processing load for each thread (core) and inefficient use of the
例えば、コアごとの処理負荷のばらつきへの対策として、OSのスケジューラがコアの処理負荷を常時監視し、負荷の少ないコアに処理を割り振ることが考えられる。しかし、このような方法では、常時監視用のプログラムを要することになる。また、OSのスケジューラでは、パターンマイニング処理以外の他のプログラムなどの処理を各コアに分散するに過ぎない。 For example, as a countermeasure against variations in processing load among cores, it is conceivable that the scheduler of the OS constantly monitors the processing load of the cores and allocates processing to cores with less load. However, such a method requires a program for constant monitoring. Furthermore, the OS scheduler merely distributes processing such as programs other than pattern mining processing to each core.
これに対し、データ処理装置100では、コアへのスレッドの割り振りにスケジューラを用いず、組み合わせ計算の処理の実行前に割り振りを決定する。このため、実装が容易である。また、データ処理装置100の方法は、扱う行列データが三角行列に近いデータであるほど、各コアの処理量の平準化に有用である。すなわち、データ処理装置100の方法は、扱う行列データが三角行列に近いデータであるほど、各コアの負荷を均等に近くすることができる。また、データ処理装置100は、キャッシュメモリ125にロードされたデータの再利用可能性を高めることで、RAM102からキャッシュメモリ125へのデータのロード回数を削減でき、組み合わせ計算の全体の処理時間を短縮できる。
In contrast, the
次に、第2~第4の実施の形態の処理手順を一般化した例を説明する。
図26は、第2の実施の形態の組み合わせ計算を一般化したフローチャートである。
(S20)演算制御部160は、計算対象の商品の組み合わせ数nがn=2であるか否かを判定する。ここで、nは2以上の整数である。n≠2の場合、ステップS21に処理が進む。n=2の場合、ステップS22に処理が進む。
Next, an example in which the processing procedures of the second to fourth embodiments are generalized will be described.
FIG. 26 is a flowchart generalizing the combination calculation of the second embodiment.
(S20) The
(S21)演算制御部160は、コア121~124を用いてk=n-1の組み合わせ計算を行い、各組み合わせの論理積And(x,...)をリストAとして出力する。そして、ステップS23に処理が進む。
(S21) The
(S22)演算制御部160は、相手データdをリストAとする。リストAは、相手データdの一覧となる。そして、ステップS23に処理が進む。
(S23)割り当て部150は、リストAの各データ、すなわち、論理積And(x,...)を各コアに入れ子状に割り当てる。ステップS23の割り当てでは、図8で例示した方法が用いられる。(x,...)は、n-1個の商品の組み合わせを示す。
(S22) The
(S23) The
(S24)演算制御部160は、下記ステップS25~S27で示される任意のn個の商品の組み合わせ計算をコア121~124を用いて繰り返し実行する。組み合わせ計算の総回数は、d_xCn回である。
(S24) The
(S25)コア121~124それぞれは、当該コアにて担当する組み合わせAnd(x,...)を選択し、未選択の組み合わせ(x,...,d)となる商品dのデータ(すなわち、相手データd)を選択する。(x,...,d)は、n個の商品の組み合わせを示す。コア121~124それぞれは、n個の商品x,...,dの論理積And(x,...,d)を計算する。
(S25) Each of the
(S26)コア121~124それぞれは、論理積And(x,...,d)からn個の商品x,...,dを購入した人数Sum(x,...,d)を計数する。
(S27)コア121~124それぞれは、Sum(x,...,d)をリストBに追加する。
(S26) Each of the cores 121 to 124 calculates n products x, . .. .. , d is counted.
(S27) Each of the
(S28)演算制御部160は、ステップS25~S27で示される任意のn個の商品の全ての組み合わせに対する計算を終了すると、ステップS29に処理を進める。
(S29)演算制御部160は、リストBを出力する。リストBは、データ記憶部130に格納される。リストBは、商品(x,...,d)を購入した総和のリストとなる。そして、組み合わせ計算の処理が終了する。
(S28) When the
(S29) The
図27は、第3の実施の形態の組み合わせ計算を一般化したフローチャートである。
図27の手順では、図26のステップS24の次にステップS24aが実行される点が、図26の手順と異なる。そこで、以下ではステップS24aを主に説明し、他のステップの説明を省略する。
FIG. 27 is a flowchart generalizing the combination calculation of the third embodiment.
The procedure in FIG. 27 differs from the procedure in FIG. 26 in that step S24a is executed after step S24 in FIG. Therefore, step S24a will be mainly explained below, and explanations of other steps will be omitted.
(S24a)コア121~124それぞれは、当該コアにて担当する組み合わせAnd(x,...)を選択し、未選択の組み合わせ(x,...,d)となる商品dを、折り返しとなる順序で選択する。ここで、折り返しとなる順序での選択方法には、図15のマトリクス700や図16のマトリクス700aで例示した方法が用いられる。そして、ステップS25に処理が進む。
(S24a) Each of the
図28は、第4の実施の形態の組み合わせ計算を一般化したフローチャートである。
図28の手順は、n≧3の場合であり、図27の手順のステップS20に代えて、ステップS20aが実行される点、および、ステップS22が実行されない点が図27の手順と異なる。そこで、以下ではステップS20aを主に説明し、他のステップの説明を省略する。なお、図28の手順ではn≧3であるため、ステップS21のkについてk≧2となる。
FIG. 28 is a flowchart generalizing the combination calculation of the fourth embodiment.
The procedure in FIG. 28 is for the case where n≧3, and differs from the procedure in FIG. 27 in that step S20a is executed instead of step S20 of the procedure in FIG. 27, and step S22 is not executed. Therefore, step S20a will be mainly explained below, and explanations of other steps will be omitted. Note that since n≧3 in the procedure of FIG. 28, k≧2 in step S21.
(S20a)割り当て部150は、セクタキャッシュの割合、すなわち、セクタ141,142の割合を指定し、データzをセクタ142(セクタ#1)に割り当てるように指定する。前述のように、割り当て部150は、コア数と、商品購入履歴データ200の1列当たりのデータサイズとに基づいて、キャッシュ記憶部140のうちのセクタ141(セクタ#0)のサイズを決定し、残りをセクタ142(セクタ#1)のサイズとする。そして、ステップS21に処理が進む。
(S20a) The
このように、第2~第4の実施の形態の手順を一般化することができる。
第2~第4の実施の形態で説明したように、データ処理装置100は次の処理を実行する。
In this way, the procedures of the second to fourth embodiments can be generalized.
As described in the second to fourth embodiments, the
割り当て部150は、複数の相手データそれぞれとの組み合わせによる演算に用いられる2N(Nは2以上の整数)個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定する。割り当て部150は、上位のN個の第1データそれぞれを、演算対象の相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。割り当て部150は、下位のN個の第2データそれぞれを、演算対象の相手データの数の昇順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当てる。演算制御部160は、N個の演算部に対する2N個のデータの割り当て結果に基づいて、2N個のデータのうちのN個のデータに対する演算をN個の演算部により並列に実行する。
The
これにより、データ処理装置100は、複数の演算部(N個の演算部)の処理量のばらつきを低減できる。コア121~124は、4個の演算部の一例である。なお、データ処理装置100の機能は、図5,6に例示されるように、扱うデータが三角行列に近いほど、複数の演算部の処理量のばらつきを小さくできる。また、図5のマトリクス201の例では、行に対応するyのデータに対して、列に対応するxのデータが相手データの一例となる。図6のマトリクス202の例では、行に対応するAnd(x,y)のデータに対して、列に対応するzのデータが相手データの一例となる。
Thereby, the
また、上位のN個の第1データそれぞれに対する演算の実行では、N個の演算部は、複数の相手データのうち当該演算に用いる相手データを第1の順序で選択してもよい。下位のN個の第2データそれぞれに対する演算の実行では、N個の演算部は、複数の相手データのうち当該演算に用いる相手データを第1の順序とは逆の順序で選択してもよい。 Furthermore, when performing a calculation on each of the N pieces of high-order first data, the N calculation units may select the partner data to be used for the calculation from among the plurality of partner data in the first order. When performing an operation on each of the lower N pieces of second data, the N calculation units may select the partner data to be used for the operation from among the plurality of partner data in an order opposite to the first order. .
これにより、データ処理装置100は、N個の演算部が共用するキャッシュメモリ125上に相手データをロードする回数を低減できる。その結果、データ処理装置100は、キャッシュメモリ125へのロードに伴うオーバーヘッドを低減でき、演算の高速化を図れる。
Thereby, the
また、割り当て部150は、N個の演算部によりアクセスされるキャッシュメモリ125の記憶領域を第1記憶領域と第2記憶領域とに分割してもよい。そして、N個の演算部は、2N個のデータのうちの演算の実行対象のデータを第1記憶領域にロードし、複数の相手データのうちの演算の実行対象の相手データを第2記憶領域にロードしてもよい。
Furthermore, the
これにより、データ処理装置100は、再利用可能性の高い相手データがキャッシュメモリ125から追い出されることを抑制し、キャッシュメモリ125上に相手データをロードする回数を一層低減できる。セクタ141は、第1記憶領域の一例である。セクタ142は、第2記憶領域の一例である。
Thereby, the
例えば、割り当て部150は、2N個のデータそれぞれのサイズである第1サイズにNを乗じた値に基づいて、第1記憶領域のサイズを決定する。これにより、データ処理装置100は、第1記憶領域のサイズを適切に決定でき、キャッシュメモリ125上に相手データをロードする回数を効率的に低減できる。例えば、データ処理装置100は、演算部の数Nに対して、キャッシュメモリ125の記憶領域の使用可能なサイズのうち、第1記憶領域のサイズを必要最小限に定め、残りを第2記憶領域のサイズとする。このようにすると、第2記憶領域のサイズを比較的大きくすることができ、相手データを保持できるサイズが大きくなる。このため、データ処理装置100は、キャッシュメモリ125上に相手データをロードする回数をより一層低減できる。
For example, the
なお、第1の実施の形態の情報処理は、処理部12にプログラムを実行させることで実現できる。また、第2の実施の形態の情報処理は、CPU101にプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体113に記録できる。
Note that the information processing in the first embodiment can be realized by causing the
例えば、プログラムを記録した記録媒体113を配布することで、プログラムを流通させることができる。また、プログラムを他のコンピュータに格納しておき、ネットワーク経由でプログラムを配布してもよい。コンピュータは、例えば、記録媒体113に記録されたプログラムまたは他のコンピュータから受信したプログラムを、RAM102やHDD103などの記憶装置に格納し(インストールし)、当該記憶装置からプログラムを読み込んで実行してもよい。
For example, the program can be distributed by distributing the
10 データ処理装置
11 記憶部
11a テーブル
12 処理部
12a,12b 演算部
20 実行例
10
Claims (6)
複数の相手データそれぞれとの組み合わせによる演算に用いられる2N(Nは2以上の整数)個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定し、
前記上位のN個の第1データそれぞれを、演算対象の前記相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当て、前記下位のN個の第2データそれぞれを、演算対象の前記相手データの数の昇順となるように、前記第1の演算部から前記第Nの演算部までの前記N個の演算部それぞれに割り当て、
前記N個の演算部に対する前記2N個のデータの割り当て結果に基づいて、前記2N個のデータのうちのN個のデータに対する前記演算を前記N個の演算部により並列に実行する、
処理を実行させるデータ処理プログラム。 to the computer,
From 2N (N is an integer of 2 or more) data used for calculations in combination with each of multiple partner data, the upper N first data and the lower N pieces of second data and
Allocating each of the N pieces of first data at the higher rank to each of the N pieces of calculation units from the first calculation unit to the N-th calculation unit in descending order of the number of the partner data to be calculated, and Allocating each of the lower N pieces of second data to each of the N pieces of calculation units from the first calculation unit to the Nth calculation unit in ascending order of the number of the partner data to be calculated. ,
Based on the result of allocation of the 2N data to the N calculation units, the N calculation units execute the calculation on N data of the 2N data in parallel;
A data processing program that executes processing.
前記下位のN個の第2データそれぞれに対する前記演算の実行では、前記複数の相手データのうち当該演算に用いる前記相手データを前記第1の順序とは逆の順序で選択する、
請求項1記載のデータ処理プログラム。 In executing the calculation on each of the N first data items of the higher order, selecting the partner data to be used for the calculation among the plurality of partner data in a first order;
In executing the operation on each of the N pieces of second data at the lower level, selecting the partner data to be used for the operation from among the plurality of partner data in an order opposite to the first order;
The data processing program according to claim 1.
請求項2記載のデータ処理プログラム。 The storage area of the cache memory accessed by the N calculation units is divided into a first storage area and a second storage area, and the data to be executed for the calculation among the 2N pieces of data is stored in the first storage area. loading into the second storage area, and loading the partner data that is the target of the operation among the plurality of partner data into the second storage area;
The data processing program according to claim 2.
複数の相手データそれぞれとの組み合わせによる演算に用いられる2N(Nは2以上の整数)個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定し、
前記上位のN個の第1データそれぞれを、演算対象の前記相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当て、前記下位のN個の第2データそれぞれを、演算対象の前記相手データの数の昇順となるように、前記第1の演算部から前記第Nの演算部までの前記N個の演算部それぞれに割り当て、
前記N個の演算部に対する前記2N個のデータの割り当て結果に基づいて、前記2N個のデータのうちのN個のデータに対する前記演算を前記N個の演算部により並列に実行する、
データ処理方法。 The computer is
From 2N (N is an integer greater than or equal to 2) data used in an operation in combination with each of multiple partner data, the upper N first data and the lower N pieces of second data, and
Allocating each of the N pieces of high-rank first data to each of the N pieces of calculation units from the first calculation unit to the N-th calculation unit in descending order of the number of the partner data to be calculated, and assigning each of the lower N second data to each of the N calculation units from the first calculation unit to the N-th calculation unit in ascending order of the number of the partner data to be calculated; ,
Based on the result of allocation of the 2N data to the N calculation units, the N calculation units execute the calculation on N data among the 2N data in parallel;
Data processing methods.
前記2N個のデータから、演算対象の相手データの数でのソート結果における上位のN個の第1データと下位のN個の第2データとを特定し、前記上位のN個の第1データそれぞれを、演算対象の前記相手データの数の降順となるように、第1の演算部から第Nの演算部までのN個の演算部それぞれに割り当て、前記下位のN個の第2データそれぞれを、演算対象の前記相手データの数の昇順となるように、前記第1の演算部から前記第Nの演算部までの前記N個の演算部それぞれに割り当て、前記N個の演算部に対する前記2N個のデータの割り当て結果に基づいて、前記2N個のデータのうちのN個のデータに対する前記演算を前記N個の演算部により並列に実行する処理部と、
を有するデータ処理装置。 A storage unit that stores 2N (N is an integer equal to or greater than 2) pieces of data used in a calculation based on a combination with each of a plurality of pieces of partner data;
a processing unit which identifies, from the 2N pieces of data, the top N pieces of first data and the bottom N pieces of second data in a sorting result by the number of pieces of partner data to be operated on, assigns the top N pieces of first data to each of the N pieces of calculation units from the first calculation unit to the Nth calculation unit in descending order of the number of pieces of partner data to be operated on, and assigns the bottom N pieces of second data to each of the N pieces of calculation units from the first calculation unit to the Nth calculation unit in ascending order of the number of pieces of partner data to be operated on, and executes the calculation on N pieces of data of the 2N pieces of data in parallel by the N calculation units based on the allocation result of the 2N pieces of data to the N calculation units;
A data processing device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022147028A JP2024042360A (en) | 2022-09-15 | 2022-09-15 | Data processing program, data processing method, and data processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022147028A JP2024042360A (en) | 2022-09-15 | 2022-09-15 | Data processing program, data processing method, and data processing device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2024042360A true JP2024042360A (en) | 2024-03-28 |
Family
ID=90417815
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2022147028A Pending JP2024042360A (en) | 2022-09-15 | 2022-09-15 | Data processing program, data processing method, and data processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2024042360A (en) |
-
2022
- 2022-09-15 JP JP2022147028A patent/JP2024042360A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11086523B2 (en) | Automatic tiering of storage using dynamic grouping | |
US9678668B2 (en) | System and method for unbalanced RAID management | |
US9418048B2 (en) | Apparatus and method for allocating shared storage areas to parallel processors for multiplication of sparse matrix and vector | |
US6366911B1 (en) | Partitioning of sorted lists (containing duplicate entries) for multiprocessors sort and merge | |
CN105573660B (en) | Method and apparatus for improving the performance of sub-clustering disk array | |
US9619430B2 (en) | Active non-volatile memory post-processing | |
CN100573458C (en) | Progress control unit and course control method | |
CN1882913A (en) | Virtual machine management using activity information | |
CN104123304B (en) | The sorting in parallel system and method for data-driven | |
CN103279379A (en) | Methods and apparatus for scheduling instructions without instruction decode | |
CN103858103A (en) | Resource allocation tree | |
US20150127904A1 (en) | Assigning device adaptors to use to copy source extents to target extents in a copy relationship | |
US10102267B2 (en) | Method and apparatus for access control | |
CN109240795A (en) | A kind of resource regulating method of the cloud computing resources pool model suitable for super fusion IT infrastructure | |
CN103207810A (en) | Compute task state encapsulation | |
CN111767023A (en) | Data sorting method and data sorting system | |
Xie et al. | Accel-gcn: High-performance gpu accelerator design for graph convolution networks | |
JP2024042360A (en) | Data processing program, data processing method, and data processing device | |
DE102013100169A1 (en) | Computer-implemented method for selection of a processor, which is incorporated in multiple processors to receive work, which relates to an arithmetic problem | |
CN101135995A (en) | Method and equipment for removing alias addresses from an alias address pool | |
JP7219402B2 (en) | Optimization device, optimization device control method, and optimization device control program | |
US20190065239A1 (en) | Information processing apparatus and process management method | |
JP2017138892A (en) | Information processing device, processing device, and data search method | |
CN112749174B (en) | High concurrency processing method, device, processing equipment and computer storage medium | |
KR102530348B1 (en) | Gpgpu thread block scheduling method and apparatus |