<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">mais</journal-id><journal-title-group><journal-title xml:lang="ru">Моделирование и анализ информационных систем</journal-title><trans-title-group xml:lang="en"><trans-title>Modeling and Analysis of Information Systems</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-1015</issn><issn pub-type="epub">2313-5417</issn><publisher><publisher-name>Yaroslavl State University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.18255/1818-1015-2021-4-338-355</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-1564</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Theory of Computing</subject></subj-group></article-categories><title-group><article-title>Подход к автонастройке параллельных программ методом проверки моделей</article-title><trans-title-group xml:lang="en"><trans-title>Autotuning Parallel Programs by Model Checking</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0001-9734-3808</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Гаранина</surname><given-names>Наталья Олеговна</given-names></name><name name-style="western" xml:lang="en"><surname>Garanina</surname><given-names>Natalia Olegovna</given-names></name></name-alternatives><email xlink:type="simple">garanina@iis.nsk.su</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0003-3857-9380</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Горлач</surname><given-names>Сергей Петрович</given-names></name><name name-style="western" xml:lang="en"><surname>Gorlatch</surname><given-names>Sergei Petrovich</given-names></name></name-alternatives><email xlink:type="simple">gorlatch@uni-muenster.de</email><xref ref-type="aff" rid="aff-2"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Институт систем информатики имени А. П. Ершова СО РАН;Институт автоматики и электрометрии СО РАН</institution><country>Россия</country></aff><aff xml:lang="en"><institution>A.P. Ershov Institute of Informatics Systems (IIS), Siberian Branch of the Russian Academy of Sciences;Institute of Automation and Electrometry SB RAS</institution><country>Russian Federation</country></aff></aff-alternatives><aff-alternatives id="aff-2"><aff xml:lang="ru"><institution>Университет Мюнстера</institution><country>Россия</country></aff><aff xml:lang="en"><institution>University of Munster</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2021</year></pub-date><pub-date pub-type="epub"><day>18</day><month>12</month><year>2021</year></pub-date><volume>28</volume><issue>4</issue><fpage>338</fpage><lpage>355</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Гаранина Н.О., Горлач С.П., 2021</copyright-statement><copyright-year>2021</copyright-year><copyright-holder xml:lang="ru">Гаранина Н.О., Горлач С.П.</copyright-holder><copyright-holder xml:lang="en">Garanina N.O., Gorlatch S.P.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.mais-journal.ru/jour/article/view/1564">https://www.mais-journal.ru/jour/article/view/1564</self-uri><abstract><p>В этой статье представлен новый подход к автонастройке программ, параллельных по данным. Автонастройка -- это поиск оптимальных параметров настройки программы, при которых её производительность оказывается максимальной. Новизна подхода состоит в использовании метода проверки моделей для поиска оптимальных параметров настройки методом контрпримеров. В нашей работе мы абстрагируемся от конкретных программ и конкретных процессоров, задавая их представительные абстрактные шаблоны. Наш метод контрпримеров состоит в реализации следующих четырёх шагов. На первом шаге на языке инструмента проверки моделей задаётся модель исполнения абстрактной программы на абстрактном процессоре. На втором шаге на языке инструмента проверки моделей формулируем свойство оптимальности, зависящее от построенной модели. На третьем шаге подбираем оптимальные значения параметров настройки посредством использования контрпримеров, построенных в ходе верификации свойства оптимальности. На четвёртом шаге извлекаем информацию о параметрах настройки из контрпримера для оптимальных параметров. Мы применяем этот подход к автонастройке параллельных программ, написанных на языке OpenCL -- современном популярном языке, который расширяет язык C для программирования как обычных многоядерных процессоров (CPU), так и массивно-параллельных графических процессоров (GPU). В качестве инструмента верификации мы используем верификатор SPIN и его язык представления моделей Promela, формальная семантика которого позволяет моделировать исполнение параллельных программ на процессорах с различной архитектурой.</p></abstract><trans-abstract xml:lang="en"><p>The paper presents a new approach to autotuning data-parallel programs. Autotuning is a search for optimal program settings which maximize its performance. The novelty of the approach lies in the use of the model checking method to find the optimal tuning parameters by the method of counterexamples. In our work, we abstract from specific programs and specific processors by defining their representative abstract patterns. Our method of counterexamples implements the following four steps. At the first step, an execution model of an abstract program on an abstract processor is described in the language of a model checking tool. At the second step, in the language of the model checking tool, we formulate the optimality property that depends on the constructed model. At the third step, we find the optimal values of the tuning parameters by using a counterexample constructed during the verification of the optimality property. In the fourth step, we extract the information about the tuning parameters from the counter-example for the optimal parameters. We apply this approach to autotuning parallel programs written in OpenCL, a popular modern language that extends the C language for programming both standard multi-core processors (CPUs) and massively parallel graphics processing units (GPUs). As a verification tool, we use the SPIN verifier and its model representation language Promela, whose formal semantics is good for modelling the execution of parallel programs on processors with different architectures.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>задача оптимизации</kwd><kwd>автонастройка параллельных программ</kwd><kwd>параллельные программы</kwd><kwd>программирование GPU</kwd><kwd>проверка моделей</kwd><kwd>контрпримеры</kwd><kwd>OpenCL</kwd><kwd>SPIN</kwd><kwd>Promela</kwd></kwd-group><kwd-group xml:lang="en"><kwd>optimization problem</kwd><kwd>auto-tuning of parallel programs</kwd><kwd>parallel programs</kwd><kwd>GPU programming</kwd><kwd>model checking</kwd><kwd>counterexamples</kwd><kwd>OpenCL</kwd><kwd>SPIN</kwd><kwd>Promela</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">J. Ansel, S. Kamil, K. Veeramachaneni, and et al., “OpenTuner: An extensible framework for program autotuning,” in Proceedings of the 23rd international conference on Parallel architectures and compilation, 2014, pp. 303-316.</mixed-citation><mixed-citation xml:lang="en">J. Ansel, S. Kamil, K. Veeramachaneni, and et al., “OpenTuner: An extensible framework for program autotuning,” in Proceedings of the 23rd international conference on Parallel architectures and compilation, 2014, pp. 303-316.</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">J. Beckingsale, O. Pearce, I. Laguna, and T. Gamblin, “Apollo: Reusable models for fast, dynamic tuning of input-dependent code,” 2017.</mixed-citation><mixed-citation xml:lang="en">J. Beckingsale, O. Pearce, I. Laguna, and T. Gamblin, “Apollo: Reusable models for fast, dynamic tuning of input-dependent code,” 2017.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">C. Chen, J. Chame, and M. Hall, “CHILL: A framework for composing high-level loop transformations,” Technical Report 08-897. Los Angeles, CA, pp. 136-150, 2008.</mixed-citation><mixed-citation xml:lang="en">C. Chen, J. Chame, and M. Hall, “CHILL: A framework for composing high-level loop transformations,” Technical Report 08-897. Los Angeles, CA, pp. 136-150, 2008.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">M. Christen, O. Schenk, and H. Burkhart, “PATUS: A code generation and autotuning framework for parallel iterative stencil computations on modern microarchitectures,” 2011.</mixed-citation><mixed-citation xml:lang="en">M. Christen, O. Schenk, and H. Burkhart, “PATUS: A code generation and autotuning framework for parallel iterative stencil computations on modern microarchitectures,” 2011.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">R. C. Whaley and J. J. Dongarra, “Automatically tuned linear algebra software,” 1998.</mixed-citation><mixed-citation xml:lang="en">R. C. Whaley and J. J. Dongarra, “Automatically tuned linear algebra software,” 1998.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">M. Frigo and S. G. Johnson, “The design and implementation of FFTW3,” IEEE, vol. 93(2), 2005.</mixed-citation><mixed-citation xml:lang="en">M. Frigo and S. G. Johnson, “The design and implementation of FFTW3,” IEEE, vol. 93(2), 2005.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">G. Fursin, Y. Kashnikov, A. W. Memon, and et al., “Milepost GCC: machine learning enabled self-tuning compiler,” Int J Parallel Prog, vol. 39(3), pp. 296-327, 2011.</mixed-citation><mixed-citation xml:lang="en">G. Fursin, Y. Kashnikov, A. W. Memon, and et al., “Milepost GCC: machine learning enabled self-tuning compiler,” Int J Parallel Prog, vol. 39(3), pp. 296-327, 2011.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">C. Nugteren and V. Codreanu, “CLTUne: A generic auto-tuner for OpenCL kernels,” 2015.</mixed-citation><mixed-citation xml:lang="en">C. Nugteren and V. Codreanu, “CLTUne: A generic auto-tuner for OpenCL kernels,” 2015.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">A. Rasch and S. Gorlatch, “ATF: A Generic, Directive-Based Auto-Tuning Framework,” Concurrency and Computation: Practice and Experience, vol. 31(5), 2018.</mixed-citation><mixed-citation xml:lang="en">A. Rasch and S. Gorlatch, “ATF: A Generic, Directive-Based Auto-Tuning Framework,” Concurrency and Computation: Practice and Experience, vol. 31(5), 2018.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">C. Tapus, I. H. Chung, and J. K. Hollingsworth, “Active harmony: towards automated performance tuning,” 2002.</mixed-citation><mixed-citation xml:lang="en">C. Tapus, I. H. Chung, and J. K. Hollingsworth, “Active harmony: towards automated performance tuning,” 2002.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">R. Vuduc, J. W. Demmel, and K. A. Yelick, “OSKI: A library of automatically tuned sparse matrix kernels,” 2005.</mixed-citation><mixed-citation xml:lang="en">R. Vuduc, J. W. Demmel, and K. A. Yelick, “OSKI: A library of automatically tuned sparse matrix kernels,” 2005.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">E. M. Clarke, T. A. Henzinger, H. Veith, and R. Bloem, Handbook of Model Checking. Springer International Publishing, 2018, pp. 1-13.</mixed-citation><mixed-citation xml:lang="en">E. M. Clarke, T. A. Henzinger, H. Veith, and R. Bloem, Handbook of Model Checking. Springer International Publishing, 2018, pp. 1-13.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">T. C. Ruys and E. Brinksma, “Experience with Literate Programming in the Modelling and Validation of Systems,” in Proc. of the 4th Int. Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’98), 1998, pp. 393-408.</mixed-citation><mixed-citation xml:lang="en">T. C. Ruys and E. Brinksma, “Experience with Literate Programming in the Modelling and Validation of Systems,” in Proc. of the 4th Int. Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’98), 1998, pp. 393-408.</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">T. C. Ruys, “Optimal Scheduling Using Branch and Bound with SPIN 4.0,” 2003.</mixed-citation><mixed-citation xml:lang="en">T. C. Ruys, “Optimal Scheduling Using Branch and Bound with SPIN 4.0,” 2003.</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">E. Brinksma, A. Mader, and A. Fehnker, “Verification and optimization of a PLC control schedule,” International Journal on Software Tools for Technology Transfer, vol. 4, pp. 21-33, 2002.</mixed-citation><mixed-citation xml:lang="en">E. Brinksma, A. Mader, and A. Fehnker, “Verification and optimization of a PLC control schedule,” International Journal on Software Tools for Technology Transfer, vol. 4, pp. 21-33, 2002.</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">A. Wijs, J. V. D. Pol, and E. M. Bortnik, “Solving scheduling problems by untimed model checking: The clinical chemical analyser case study.,” in Proceedings of the 10th international workshop on Formal methods for industrial critical systems, 2005, pp. 54-61.</mixed-citation><mixed-citation xml:lang="en">A. Wijs, J. V. D. Pol, and E. M. Bortnik, “Solving scheduling problems by untimed model checking: The clinical chemical analyser case study.,” in Proceedings of the 10th international workshop on Formal methods for industrial critical systems, 2005, pp. 54-61.</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">R. Malik and P. N. Pena, “Optimal Task Scheduling in a Flexible Manufacturing System using Model Checking,” IFAC-PapersOnLine, vol. 51, no. 7, pp. 230-235, 2018.</mixed-citation><mixed-citation xml:lang="en">R. Malik and P. N. Pena, “Optimal Task Scheduling in a Flexible Manufacturing System using Model Checking,” IFAC-PapersOnLine, vol. 51, no. 7, pp. 230-235, 2018.</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">K. O. C. L. working group, The OpenCL Specification. Khronos OpenCL working group, 2021.</mixed-citation><mixed-citation xml:lang="en">K. O. C. L. working group, The OpenCL Specification. Khronos OpenCL working group, 2021.</mixed-citation></citation-alternatives></ref><ref id="cit19"><label>19</label><citation-alternatives><mixed-citation xml:lang="ru">G. J. Holzmann, The SPIN Model Checker: Primer and Reference Manual. Addison-Wesley Professional, 2003.</mixed-citation><mixed-citation xml:lang="en">G. J. Holzmann, The SPIN Model Checker: Primer and Reference Manual. Addison-Wesley Professional, 2003.</mixed-citation></citation-alternatives></ref><ref id="cit20"><label>20</label><citation-alternatives><mixed-citation xml:lang="ru">C. A. R. Hoare, Communicating sequential processes. Prentice-Hall, 1985.</mixed-citation><mixed-citation xml:lang="en">C. A. R. Hoare, Communicating sequential processes. Prentice-Hall, 1985.</mixed-citation></citation-alternatives></ref><ref id="cit21"><label>21</label><citation-alternatives><mixed-citation xml:lang="ru">M. Gaspari and G. Zavattaro, “An Algebra of Actors,” 1999.</mixed-citation><mixed-citation xml:lang="en">M. Gaspari and G. Zavattaro, “An Algebra of Actors,” 1999.</mixed-citation></citation-alternatives></ref><ref id="cit22"><label>22</label><citation-alternatives><mixed-citation xml:lang="ru">A. Cimatti, S. Edelkamp, M. Fox, D. Magazzeni, and E. Plaku, “Automated Planning and Model Checking (Dagstuhl Seminar 14482),” Dagstuhl Reports, vol. 4, no. 11, pp. 227-245, 2015, doi: 10.4230/DagRep.4.11.227.</mixed-citation><mixed-citation xml:lang="en">A. Cimatti, S. Edelkamp, M. Fox, D. Magazzeni, and E. Plaku, “Automated Planning and Model Checking (Dagstuhl Seminar 14482),” Dagstuhl Reports, vol. 4, no. 11, pp. 227-245, 2015, doi: 10.4230/DagRep.4.11.227.</mixed-citation></citation-alternatives></ref><ref id="cit23"><label>23</label><citation-alternatives><mixed-citation xml:lang="ru">P. N. Glaskowsky, NVIDIA’s Fermi: The First Complete GPU Computing Architecture. NVIDIA Corporation, 2009.</mixed-citation><mixed-citation xml:lang="en">P. N. Glaskowsky, NVIDIA’s Fermi: The First Complete GPU Computing Architecture. NVIDIA Corporation, 2009.</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
