<div dir="ltr"><div>Hello Johannes,</div><div><br></div><div>I guess working on the loop transformations is a good starting point – firstly, it is similar to the already existing code, and secondly, this problem doesn't look way too hard (especially comparing with other ideas). To the best of my understanding, it corresponds to refactoring `LoopUnrollAnalyzer` and, if I understood you correctly, `MacroFusion`, in the similar way it has been done with the `InlineAdvisor`.</div><div><br></div><div>As for the next step, I think that knowledge distillation is a promising idea – in fact, we can experiment with the approaches from [1], which can yield a nice inference speed-up in those models.</div><div><br></div><div>I think working on some kind of unified pipeline for pass selection and ordering is also an interesting idea – off the top of my head, a viable approach here is to consider a pass scheduling as a single-player game and running a Monte-Carlo tree search to maximize some objective function. For example, in [2] this kind of approach is used for learning to solve vertex cover and max-cut, while [3] employs this approach for searching for the molecule design with the specified properties. See also [4] for a survey of RL methods (including MCTS) for combinatorial problems.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In case your interested in a runtime topic, I really would love to<br>have a predictor for grid/block/thread block size for (OpenMP) GPU<br>kernels. We are having real trouble on that end.</blockquote><div>I'm afraid I didn't quite understand this one – could you elaborate a bit more on this topic?</div><div><br></div><div>Best regards,</div><div>Konstantin Sidorov</div><div><br></div><div>[1] <a href="https://github.com/lhyfst/knowledge-distillation-papers#recommended-papers">https://github.com/lhyfst/knowledge-distillation-papers#recommended-papers</a></div><div>[2] Abe, Kenshin et al. Solving NP-Hard Problems on Graphs with Extended AlphaGo Zero. <a href="https://arxiv.org/abs/1905.11623">https://arxiv.org/abs/1905.11623</a></div><div>[3] Kajita, S., Kinjo, T. & Nishi, T. Autonomous molecular design by Monte-Carlo tree search and rapid evaluations using molecular dynamics simulations. Commun Phys 3, 77 (2020). <a href="https://doi.org/10.1038/s42005-020-0338-y">https://doi.org/10.1038/s42005-020-0338-y</a></div><div>[4] Mazyavkina, Nina et al. Reinforcement Learning for Combinatorial Optimization: A Survey. <a href="https://arxiv.org/abs/2003.03600">https://arxiv.org/abs/2003.03600</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">сб, 6 февр. 2021 г. в 23:28, Johannes Doerfert <<a href="mailto:johannesdoerfert@gmail.com">johannesdoerfert@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Konstantin,<br>
<br>
I didn't find the time to write new GSoC projects for 2021 yet but<br>
if you are interested we could probably set one up in this area. I<br>
also CC'ed Mircea who might be interested in this too, maybe as<br>
(co-)mentor.<br>
<br>
We could look at loop transformations such as unrolling and fusion,<br>
similar to the inliner work. Best case, we can distill a heuristic<br>
out of a model we learned. We could also  look at pass selection and<br>
ordering. We started last year and I was hoping to continue. You<br>
might want to watch <a href="https://youtu.be/TSMputNvHlk?t=617" rel="noreferrer" target="_blank">https://youtu.be/TSMputNvHlk?t=617</a> <br>
<<a href="https://youtu.be/TSMputNvHlk?t=617" rel="noreferrer" target="_blank">https://youtu.be/TSMputNvHlk?t=617</a>> and<br>
<a href="https://youtu.be/nxfew3hsMFM?t=1435" rel="noreferrer" target="_blank">https://youtu.be/nxfew3hsMFM?t=1435</a> <<a href="https://youtu.be/nxfew3hsMFM?t=1435" rel="noreferrer" target="_blank">https://youtu.be/nxfew3hsMFM?t=1435</a>> .<br>
<br>
In case your interested in a runtime topic, I really would love to<br>
have a predictor for grid/block/thread block size for (OpenMP) GPU<br>
kernels. We are having real trouble on that end.<br>
<br>
I also would like to look at ML use in testing and CI.<br>
<br>
Let me know what area sounds most interesting to you and we can<br>
take it from there.<br>
<br>
~ Johannes<br>
<br>
<br>
On 2/6/21 4:35 AM, Сидоров , Константин Сергеевич via llvm-dev wrote:<br>
> Dear all,<br>
><br>
> I would like to continue the discussion of the GSoC project I mentioned in<br>
> the previous email. Now, when I know my way around the LLVM codebase, I<br>
> would like to propose the first draft of the plan:<br>
><br>
> * Improving heuristics for existing passes – to start the discussion, I<br>
> propose to start the project by working on `MLInlineAdvisor` (as far as I<br>
> understand, in this class the ML infrastructure is already developed, and<br>
> thus it seems to be a good idea to start there) and after that switching to<br>
> the other passes (e.g., `LoopVectorizationPlanner` seems to be a good<br>
> candidate for such an approach, and `LoopRotate` class contains a<br>
> profitability heuristic which could also be studied deeper).<br>
> * Machine learning models to select the optimizations – to the best of my<br>
> understanding, the key concept here is the pass manager, but here I don't<br>
> quite understand the technical details of deciding which optimization to<br>
> select. For this reason, I would like to discuss this part more thoroughly.<br>
><br>
> If the project mentors are reading this mailing list and are interested in<br>
> the discussion, can we start the discussion here?<br>
><br>
> By the way – I would like to thank Stefanos for the comprehensive response<br>
> to my previous questions that helped me to get started :)<br>
><br>
> Looking forward to a further discussion,<br>
> Konstantin Sidorov<br>
><br>
> вт, 19 янв. 2021 г. в 07:04, Сидоров , Константин Сергеевич <<br>
> <a href="mailto:sidorov.ks@phystech.edu" target="_blank">sidorov.ks@phystech.edu</a>>:<br>
><br>
>> Dear all,<br>
>><br>
>> My name is Konstantin Sidorov, and I am a graduate student in Mathematics<br>
>> at Moscow Institute of Physics and Technology.<br>
>><br>
>> I would like to work on a project "Machine learning and compiler<br>
>> optimizations: using inter-procedural analysis to select optimizations"<br>
>> during the Google Summer of Code 2021.<br>
>><br>
>> I have an extensive background relevant to this project - in particular:<br>
>><br>
>> * I have already participated in GSoC before in 2017 with mlpack<br>
>> organization on the project "Augmented RNNs":<br>
>> <a href="https://summerofcode.withgoogle.com/archive/2017/projects/4583913502539776/" rel="noreferrer" target="_blank">https://summerofcode.withgoogle.com/archive/2017/projects/4583913502539776/</a><br>
>> * In 2019 I have graduated from the Yandex School of Data Analysis — a<br>
>> two-year program in Data Analysis by Yandex (the leading Russian search<br>
>> engine); more info on the curriculum could be also found at<br>
>> <a href="https://yandexdataschool.com/" rel="noreferrer" target="_blank">https://yandexdataschool.com/</a>.<br>
>> * I have also been working as a software engineer at Adeptik from July<br>
>> 2018 to date, where I have predominantly worked on projects on applied<br>
>> combinatorial optimization problems, such as vehicle-routing problems or<br>
>> supply chain modeling. In particular, I have had experience with both<br>
>> metaheuristic algorithms (e.g., local search or genetic algorithms) and<br>
>> more "traditional" mathematical modeling (e.g., linear programming or<br>
>> constraint programming).<br>
>><br>
>> I would like to discuss this project in more detail. While it is hard to<br>
>> discuss any kind of exact plan at this stage, I already have two questions<br>
>> concerning this project:<br>
>><br>
>> (1) I have set up an LLVM dev environment, but I am unsure what to do<br>
>> next. Could you advise me on any simple (and, preferably, relevant) tasks<br>
>> to work on?<br>
>> (2) Could you suggest any learning materials to improve the understanding<br>
>> of "low-level" concepts? (E.g., CPU concepts such as caching and SIMD)<br>
>><br>
>> Best regards,<br>
>> Konstantin Sidorov<br>
>><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>