Clement Courbet via llvm-dev
2018-Dec-12 11:58 UTC
[llvm-dev] [RFC] Moving tools/llvm-mca/lib into lib/MCA
(on the correct mailing list) Hi all, tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and create a new MCA library in LLVM. llvm-mca has recently been split <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the tool part. - The core part simulates the execution of a basic block of machine instructions as modeled by the llvm SchedModel. - The tool part deals with the plumbing and interacting with the user. The core part can be used by parts of LLVM that deal with cost modeling (e.g. scheduling and vectorization). MCA provides a more realistic target for optimization than the heuristics typically used to drive these passes. We think that using approaches based on fine-grained cost modeling can greatly improve the performance of critically hot code, by trading compile time for performance. As an example of how MCA can be used to improve scheduling, we have built a prototype machine scheduler that optimizes the simulated latency of a block of code under the constraints of the scheduling DAG. We've had interesting wins of 2-3% on assembly kernels for webp <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. The patch is completely mechanical and can be seen here <https://reviews.llvm.org/D55557>. It only moves the files and updates all references. We'd like to hear if there are any things comments/objections to this change. Thanks ! *note: We did this before llvm-mca was released and were using a different simulator, but the idea remains the same. On Wed, Dec 12, 2018 at 11:44 AM Clement Courbet <courbet at google.com> wrote:> Hi all, > > tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and > create a new MCA library in LLVM. > > llvm-mca has recently been split > <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the > tool part. > > - > > The core part simulates the execution of a basic block of machine > instructions as modeled by the llvm SchedModel. > - > > The tool part deals with the plumbing and interacting with the user. > > > The core part can be used by parts of LLVM that deal with cost modeling > (e.g. scheduling and vectorization). MCA provides a more realistic target > for optimization than the heuristics typically used to drive these passes. > We think that using approaches based on fine-grained cost modeling can > greatly improve the performance of critically hot code, by trading compile > time for performance. > > As an example of how MCA can be used to improve scheduling, we have built > a prototype machine scheduler that optimizes the simulated latency of a > block of code under the constraints of the scheduling DAG. We've had > interesting wins of 2-3% on assembly kernels for webp > <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> > and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. > > The patch is completely mechanical and can be seen here > <https://reviews.llvm.org/D55557>. It only moves the files and updates > all references. > > We'd like to hear if there are any things comments/objections to this > change. > > Thanks ! > > *note: We did this before llvm-mca was released and were using a different > simulator, but the idea remains the same. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/1e36faa3/attachment.html>
Andrea Di Biagio via llvm-dev
2018-Dec-12 12:51 UTC
[llvm-dev] [RFC] Moving tools/llvm-mca/lib into lib/MCA
Thanks Clement for working on this. I like the idea of moving the core abstractions of llvm-mca in llvm/lib, as it potentially enables a number of interesting use cases and future developments. As you wrote, the patch is very simple (a pretty mechanical change).>From my point of view, this all looks good. Let see if other people havethe same opinion on this. -Andrea On Wed, Dec 12, 2018 at 11:58 AM Clement Courbet <courbet at google.com> wrote:> (on the correct mailing list) > > > Hi all, > > tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and > create a new MCA library in LLVM. > > llvm-mca has recently been split > <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the > tool part. > > - > > The core part simulates the execution of a basic block of machine > instructions as modeled by the llvm SchedModel. > - > > The tool part deals with the plumbing and interacting with the user. > > > The core part can be used by parts of LLVM that deal with cost modeling > (e.g. scheduling and vectorization). MCA provides a more realistic target > for optimization than the heuristics typically used to drive these passes. > We think that using approaches based on fine-grained cost modeling can > greatly improve the performance of critically hot code, by trading compile > time for performance. > > As an example of how MCA can be used to improve scheduling, we have built > a prototype machine scheduler that optimizes the simulated latency of a > block of code under the constraints of the scheduling DAG. We've had > interesting wins of 2-3% on assembly kernels for webp > <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> > and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. > > The patch is completely mechanical and can be seen here > <https://reviews.llvm.org/D55557>. It only moves the files and updates > all references. > > We'd like to hear if there are any things comments/objections to this > change. > > Thanks ! > > *note: We did this before llvm-mca was released and were using a different > simulator, but the idea remains the same. > > On Wed, Dec 12, 2018 at 11:44 AM Clement Courbet <courbet at google.com> > wrote: > >> Hi all, >> >> tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and >> create a new MCA library in LLVM. >> >> llvm-mca has recently been split >> <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the >> tool part. >> >> - >> >> The core part simulates the execution of a basic block of machine >> instructions as modeled by the llvm SchedModel. >> - >> >> The tool part deals with the plumbing and interacting with the user. >> >> >> The core part can be used by parts of LLVM that deal with cost modeling >> (e.g. scheduling and vectorization). MCA provides a more realistic target >> for optimization than the heuristics typically used to drive these passes. >> We think that using approaches based on fine-grained cost modeling can >> greatly improve the performance of critically hot code, by trading compile >> time for performance. >> >> As an example of how MCA can be used to improve scheduling, we have built >> a prototype machine scheduler that optimizes the simulated latency of a >> block of code under the constraints of the scheduling DAG. We've had >> interesting wins of 2-3% on assembly kernels for webp >> <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> >> and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. >> >> The patch is completely mechanical and can be seen here >> <https://reviews.llvm.org/D55557>. It only moves the files and updates >> all references. >> >> We'd like to hear if there are any things comments/objections to this >> change. >> >> Thanks ! >> >> *note: We did this before llvm-mca was released and were using a >> different simulator, but the idea remains the same. >> >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/03aba165/attachment-0001.html>
Greg Bedwell via llvm-dev
2018-Dec-12 14:13 UTC
[llvm-dev] [RFC] Moving tools/llvm-mca/lib into lib/MCA
Makes sense to me. Should CODE_OWNERS.TXT also be updated to reflect the move too? On Wed, 12 Dec 2018 at 12:52, Andrea Di Biagio <andrea.dibiagio at gmail.com> wrote:> Thanks Clement for working on this. > > I like the idea of moving the core abstractions of llvm-mca in llvm/lib, > as it potentially enables a number of interesting use cases and future > developments. > > As you wrote, the patch is very simple (a pretty mechanical change). > From my point of view, this all looks good. Let see if other people have > the same opinion on this. > > -Andrea > > > On Wed, Dec 12, 2018 at 11:58 AM Clement Courbet <courbet at google.com> > wrote: > >> (on the correct mailing list) >> >> >> Hi all, >> >> tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and >> create a new MCA library in LLVM. >> >> llvm-mca has recently been split >> <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the >> tool part. >> >> - >> >> The core part simulates the execution of a basic block of machine >> instructions as modeled by the llvm SchedModel. >> - >> >> The tool part deals with the plumbing and interacting with the user. >> >> >> The core part can be used by parts of LLVM that deal with cost modeling >> (e.g. scheduling and vectorization). MCA provides a more realistic target >> for optimization than the heuristics typically used to drive these passes. >> We think that using approaches based on fine-grained cost modeling can >> greatly improve the performance of critically hot code, by trading compile >> time for performance. >> >> As an example of how MCA can be used to improve scheduling, we have built >> a prototype machine scheduler that optimizes the simulated latency of a >> block of code under the constraints of the scheduling DAG. We've had >> interesting wins of 2-3% on assembly kernels for webp >> <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> >> and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. >> >> The patch is completely mechanical and can be seen here >> <https://reviews.llvm.org/D55557>. It only moves the files and updates >> all references. >> >> We'd like to hear if there are any things comments/objections to this >> change. >> >> Thanks ! >> >> *note: We did this before llvm-mca was released and were using a >> different simulator, but the idea remains the same. >> >> On Wed, Dec 12, 2018 at 11:44 AM Clement Courbet <courbet at google.com> >> wrote: >> >>> Hi all, >>> >>> tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and >>> create a new MCA library in LLVM. >>> >>> llvm-mca has recently been split >>> <https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and >>> the tool part. >>> >>> - >>> >>> The core part simulates the execution of a basic block of machine >>> instructions as modeled by the llvm SchedModel. >>> - >>> >>> The tool part deals with the plumbing and interacting with the user. >>> >>> >>> The core part can be used by parts of LLVM that deal with cost modeling >>> (e.g. scheduling and vectorization). MCA provides a more realistic target >>> for optimization than the heuristics typically used to drive these passes. >>> We think that using approaches based on fine-grained cost modeling can >>> greatly improve the performance of critically hot code, by trading compile >>> time for performance. >>> >>> As an example of how MCA can be used to improve scheduling, we have >>> built a prototype machine scheduler that optimizes the simulated latency of >>> a block of code under the constraints of the scheduling DAG. We've had >>> interesting wins of 2-3% on assembly kernels for webp >>> <https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> >>> and gemmlowp <https://github.com/google/gemmlowp/pull/91>*. >>> >>> The patch is completely mechanical and can be seen here >>> <https://reviews.llvm.org/D55557>. It only moves the files and updates >>> all references. >>> >>> We'd like to hear if there are any things comments/objections to this >>> change. >>> >>> Thanks ! >>> >>> *note: We did this before llvm-mca was released and were using a >>> different simulator, but the idea remains the same. >>> >>>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/21274976/attachment.html>
Finkel, Hal J. via llvm-dev
2018-Dec-12 15:58 UTC
[llvm-dev] [RFC] Moving tools/llvm-mca/lib into lib/MCA
On 12/12/18 6:51 AM, Andrea Di Biagio via llvm-dev wrote: Thanks Clement for working on this. I like the idea of moving the core abstractions of llvm-mca in llvm/lib, as it potentially enables a number of interesting use cases and future developments. As you wrote, the patch is very simple (a pretty mechanical change). From my point of view, this all looks good. Let see if other people have the same opinion on this. +1 -Hal -Andrea On Wed, Dec 12, 2018 at 11:58 AM Clement Courbet <courbet at google.com<mailto:courbet at google.com>> wrote: (on the correct mailing list) Hi all, tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and create a new MCA library in LLVM. llvm-mca has recently been split<https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the tool part. * The core part simulates the execution of a basic block of machine instructions as modeled by the llvm SchedModel. * The tool part deals with the plumbing and interacting with the user. The core part can be used by parts of LLVM that deal with cost modeling (e.g. scheduling and vectorization). MCA provides a more realistic target for optimization than the heuristics typically used to drive these passes. We think that using approaches based on fine-grained cost modeling can greatly improve the performance of critically hot code, by trading compile time for performance. As an example of how MCA can be used to improve scheduling, we have built a prototype machine scheduler that optimizes the simulated latency of a block of code under the constraints of the scheduling DAG. We've had interesting wins of 2-3% on assembly kernels for webp<https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> and gemmlowp<https://github.com/google/gemmlowp/pull/91>*. The patch is completely mechanical and can be seen here<https://reviews.llvm.org/D55557>. It only moves the files and updates all references. We'd like to hear if there are any things comments/objections to this change. Thanks ! *note: We did this before llvm-mca was released and were using a different simulator, but the idea remains the same. On Wed, Dec 12, 2018 at 11:44 AM Clement Courbet <courbet at google.com<mailto:courbet at google.com>> wrote: Hi all, tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA and create a new MCA library in LLVM. llvm-mca has recently been split<https://bugs.llvm.org/show_bug.cgi?id=37696> into its core part and the tool part. * The core part simulates the execution of a basic block of machine instructions as modeled by the llvm SchedModel. * The tool part deals with the plumbing and interacting with the user. The core part can be used by parts of LLVM that deal with cost modeling (e.g. scheduling and vectorization). MCA provides a more realistic target for optimization than the heuristics typically used to drive these passes. We think that using approaches based on fine-grained cost modeling can greatly improve the performance of critically hot code, by trading compile time for performance. As an example of how MCA can be used to improve scheduling, we have built a prototype machine scheduler that optimizes the simulated latency of a block of code under the constraints of the scheduling DAG. We've had interesting wins of 2-3% on assembly kernels for webp<https://github.com/webmproject/libwebp/commit/67748b41dbb21a43e88f2b6ddf6117f4338873a3> and gemmlowp<https://github.com/google/gemmlowp/pull/91>*. The patch is completely mechanical and can be seen here<https://reviews.llvm.org/D55557>. It only moves the files and updates all references. We'd like to hear if there are any things comments/objections to this change. Thanks ! *note: We did this before llvm-mca was released and were using a different simulator, but the idea remains the same. _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/60bb512c/attachment-0001.html>
David Greene via llvm-dev
2018-Dec-12 21:37 UTC
[llvm-dev] [RFC] Moving tools/llvm-mca/lib into lib/MCA
+1. Great work! -David Andrea Di Biagio via llvm-dev <llvm-dev at lists.llvm.org> writes:> Thanks Clement for working on this. > > I like the idea of moving the core abstractions of llvm-mca in > llvm/lib, as it potentially enables a number of interesting use cases > and future developments. > > As you wrote, the patch is very simple (a pretty mechanical change). > From my point of view, this all looks good. Let see if other people > have the same opinion on this. > > -Andrea > > On Wed, Dec 12, 2018 at 11:58 AM Clement Courbet <courbet at google.com> > wrote: > > (on the correct mailing list) > > > Hi all, > > tl;dr: We'd like to propose moving tools/llvm-mca/lib into lib/MCA > and create a new MCA library in LLVM. > > llvm-mca has recently been split into its core part and the tool > part. > > * The core part simulates the execution of a basic block of > machine instructions as modeled by the llvm SchedModel. > > * The tool part deals with the plumbing and interacting with > the user. > > The core part can be used by parts of LLVM that deal with cost > modeling (e.g. scheduling and vectorization). MCA provides a more > realistic target for optimization than the heuristics typically > used to drive these passes. We think that using approaches based > on fine-grained cost modeling can greatly improve the performance > of critically hot code, by trading compile time for performance. > > As an example of how MCA can be used to improve scheduling, we > have built a prototype machine scheduler that optimizes the > simulated latency of a block of code under the constraints of the > scheduling DAG. We've had interesting wins of 2-3% on assembly > kernels for webp and gemmlowp*. > > The patch is completely mechanical and can be seen here. It only > moves the files and updates all references. > > We'd like to hear if there are any things comments/objections to > this change. > > Thanks ! > > *note: We did this before llvm-mca was released and were using a > different simulator, but the idea remains the same. > > > On Wed, Dec 12, 2018 at 11:44 AM Clement Courbet > <courbet at google.com> wrote: > > > Hi all, > > tl;dr: We'd like to propose moving tools/llvm-mca/lib into > lib/MCA and create a new MCA library in LLVM. > > llvm-mca has recently been split into its core part and the > tool part. > > * The core part simulates the execution of a basic > block of machine instructions as modeled by the llvm > SchedModel. > > * The tool part deals with the plumbing and > interacting with the user. > > The core part can be used by parts of LLVM that deal with cost > modeling (e.g. scheduling and vectorization). MCA provides a > more realistic target for optimization than the heuristics > typically used to drive these passes. We think that using > approaches based on fine-grained cost modeling can greatly > improve the performance of critically hot code, by trading > compile time for performance. > > As an example of how MCA can be used to improve scheduling, we > have built a prototype machine scheduler that optimizes the > simulated latency of a block of code under the constraints of > the scheduling DAG. We've had interesting wins of 2-3% on > assembly kernels for webp and gemmlowp*. > > The patch is completely mechanical and can be seen here. It > only moves the files and updates all references. > > We'd like to hear if there are any things comments/objections > to this change. > > Thanks ! > > *note: We did this before llvm-mca was released and were using > a different simulator, but the idea remains the same. > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Seemingly Similar Threads
- [RFC][llvm-mca] Adding binary support to llvm-mca.
- [RFC] llvm-exegesis: Automatic Measurement of Instruction Latency/Uops
- [RFC][llvm-mca] Adding binary support to llvm-mca.
- [RFC] llvm-exegesis: Automatic Measurement of Instruction Latency/Uops
- [RFC] llvm-mca: a static performance analysis tool