{"id":393,"date":"2024-10-27T11:51:57","date_gmt":"2024-10-27T11:51:57","guid":{"rendered":"https:\/\/hpcwithus.discoverer.bg\/?p=393"},"modified":"2024-10-27T11:58:22","modified_gmt":"2024-10-27T11:58:22","slug":"python-3-13-0-built-with-llvm-19-and-full-lto","status":"publish","type":"post","link":"https:\/\/hpcwithus.discoverer.bg\/?p=393","title":{"rendered":"Python 3.13.0 built with LLVM 19 and full LTO"},"content":{"rendered":"\n<p><strong>Finally! <\/strong>We managed to compile the code of <a href=\"https:\/\/www.python.org\/downloads\/\" data-type=\"link\" data-id=\"https:\/\/www.python.org\/downloads\/\">Python 3.13.0<\/a> using <a href=\"https:\/\/gitlab.discoverer.bg\/vkolev\/recipes\/-\/tree\/main\/llvm\/19\" data-type=\"link\" data-id=\"https:\/\/gitlab.discoverer.bg\/vkolev\/recipes\/-\/tree\/main\/llvm\/19\">LLVM 19<\/a>, with full <a href=\"https:\/\/llvm.org\/docs\/LinkTimeOptimization.html\" data-type=\"link\" data-id=\"https:\/\/llvm.org\/docs\/LinkTimeOptimization.html\">link-time optimization (LTO)<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"565\" height=\"126\" src=\"https:\/\/hpcwithus.discoverer.bg\/wp-content\/uploads\/2024\/10\/photo_2024-10-27_13-53-14.jpg\" alt=\"\" class=\"wp-image-395\" srcset=\"https:\/\/hpcwithus.discoverer.bg\/wp-content\/uploads\/2024\/10\/photo_2024-10-27_13-53-14.jpg 565w, https:\/\/hpcwithus.discoverer.bg\/wp-content\/uploads\/2024\/10\/photo_2024-10-27_13-53-14-300x67.jpg 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/figure>\n\n\n\n<p>The installation passes all 44 standard optimization tests:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Using random seed: 434731684<br>0:00:00 load avg: 1.72 Run 44 tests sequentially in a single process<br>0:00:00 load avg: 1.72 [ 1\/44] test_array<br>0:00:00 load avg: 1.72 [ 2\/44] test_base64<br>0:00:00 load avg: 1.72 [ 3\/44] test_binascii<br>0:00:00 load avg: 1.72 [ 4\/44] test_binop<br>0:00:00 load avg: 1.72 [ 5\/44] test_bisect<br>0:00:00 load avg: 1.72 [ 6\/44] test_bytes<br>0:00:03 load avg: 1.67 [ 7\/44] test_bz2<br>0:00:04 load avg: 1.67 [ 8\/44] test_cmath<br>0:00:04 load avg: 1.67 [ 9\/44] test_codecs<br>0:00:05 load avg: 1.67 [10\/44] test_collections<br>0:00:06 load avg: 1.67 [11\/44] test_complex<br>0:00:06 load avg: 1.67 [12\/44] test_dataclasses<br>0:00:07 load avg: 1.67 [13\/44] test_datetime<br>0:00:11 load avg: 1.61 [14\/44] test_decimal<br>0:00:14 load avg: 1.56 [15\/44] test_difflib<br>0:00:15 load avg: 1.56 [16\/44] test_embed<br>0:00:19 load avg: 1.52 [17\/44] test_float<br>0:00:20 load avg: 1.52 [18\/44] test_fstring<br>0:00:21 load avg: 1.52 [19\/44] test_functools<br>0:00:21 load avg: 1.52 [20\/44] test_generators<br>0:00:22 load avg: 1.52 [21\/44] test_hashlib<br>0:00:22 load avg: 1.52 [22\/44] test_heapq<br>0:00:23 load avg: 1.52 [23\/44] test_int<br>0:00:24 load avg: 1.48 [24\/44] test_itertools<br>0:00:26 load avg: 1.48 [25\/44] test_json<br>0:00:29 load avg: 1.44 [26\/44] test_long<br>0:00:31 load avg: 1.44 [27\/44] test_lzma<br>0:00:31 load avg: 1.44 [28\/44] test_math<br>0:00:33 load avg: 1.40 [29\/44] test_memoryview<br>0:00:33 load avg: 1.40 [30\/44] test_operator<br>0:00:34 load avg: 1.40 [31\/44] test_ordered_dict<br>0:00:34 load avg: 1.40 [32\/44] test_patma<br>0:00:35 load avg: 1.40 [33\/44] test_pickle<br>0:00:39 load avg: 1.37 [34\/44] test_pprint<br>0:00:39 load avg: 1.37 [35\/44] test_re<br>0:00:40 load avg: 1.37 [36\/44] test_set<br>0:00:44 load avg: 1.34 [37\/44] test_sqlite3<br>0:00:44 load avg: 1.34 [38\/44] test_statistics<br>0:00:49 load avg: 1.31 [39\/44] test_str<br>0:00:51 load avg: 1.31 [40\/44] test_struct<br>0:00:51 load avg: 1.31 [41\/44] test_tabnanny<br>0:00:52 load avg: 1.31 [42\/44] test_time<br>0:00:54 load avg: 1.21 [43\/44] test_xml_etree<br>0:00:54 load avg: 1.21 [44\/44] test_xml_etree_c<br><br>Total duration: 55.7 sec<br>Total tests: run=9,361 skipped=192<br>Total test files: run=44\/44<br>Result: SUCCESS<\/code><br><\/pre>\n\n\n\n<p>Before, such results were impossible to achieve, see this bug report for details:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/python\/cpython\/issues\/110313\">https:\/\/github.com\/python\/cpython\/issues\/110313<\/a><\/p>\n\n\n\n<p>The installation is available in the software repository of the <a href=\"https:\/\/discoverer.bg\" data-type=\"link\" data-id=\"https:\/\/discoverer.bg\">Discoverer Petascale Supercomputer<\/a>. As usual, the build recipe and the logs collected during the compilation and publicly available online at:<\/p>\n\n\n\n<p><a href=\"https:\/\/gitlab.discoverer.bg\/vkolev\/recipes\/-\/tree\/main\/python\/3\/3.13\">https:\/\/gitlab.discoverer.bg\/vkolev\/recipes\/-\/tree\/main\/python\/3\/3.1<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally! We managed to compile the code of Python 3.13.0 using LLVM 19, with full link-time optimization (LTO): The installation passes all 44 standard optimization tests: Using random seed: 4347316840:00:00 load avg: 1.72 Run 44 tests sequentially in a single process0:00:00 load avg: 1.72 [ 1\/44] test_array0:00:00 load avg: 1.72 [ 2\/44] test_base640:00:00 load avg: 1.72 [ 3\/44] test_binascii0:00:00 load avg: 1.72 [ 4\/44] test_binop0:00:00 load avg: 1.72 [ 5\/44] test_bisect0:00:00 load avg: 1.72 [ 6\/44] test_bytes0:00:03 load avg: 1.67&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/hpcwithus.discoverer.bg\/?p=393\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[28],"tags":[13,103,82],"class_list":["post-393","post","type-post","status-publish","format-standard","hentry","category-compilers","tag-llvm","tag-lto","tag-python"],"_links":{"self":[{"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/posts\/393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393"}],"version-history":[{"count":5,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions"}],"predecessor-version":[{"id":400,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions\/400"}],"wp:attachment":[{"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hpcwithus.discoverer.bg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}