<div dir="ltr">I forgot to include an update on this: A month ago, Tom and I discussed on Discord and thought that it would be fine to implement this support in the monorepo with GitHub Actions (vs in a new repo).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 7, 2021 at 6:08 PM Stella Laurenzo <<a href="mailto:stellaraccident@gmail.com">stellaraccident@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 7, 2021 at 5:05 PM Tom Stellard <<a href="mailto:tstellar@redhat.com" target="_blank">tstellar@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/7/21 3:17 PM, Stella Laurenzo wrote:<br>
> <br>
> <br>
> On Thu, Jan 7, 2021 at 2:40 PM Tom Stellard <<a href="mailto:tstellar@redhat.com" target="_blank">tstellar@redhat.com</a> <br>
> <mailto:<a href="mailto:tstellar@redhat.com" target="_blank">tstellar@redhat.com</a>>> wrote:<br>
> <br>
>     On 1/7/21 10:55 AM, Stella Laurenzo via llvm-dev wrote:<br>
>      > Hi folks, I would like to propose that we create a new top-level<br>
>     repo in<br>
>      > the LLVM organization for organizing the Python MLIR Releases (both<br>
>      > daily and official numbered releases, whenever we are ready for<br>
>     such a<br>
>      > thing) and corresponding pushes to package repositories, etc.<br>
>      ><br>
> <br>
>     For those of use that are unfamiliar, can you explain what the "Python<br>
>     MLIR Releases" are?<br>
> <br>
> <br>
> Sure: They are the python wheels and source distributions for the [MLIR <br>
> Python Bindings](<a href="https://mlir.llvm.org/docs/Bindings/Python/" rel="noreferrer" target="_blank">https://mlir.llvm.org/docs/Bindings/Python/</a>). The key <br>
> is that we do them in concordance with how Python packages get released <br>
> and push them through standard channels for deployment, and this <br>
> involves some gymnastics (of which, what I have will grow in some <br>
> complexity as we do this, based on the experience of other projects). <br>
> They basically include everything such that if you do a "pip install <br>
> mlir" you get a working package that is able to build and compile MLIR <br>
> based IR in a variety of forms. An ancillary function of them is to <br>
> enable downstream Python based projects to extend the system, so it <br>
> entails distributing enough headers and libraries to make this feasible.<br>
> <br>
<br>
Ok, so it's this python code: llvm-project/mlir/lib/Bindings/Python ?<br>
<br>
> <br>
>      > I have prototyped such a release process in a personal repo:<br>
>      > <a href="https://github.com/stellaraccident/mlir-py-release" rel="noreferrer" target="_blank">https://github.com/stellaraccident/mlir-py-release</a><br>
>      ><br>
>      > Additional development on that release process is currently<br>
>     blocked on<br>
>      > more work on the shared library organization in LLVM (discussed here<br>
>      ><br>
>     <a href="https://lists.llvm.org/pipermail/llvm-dev/2021-January/147567.html" rel="noreferrer" target="_blank">https://lists.llvm.org/pipermail/llvm-dev/2021-January/147567.html</a> and<br>
>      > being worked on independently) but it is useful as is and a<br>
>     reasonable<br>
>      > starting point for further work.<br>
>      ><br>
>      > I would propose that we just fork my current repo into a new one<br>
>     in the<br>
>      > LLVM organization and then take the necessary steps to get<br>
>      > credentials/permissions/secrets set up in the new context.<br>
>      ><br>
>      > Some answers to questions that may come up:<br>
>      ><br>
>      >   * *Why should this be a repo separate from llvm-project? *These<br>
>     kind<br>
>      >     of automation repos tend to have a lot of "garbage" commits<br>
>     that I<br>
>      >     think is best if they do not pollute the main repo (and also<br>
>     don't<br>
>      >     face contention on automatic jobs bumping things, etc). They also<br>
>      >     tend to require special permissions and secrets that we will<br>
>     want to<br>
>      >     more tightly control. They also make use of other GitHub features<br>
>      >     that it seems like we would like not polluting the main<br>
>     development<br>
>      >     flow ("Releases" tab, Actions, etc). Also, this is the kind<br>
>     of thing<br>
>      >     that tends to get revised en-masse periodically, and again,<br>
>     it would<br>
>      >     be good to not pollute the monorepo.<br>
> <br>
>     There really aren't many files in this repo, do you anticipate it<br>
>     growing significantly?<br>
> <br>
> <br>
> Not terribly so. Just from some personal experience, the ways things are <br>
> done for Python packaging are somewhat... esoteric... from a normal C++ <br>
> build flow and necessitate certain directory layouts and such that I <br>
> felt were better left to their own thing (it is something that you want <br>
> to do exactly as everyone else does it).<br>
> <br>
> <br>
>      >   * *Why not land this in llvm-zorg? *llvm-zorg claims to be for<br>
>     "LLVM<br>
>      >     Testing Infrastructure" and seems well scoped to that statement.<br>
>      >     What I am managing above is periodic, automated release tooling<br>
>      >     based on open-source CI systems (currently GitHub Actions), which<br>
>      >     are fairly standardized across the Python releasing<br>
>     community, easy<br>
>      >     to set up, etc.<br>
> <br>
>     llvm-zorg also handles generating the websites.  My personal opinion is<br>
>     that it would be OK to try to do this in llvm-zorg, but you're probably<br>
>     better off asking Galina about that.  I guess the downside of using<br>
>     llvm-zorg is you don't get the releases tab.<br>
> <br>
> <br>
> That is a good reason to put it there. One of the actions that is not <br>
> implemented yet is for generating API docs (which is done post <br>
> build/install for the Python side, because it introspects a running system).<br>
> <br>
> The releases page is actually pretty important. For snapshot builds, <br>
> python's pip can just scrape it directly for published, installable <br>
> artifacts and without it, we would need to roll our own place to stash <br>
> such things.<br>
> <br>
<br>
Could you have the GitHub action directly submit the package to pip <br>
rather than having it scrape the release page?  If we could, would there <br>
be any reason to have a release page?  Would users be downloading from <br>
the release page or from pip?<br></blockquote><div><br></div><div>My team's preference while we are very pre-release like we are is to not pollute the pip namespace until we're sure we have what we want. Deploying to the local project's release page is a good way to have some people be able to use it earlier but also still have an appropriate barrier to entry that matches where its at in the life-cycle.</div><div><br></div><div>Personal preference.</div><div><br></div><div>Some projects end up always deploying from their release page because they can't comply with PyPi policies (usually around distro version, dependencies, etc), but I've charted this out and think we will stay compliant.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
>     Why did you choose to write the checkout_repo.py script in python<br>
>     rather<br>
>     than using the GitHub checkout action, or writing your own custom<br>
>     action?<br>
> <br>
> <br>
> Good question - that was a limitation in my knowledge at the time (need <br>
> to source the version from a file). Consider that a TODO to eliminate.<br>
> <br>
<br>
If you need anything more complicated than some of the builtin actions, <br>
you an add them to the llvm/actions repo.<br></blockquote><div><br></div><div>Nice, thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-Tom<br>
> <br>
>      >   * *What ultimately will the code in this repo do?*<br>
>      >       o Have periodic GitHub actions to select new LLVM revisions and<br>
>      >         schedule daily/snapshot releases.<br>
> <br>
>     Do you have any idea of much of the GitHub actions resources this would<br>
>     use?  e.g. how many hours per week per Operating System?<br>
> <br>
> <br>
> Currently, each snapshot builds for about 30m on the free 2-core setups <br>
> per OS. However, this isn't presently compiling as much of LLVM that <br>
> will ultimately be needed. I have automation for another project where <br>
> we do build more/most of the backends as well, and that builds for <br>
> 1.25-1.5 hours per snapshot (and builds a fair bit more things unrelated <br>
> to LLVM, so just an upper bound estimate). On my other project, I found <br>
> that each minor python version added (of which, there are probably ~4 <br>
> LTS at any given time) added about 1min to each build.<br>
> <br>
> So if we are doing 2 snapshots a day and being conservative, 28 <br>
> hours/week/OS?<br>
> <br>
> I'm not running tests yet, so that will come with some costs. We will <br>
> probably choose to run just the python bindings tests per python version <br>
> (which are really cheap) and then run the full regression suite once per OS.<br>
> <br>
> <br>
>      >       o Have manual actions for triggering official, numbered<br>
>     releases.<br>
>      >       o Facilities for building Python wheels for PyPi and house any<br>
>      >         additional metadata/automation needed for anaconda.<br>
>      >       o Builds releases for all supported operating systems<br>
>     (currently<br>
>      >         Linux/CentOS7/manylinux2014, MacOS, and Windows) and<br>
>     supported<br>
>      >         Python versions (currently 3.6, 3.7, 3.8, 3.9).<br>
>      >       o Publish release artifacts on the Releases tab for<br>
>     daily/snapshot<br>
>      >         releases.<br>
>      >       o Provide a stable reference point for downstream projects that<br>
>      >         extend MLIR-Python and need to produce version-matched<br>
>     artifacts<br>
>      >         of their own.<br>
>      >   * *Could this graduate to be more than "MLIR" python?* Maybe. I<br>
>     chose<br>
>      >     the name because that is what I am focused on and didn't want to<br>
>      >     grab too much land. But there is nothing stopping this from<br>
>     becoming<br>
>      >     automation for general LLVM monorepo+incubator Python releasing.<br>
> <br>
>     I think it would be great to generalize this.  I would also like to<br>
>     automate parts the main LLVM release, and there seems to be some<br>
>     overlap<br>
>     with what you are doing.<br>
> <br>
> <br>
> Agreed. I actually found this quite easy to prototype. I think I spent a <br>
> grand total of ~a day on what is there (which isn't done yet, but isn't <br>
> super far off). It then took me ~3 days to adapt it to IREE <br>
> (<a href="https://github.com/google/iree" rel="noreferrer" target="_blank">https://github.com/google/iree</a>), which is much more complicated (as it <br>
> has to build LLVM, a bunch of deps and TensorFlow).<br>
> <br>
> <br>
>     -Tom<br>
> <br>
>      >   * *What if we don't do this?*<br>
>      >       o *Option A:* We keep running this in a private repo with the<br>
>      >         disclaimer that is currently at the top: "Note that this is a<br>
>      >         prototype of a real MLIR release process being run by a<br>
>     member<br>
>      >         of the community. These are not official releases of the LLVM<br>
>      >         Foundation in any way, and they are likely only going to be<br>
>      >         useful to people actually working on LLVM/MLIR until we get<br>
>      >         things productionized." We would miss opportunities for<br>
>      >         convergence with other projects and would cause things to<br>
>     fragment.<br>
>      >       o *Option B: *We only publish Python bindings in official LLVM<br>
>      >         release packages, and only for the Python version they<br>
>     are built<br>
>      >         with. We don't release Python binaries through normal package<br>
>      >         management channels.<br>
> <br>
> <br>
>      ><br>
>      > Opinions?<br>
>      > - Stella<br>
>      ><br>
>      > _______________________________________________<br>
>      > LLVM Developers mailing list<br>
>      > <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> <mailto:<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>
>      ><br>
> <br>
<br>
</blockquote></div></div>
</blockquote></div>