LLVM Discussion Forums

How to join the open MLIR Project

Hi,

Just as the title, I’m not a student while really want to contribute to the MLIR open project mentioned here https://mlir.llvm.org/getting_started/openprojects/

Is it possible ? And if so, may I know how to do it ?

Thank you.

Best,
Ouhang

Hi Ouhang,

A good way to get started if you haven’t yet is to go through the tutorial.

Then optionally you may want to give at try at fixing one of the bugs as a warmup.

If there is a particular project of interest to you, let us know here and we can discuss how to proceed!

Thank you for your advice, Mehdi !
I’ve started to go through the tutorial now.

I’m interested in this project:

Making MLIR interact with existing polyhedral tools

I seem to be the point of contact for this specific project. The scope is intentionally broad, so could you please elaborate what you would be interested in specifically? It could also help if you could describe your background a bit as polyhedral abstractions tend to be a bit involved and I’d need to know how much detail I can omit.

Hi Alex,

Originally, I’ve been attracted by the idea from TensorComprehension Project, which combines polyhedral model and search algorithms (genetic search) to generate high-speed GPU kernel schedule. I’ve used it, read the source code of this project, and even tried the isl library for a little bit (But just a little bit).

I know some basics of the polyhedral model including math stuff and I’ve also read few papers. But I think I need more coding and a great project to make me understand it better.

Also, how to combine it with dynamic shapes / search algorithm in-depth / expert knowledge are also questions in my mind currently. Some ideas from polyhedral model I think can be used elsewhere. But I’m not quite clear about other scenarios (Can it help on sparse kernels? I don’t know).

I’m quite new I think, but very willing to know / learn / code more.

Regards,
ouhang

Any updates?
I’ve been going through the tutorial and now finished chapter 5.

If there needs more information to be provided, please feel free to let me know.
Looking forward to hear from you soon.

Great!

There’s a non-trivial aspect of this project: figuring out where eventual integrations of MLIR and existing polyhedral schedulers should live, within the LLVM ecosystem and beyond. The answer may depend on more specific things you would like to do. I’m interested in all aspects connecting polyhedral and mlir, e.g., using MLIR in Polly, using affine schedulers in MLIR Affine, using polyhedral abstractions for device placement. Depending on the specific task, you’d need to interact with different stakeholders. Let me know if you have any preference.

As a practical first step to familiarize yourself with the system, I can suggest (1) introducing an affine.max operation similar to the already present affine.min (https://github.com/llvm/llvm-project/blob/master/mlir/include/mlir/Dialect/AffineOps/AffineOps.td#L237), and (2) connecting (non-parallel) affine loops and dependence analysis to loop.parallel op and further to the recently introduced openMP construct.

Hello @ouhang, great to see your interest in the topic.

The steps that Alex (@ftynse) propose are a great starting point.
Looking forward to seeing your diffs!

Thank you Alex ! And Hi Nicolas @nicolasvasilache !

I’m really excited about this project !
I would start the first step as you suggested as soon as I finished all chapters from the tutorial.
And is this the correct page to follow for the first step?
https://mlir.llvm.org/getting_started/Contributing/

About the specific project, among the three you’ve provided, I would like to work on either “using affine schedulers in MLIR Affine” or “using polyhedral abstractions for device placement”.
Both looks great to me.

Hi Alex,
I’ve just created the pr.

https://reviews.llvm.org/D73848

About this one:
“connecting (non-parallel) affine loops and dependence analysis to loop.parallel op”

Could you please make it more specific ? Thank you for your patience and time !

And is this the correct page to follow for the first step? https://mlir.llvm.org/getting_started/Contributing/

Yes.

“connecting (non-parallel) affine loops and dependence analysis to loop.parallel op”

In the Affine dialect, we have the affine.for operation, which represents a sequential loop with affine constraints. In the Loop dialect, we now have the loop.parallel operation that represents a parallel loop nest (which could be just one loop). I’ll let you check the documentation and navigate code to find the exact details of their definition :). We also have a utility function that detects parallelism in affine loops here https://github.com/llvm/llvm-project/blob/308571074c13ea2a0758aa085aa02f72150f891e/mlir/include/mlir/Analysis/Utils.h#L291 with a standalone test. It would be great if you could implement a rewrite pattern than finds affine loops that are parallel and replaces them with loop.parallel. This would be the first step on the pass from affine to GPU and thus “using polyhedral abstractions for device placement”.

I would like to work on either “using affine schedulers in MLIR Affine” or “using polyhedral abstractions for device placement”.

Let’s tentatively chose the second. The first one is tricky in upstream MLIR (assuming you prefer to contribute to MLIR rather than maintaining a separate project).

@ftynse @nicolasvasilache I’ve updated the pr yesterday https://reviews.llvm.org/D73848

@ftynse Anyone else can I put as reviewers in this project ?

Most active developers are subscribed to all new revisions and receive an email. They may jump in if they have comments. This may also happen after the patch is committed and you are expected to address the review in a follow-up.

Thank you @ftynse for your patience, I just replied the pr with questions.

Is there a second place for quick small discussion, something like gmail hangout ?
Or here and pr review is just fine.
Since sometimes I think my question could be solved in quick answers instead of let them pending for next review

In general code changes are addressed in reviews, the documented etiquette is a weekly ping: https://llvm.org/docs/DeveloperPolicy.html#code-reviews

If you have topics you’d like to have more interactive discussion about, you can join Discord : https://discordapp.com/invite/xS7Z362

Thank you @joker-eph for the guidance

Discord would be the right place for quick questions. Also please be mindful about people living in different timezones.

Personally, I can’t afford being interrupted by chat messages so I check them with the same regularity as email. Other people may be more available on the chat band give you an answer faster. It is also not mandatory to post on a forum that you acted on review comments, reviewers get an email anyway.

please be mindful about people living in different timezones

Thank you for the reminder.

I can’t afford being interrupted by chat messages so I check them with the same regularity as email

It’s great to know your preference. To my understanding, the schedule and time requirement of the project depends on you. I can adjust mine as possible as I could.

Another minor question is, I’ve tried arc land, but it says

fatal: unable to access ‘https://github.com/llvm/llvm-project.git/’: The requested URL returned error: 403

I’ve followed “https://mlir.llvm.org/getting_started/Contributing/”, and also joined the group https://reviews.llvm.org/project/members/78/

Do you have any ideas ? Do I miss something ?