JP7324027B2 - Profiling method - Google Patents
Profiling method Download PDFInfo
- Publication number
- JP7324027B2 JP7324027B2 JP2019063934A JP2019063934A JP7324027B2 JP 7324027 B2 JP7324027 B2 JP 7324027B2 JP 2019063934 A JP2019063934 A JP 2019063934A JP 2019063934 A JP2019063934 A JP 2019063934A JP 7324027 B2 JP7324027 B2 JP 7324027B2
- Authority
- JP
- Japan
- Prior art keywords
- application
- accelerator
- information
- execution
- environment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 19
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 101100257262 Caenorhabditis elegans soc-1 gene Proteins 0.000 description 12
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Images
Description
本発明は、マルチコア環境のアクセラレータをプロファイリング(性能解析)する方法に関する。 The present invention relates to a method for profiling (performance analysis) of accelerators in multi-core environments.
コンピュータ上で実行されるプログラムの性能分析や最適化を行う手段として、プロファイリングが広く用いられている(例えば、特許文献1)。プロファイリングは、プログラムコードの走行頻度、時間分布、またプログラム内部の呼出し関係頻度等の分析に有効である。例えば、プロファイリングによって、プログラム実行中のリソースの利用状況(以下、「プロファイル情報」という)を取得する。プロファイル情報に基づいて、プログラム中で実行期間の長かったコード範囲や所定のイベント時のプログラムの実行状況等を把握することができる。 Profiling is widely used as a means of performing performance analysis and optimization of programs executed on computers (eg, Patent Document 1). Profiling is effective in analyzing the running frequency of program code, time distribution, calling relationship frequency inside the program, and the like. For example, by profiling, the usage status of resources during program execution (hereinafter referred to as "profile information") is acquired. Based on the profile information, it is possible to grasp the code range in which the execution period is long in the program, the execution status of the program at the time of a predetermined event, and the like.
しかし、上記したような従来のプロファイリング方法は、情報処理装置上のオペレーティングシステム(OS)で作動するシステムが対象であった。これに対し、本開示は、一部のタスクについてOS管理外のアクセラレータで実行されるマルチコア環境において、プロファイリングする方法を提供することを目的とする。 However, the conventional profiling method as described above is intended for a system that operates on an operating system (OS) on an information processing device. In contrast, an object of the present disclosure is to provide a method of profiling in a multi-core environment in which some tasks are executed by an OS-unmanaged accelerator.
本開示は上記課題を解決するために以下の技術的手段を採用する。特許請求の範囲及びこの項に記載した括弧内の符号は、ひとつの態様として後述する実施の形態に記載の具体的手段との対応関係を示す一例であって、本発明の技術的範囲を限定するものではない。 The present disclosure employs the following technical means to solve the above problems. The symbols in parentheses described in the claims and this section are an example showing the correspondence relationship with the specific means described in the embodiment described later as one aspect, and limit the technical scope of the present invention. not something to do.
本開示に係るプロファイリング方法は、開発環境のコンピュータから、当該コンピュータでコンパイルしたアクセラレータ用の実行プログラムをエクスポートするステップ(S10)と、前記実行プログラムを、ホストCPUとアクセラレータとを有する実行環境(実行環境は、前記コンパイル環境とは異なる環境)にインポートすると共に、前記開発環境と前記実行環境との違いを吸収するランタイムライブラリに環境間の変換情報を記憶するステップ(S11)と、前記実行環境において、前記ホストCPU上で実行されるアプリケーションから前記ランタイムライブラリを介して前記アクセラレータ上にて実行プログラムの処理を実行させるステップ(S12)と、前記アプリケーションが前記ランタイムライブラリを経由して、実行中のアクセラレータの状態(ステータス)を取得するステップ(S13)と、前記アプリケーションが前記ステータスの少なくとも一部をログファイルに書き込むステップ(S14)とを備える。 The profiling method according to the present disclosure comprises a step of exporting from a computer in a development environment an execution program for an accelerator compiled by the computer (S10); is an environment different from the compilation environment), and storing conversion information between the environments in a runtime library that absorbs the difference between the development environment and the execution environment (S11); a step (S12) of causing an application executed on the host CPU to execute processing of an execution program on the accelerator via the runtime library; It comprises a step (S13) of acquiring a state (status) and a step (S14) of said application writing at least part of said status to a log file.
本開示によれば、ランタイムライブラリに環境間の変換情報を記憶することにより、ランタイムライブラリを介して実行される実行環境のアクセラレータのプロファイリングを行うことができる。 According to the present disclosure, by storing conversion information between environments in the runtime library, accelerator profiling of the execution environment executed via the runtime library can be performed.
以下、添付図面を参照しながら本実施形態について説明する。説明の理解を容易にするため、各図面において同一の構成要素に対しては可能な限り同一の符号を付して、重複する説明は省略する。 Hereinafter, this embodiment will be described with reference to the accompanying drawings. In order to facilitate understanding of the description, the same constituent elements in each drawing are denoted by the same reference numerals as much as possible, and overlapping descriptions are omitted.
図1は、本実施の形態のプロファイリング方法の手順を示す図である。本実施の形態のプロファイリング方法は、開発環境と実行環境が異なるときに、実行環境での実行状況をプロファイリングする方法である。本実施の形態のプロファイリング方法で想定している実行環境は、マルチコア環境のアクセラレータ(図1では「ACC」と記載)を備えたSoC(System on Chip)1である。 FIG. 1 is a diagram showing the procedure of the profiling method of this embodiment. The profiling method of this embodiment is a method of profiling the execution status in the execution environment when the development environment and the execution environment are different. The execution environment assumed in the profiling method of the present embodiment is an SoC (System on Chip) 1 equipped with a multi-core environment accelerator (denoted as "ACC" in FIG. 1).
図2は、実行環境のSoC1の構成の一例を示す図である。SoC1は、ホストCPU21とアクセラレータ10とイベントハンドラ20とROM22とRAM23と外部インターフェイス24とを備えている。ホストCPU21とアクセラレータ10とROM22とRAM23と外部インターフェイス24は、システムバス25に接続されており、システムバス25を通じて互いに情報の授受が可能である。
FIG. 2 is a diagram showing an example of the configuration of
ホストCPU21は、データ処理を行うと共に、SoC1のOSをサポートする。ROM22は、読込専用のメモリである。RAM23は、読み書き用のメモリである。外部インターフェイス24は、例えば、カメラや超音波センサ等の外部機器と通信を行うためのインターフェイスである。
The
アクセラレータ10は、SoC1のホストCPU21の演算負荷に対処する個別マスタとしての役割を有する。アクセラレータ10は、独自に、命令フェッチを行うことが可能である。また、アクセラレータ10には、割込み処理を生成するイベントハンドラ20が接続されており、イベントハンドラ20が生成した割込みをサポートしている。
The
図1に戻って説明を続ける。開発環境のコンピュータ(PC)は、実行環境と同様に、CPUとアクセラレータを備えている。開発環境のPCのアクセラレータ(図1では「ACC」と記載)は、実行環境のSoC1と同じアクセラレータである。開発環境では、実行環境で用いられるアクセラレータのための実行プログラムの開発を行う。実行環境のSoC1に開発環境で開発されたアクセラレータの実行プログラムがインポートされ、アクセラレータ上で処理が実行される。開発環境のコンピュータと実行環境のSoC1では、CPUとCPUによって実行されるアプリケーションが異なる。
Returning to FIG. 1, the description continues. The development environment computer (PC), like the execution environment, has a CPU and an accelerator. The accelerator of the PC in the development environment (denoted as "ACC" in FIG. 1) is the same accelerator as the
開発環境ではコンピュータ用のコンパイラとアクセラレータ用のコンパイラが統合された形で実装されている。これに対し、実行環境のSoC1では、アプリケーションを実行するメイン処理部分と、アクセラレータ10の制御を行うランタイムライブラリで構成される。なお、ランタイムライブラリは、コンピュータプログラムの実行時にアプリケーションと常に同時に存在して利用される前提のライブラリである。本実施の形態では、ランタイムライブラリは、アプリケーションと実行プログラムとをつなぐソフトウェアモジュールである。
In the development environment, the compiler for the computer and the compiler for the accelerator are implemented in an integrated form. On the other hand, the
実行環境においては、ランタイムライブラリが開発環境と実行環境の違いを埋める。実行環境のCPU及びアプリケーションは、開発環境のCPU及びアプリケーションとは異なるので、アプリケーションにて解釈可能なプロファイリング情報を取得できないという問題があった。 In the execution environment, the runtime library bridges the difference between the development environment and the execution environment. Since the CPU and application in the execution environment are different from the CPU and application in the development environment, there is a problem that profiling information that can be interpreted by the application cannot be acquired.
本実施の形態のプロファイリング方法では、こうした問題を解決するため、ランタイムライブラリに、開発環境と実行環境という環境間の違いを変換するための情報を記憶しておき、アプリケーションはランタイムライブラリを介して実行中のアクセラレータ10の状態(ステータス)を取得する。具体的には、アプリケーションが取得するアクセラレータ10の情報がアプリケーションにより解釈できない情報になる場合に、ランタイムライブラリを介して、アプリケーションが解釈可能な情報に変換する。また、アプリケーションが取得するアクセラレータ10の情報が物理アドレスであり、物理アドレスがアプリケーションにより解釈できない情報になる場合には、ランタイムライブラリを介して、アプリケーションが解釈可能な論理アドレスに変換する。
In the profiling method of the present embodiment, in order to solve this problem, the runtime library stores information for converting the difference between the development environment and the execution environment, and the application is executed via the runtime library. Acquire the state (status) of the
本実施の形態のプロファイリング方法の動作について説明する。図1に示すように、開発環境のコンピュータが、コンパイルした実行プログラム(バイナリ)をエクスポートし(S10)、実行環境のSoC1は、エクスポートされた実行プログラムをインポートする(S11)。実行プログラムを実行環境のSoC1にインポートする際に、ランタイムライブラリに環境間の変換情報を記憶する。一例としては、実行プログラムのバイナリをマッピングする実行環境のメモリアドレス、サイズ、命令や書き換え可能データといったメモリ値の属性の情報を記憶しておく。
The operation of the profiling method of this embodiment will be described. As shown in FIG. 1, a development environment computer exports a compiled execution program (binary) (S10), and an
アクセラレータ10は、アプリケーションから指示に従って、実行プログラムを実行することにより処理を行う(S12)。この際、アクセラレータ10の情報は、ランタイムライブラリに隠蔽され、ホストCPU21からは見えない。例えば、実行環境の物理アドレスは、実行ファイルのインポート時に、アドレス変換テーブルが書き換えられ、実行環境用に変更される。本実施の形態のプロファイル方法では、実行時に隠蔽される情報をホストCPU21が取得できるような機能をランタイムライブラリに持たせる。ランタイムライブラリが、アクセラレータ10の情報から、アプリケーションが解釈できる論理的な情報に変換し、アクセラレータ10のプロファイリングを行う(S13)。ホストCPU21は、ランタイムライブラリが変換した情報をログファイルに書き込む(S14)。このログファイルを開発環境のコンピュータに読み込ませ(S15)、開発環境のコンピュータのビューワでログファイルを見ることにより、SoC1の実行状況をプロファイルすることができる。
The
図3は、実行環境のSoC1において、プロファイリング情報を取得するシーケンスを示す図である。まず、ホストCPU21はプロファイリング情報を書き込むログファイルを生成する(S20)。次に、ホストCPU21はアプリケーションを実行し、その中で、アクセラレータ10に対して実行開始を指示する(S21)。これを受けてアクセラレータ10は、処理を行う(S22)。アクセラレータ10は、処理が終了すると、アプリケーションに割込みをかけて処理終了を通知する。
FIG. 3 is a diagram showing a sequence for acquiring profiling information in SoC1 of the execution environment. First, the
アプリケーションのプロファイル機能は、アクセラレータ10にステータスの読出しの命令を送信し(S23)、アクセラレータ10は、ステータスを読み出してアプリケーションに送信する(S24)。
The profile function of the application sends a command to read the status to the accelerator 10 (S23), and the
アプリケーションのプロファイル機能は、読み出したデータのうち、アプリケーションでは解釈できない値を変換するために、ランタイムライブラリに変換を依頼する。たとえば、ランタイムライブラリに物理アドレスを送信し(S25)、ランタイムライブラリから、物理アドレスに対応する仮想アドレスを取得する(S26)。そして、プロファイル機能は、取得した仮想アドレスに基づいてログデータを生成し(S27)、生成したログデータをプロファイルログファイルに書き込む(S28)。このように、アクセラレータ10の実行の状況が論理情報に変換されてログファイルに書き込まれていく。続いて、ホストCPUは、アクセラレータ10に対して実行開始を指示し(S29)、アクセラレータ10が実行され、上記の処理を繰り返すことにより、プロファイルログファイルが生成されていく。
The profiling function of the application asks the run-time library to convert values that cannot be interpreted by the application among the read data. For example, the physical address is sent to the runtime library (S25), and the virtual address corresponding to the physical address is obtained from the runtime library (S26). Then, the profile function generates log data based on the obtained virtual address (S27), and writes the generated log data to the profile log file (S28). In this way, the execution status of the
マルチコア環境のアクセラレータをプロファイリングする方法として有用である。 It is useful as a method for profiling accelerators in multi-core environments.
1・・・SoC、10・・・アクセラレータ、20・・・イベントハンドラ、
21・・・ホストCPU、22・・・ROM、23・・・RAM、
24・・・外部インターフェイス、25・・・システムバス
1... SoC, 10... accelerator, 20... event handler,
21... Host CPU, 22... ROM, 23... RAM,
24: external interface, 25: system bus
Claims (3)
前記実行プログラムを、ホストCPUとアクセラレータとを有する実行環境(実行環境は、前記開発環境とは異なる環境)にインポートすると共に、前記開発環境と前記実行環境との違いを吸収するランタイムライブラリに環境間の変換情報を記憶するステップ(S11)と、
前記実行環境において、前記ホストCPU上で実行されるアプリケーションから前記ランタイムライブラリを介して前記アクセラレータ上にて実行プログラムの処理を実行させるステップ(S12)と、
前記アプリケーションが前記ランタイムライブラリを経由して、実行中のアクセラレータの状態(ステータス)を取得するステップ(S13)と、
前記アプリケーションが前記ステータスの少なくとも一部をログファイルに書き込むステップ(S14)と、
を備えるプロファイリング方法。 a step of exporting, from a computer in a development environment, an execution program for an accelerator compiled by the computer (S10);
importing the execution program into an execution environment having a host CPU and an accelerator (the execution environment is an environment different from the development environment); a step (S11) of storing the conversion information of
a step of causing an application executed on the host CPU to execute processing of an execution program on the accelerator via the runtime library in the execution environment (S12);
a step (S13) in which the application acquires the state (status) of the accelerator being executed via the runtime library;
said application writing (S14) at least part of said status to a log file;
A profiling method comprising:
前記アプリケーションが前記ランタイムライブラリにより変換された情報を前記ログファイルに書き込むステップと、
を備える請求項1に記載のプロファイリング方法。 If the accelerator information obtained by the application is information that cannot be interpreted by the application, converting it into information that can be interpreted by the application via the runtime library;
the application writing information translated by the runtime library to the log file;
The profiling method of claim 1, comprising:
前記アプリケーションが前記論理アドレスを前記ログファイルに書き込むステップと、
を備える請求項2に記載のプロファイリング方法。 If the accelerator information obtained by the application is a physical address and the physical address becomes information that cannot be interpreted by the application, converting it into a logical address that can be interpreted by the application via the runtime library;
said application writing said logical address to said log file;
3. The profiling method of claim 2, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019063934A JP7324027B2 (en) | 2019-03-28 | 2019-03-28 | Profiling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019063934A JP7324027B2 (en) | 2019-03-28 | 2019-03-28 | Profiling method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020166351A JP2020166351A (en) | 2020-10-08 |
JP7324027B2 true JP7324027B2 (en) | 2023-08-09 |
Family
ID=72716105
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019063934A Active JP7324027B2 (en) | 2019-03-28 | 2019-03-28 | Profiling method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7324027B2 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002014841A (en) | 2000-06-30 | 2002-01-18 | Esol Co Ltd | Debugger kernel system |
JP2013122740A (en) | 2011-12-12 | 2013-06-20 | Fujitsu Ltd | Data processing device, conversion device, data processing system, conversion method, and conversion program |
US20180373514A1 (en) | 2017-06-22 | 2018-12-27 | Microsoft Technology Licensing, Llc | Application binary interface cross compilation |
US20190034316A1 (en) | 2017-11-08 | 2019-01-31 | Intel Corporation | Methods and apparatus to perform instruction-level graphics processing unit (gpu) profiling based on binary instrumentation |
-
2019
- 2019-03-28 JP JP2019063934A patent/JP7324027B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002014841A (en) | 2000-06-30 | 2002-01-18 | Esol Co Ltd | Debugger kernel system |
JP2013122740A (en) | 2011-12-12 | 2013-06-20 | Fujitsu Ltd | Data processing device, conversion device, data processing system, conversion method, and conversion program |
US20180373514A1 (en) | 2017-06-22 | 2018-12-27 | Microsoft Technology Licensing, Llc | Application binary interface cross compilation |
US20190034316A1 (en) | 2017-11-08 | 2019-01-31 | Intel Corporation | Methods and apparatus to perform instruction-level graphics processing unit (gpu) profiling based on binary instrumentation |
Also Published As
Publication number | Publication date |
---|---|
JP2020166351A (en) | 2020-10-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7856618B2 (en) | Adaptively generating code for a computer program | |
US20070033592A1 (en) | Method, apparatus, and computer program product for adaptive process dispatch in a computer system having a plurality of processors | |
JP4994580B2 (en) | System and method for using tagged types in a dynamic runtime environment | |
KR20130111220A (en) | Distributing and parallelizing workloads in a computing platform | |
US9378008B2 (en) | Method and system for creating, applying, and removing a software fix | |
US9495136B2 (en) | Using aliasing information for dynamic binary optimization | |
US20030041312A1 (en) | Program processing method utilizing dynamically reconfigurable hardware to enable faster processing, and program to execute same processing method | |
EP3180734A1 (en) | Restrictive access control for modular reflection | |
KR20050075647A (en) | Method for improving performance of java virtual machine and system employing the method | |
US8752056B2 (en) | Running native code across single or multi-core hybrid processor achitecture | |
KR20160003485A (en) | Automatic code generation for remote procedure call | |
US10198544B2 (en) | Method for improving OpenCL hardware execution efficiency | |
TWI508024B (en) | System and method for launching callable functions | |
Noack et al. | Heterogeneous active messages for offloading on the NEC SX-Aurora TSUBASA | |
US10496433B2 (en) | Modification of context saving functions | |
JP7324027B2 (en) | Profiling method | |
KR20060035077A (en) | Data processing device and register allocation method using data processing device | |
KR101083271B1 (en) | System and method for converting active x control | |
Abramov et al. | OpenTS: an outline of dynamic parallelization approach | |
US8572585B2 (en) | Using compiler-generated tasks to represent programming elements | |
Chen et al. | Design and implementation of high-level compute on Android systems | |
KR20070088160A (en) | Method for invoking inlined method and java virtual machine using the same | |
JP2007226589A (en) | Program conversion system | |
CN114072762A (en) | Compiling and executing source code into a service | |
US20110099534A1 (en) | Information processing apparatus, execution program operation modification method, and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211215 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20221019 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20221129 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230118 |
|
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: 20230512 |
|
R155 | Notification before disposition of declining of application |
Free format text: JAPANESE INTERMEDIATE CODE: R155 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230728 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7324027 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313115 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |