Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Simulator][Dataflow] Support parallel simulation for kernel with independent PEs #292

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Oh-Afterglow
Copy link

Description

This PR enables parallel simulation for kernels with independent PEs, i.e. no FIFO communications between PEs. It's provided as a backend LLVMOMPModule including 2 parts:

  • A transformation pass that injects operations of the OpenMP dialect (omp) into kernel's MLIR code, which separates PE function calls into different omp.sections and enables parallelism among different PEs.
  • A lowering pipeline that lowers the transformed MLIR code into the simulator executable for CPU (a mixture of llvm and omp dialect operations able to run on the MLIR execution engine).

Examples

The test case of tiled GEMM is provided.

Checklist

  • PR's title starts with a category (e.g. [Bugfix], [IR], [Builder], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage (It would be better to provide ~2 different test cases to test the robustness of your code)
  • Code is well-documented

Copy link
Member

@chhzh123 chhzh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting a PR. Since we are building a simulator which is supposed to be different from the original LLVM backend, it'd be better to separate the implementation from the original one. For example, you can create a new file called simulator.py under allo/backend and specify the target as "simulator" instead of overwriting "llvm".

@Oh-Afterglow
Copy link
Author

I've restructured the files as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants