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

Add polymer2 #360

Merged
merged 242 commits into from
Jan 25, 2024
Merged

Add polymer2 #360

merged 242 commits into from
Jan 25, 2024

Conversation

vatai
Copy link
Collaborator

@vatai vatai commented Sep 15, 2023

No description provided.

Copy link
Collaborator

@chelini chelini left a comment

Choose a reason for hiding this comment

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

I did a rapid pass on the PR. I would like to understand if we need all the files in example and example/handwritten. What is the purpose of this directory? Can we preserve only the .c and .h files and remove all the logs and mlir ones?

@@ -0,0 +1,117 @@
//===- polymer-translate.cc---------------------------------------*- C++
//-*-===//
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, missing clang-format?

@@ -0,0 +1,228 @@
Pluto schedule elapsed time: 8.184383e-02s
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are all these .log files needed?

@@ -0,0 +1,417 @@
#map0 = affine_map<(d0) -> (d0)>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this example directory? I see .c and .h files, which may remain, but I would remove the log files and the mlir ones.

@@ -0,0 +1,5044 @@
# 1 "/home/ubuntu/polymer/example/polybench/utilities/polybench.c"
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this?

@@ -0,0 +1,3 @@
module attributes {llvm.data_layout = ""} {
Copy link
Collaborator

@chelini chelini Sep 15, 2023

Choose a reason for hiding this comment

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

empty module, remove? There are multiple files.

@@ -0,0 +1,109 @@
// File name: main.c
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the purpose of this handwritten directory?

Copy link
Member

Choose a reason for hiding this comment

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

this is a @kumasento question if you know the answer offhand. (right now this is a first pass to merge the repos while preserving history and getting it to build)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair point, we can iterate on this later.

git submodule init
git submodule update --recursive --init

# - name: Link Polymer into Polygeist
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, I would remove commented code if not needed. Here and below

return 0;
}

// CHECK: #map0 = affine_map<()[s0] -> (s0 + 1)>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was of checking IR is fragile. I can help fixing it if we decide to merge.

kumasento and others added 24 commits November 3, 2023 09:06
* Setup the infra for emitting openscop

* Implemented a draft version

* Added LIT regression test framework

* Refactorized OpenScop generation by osl library.

* Supported adding a single parameter

* Supported imperfectly nested loops

* Added a new testcase for affine.if

* Added a simple test case for local vars.

* Improved code quality

* Updated LLVM commit

* Replaced duplicated swapId with upstream

* Added body/arrays extensions to support PLUTO

* Added parameter name list to scop
* Generate MLIR from OpenScop

* Added simple unittests and fixed the old ones

* Removed redundant comments
* Initial implementation of store-based OpenScop transform

* Fixed (partially) unit tests
* Fixed flatExprs -> access relation & added matmul.

* Force using ISL dep calculation in Pluto
* Added dep tiling testcase

* Handles min/max in bounds & term def at apply.
@ivanradanov ivanradanov force-pushed the add-polymer2 branch 2 times, most recently from e62a3dd to 418f280 Compare November 3, 2023 05:05
@ivanradanov
Copy link
Collaborator

ivanradanov commented Nov 23, 2023

List of things I changed when I was rebasing polymer to the latest llvm-project, and was not sure the new thing does exactly the same thing as the old, we should probably confirm:

  getEnclosingAffineForAndIfOps 
  ->
  getEnclosingAffineOps

(fixed)
  ctx.reset(/*numDims=*/0, /*numSymbols=*/symbols.size());
  ->
  ctx = affine::FlatAffineValueConstraints();

  mlir::affine::AffineParallelOp newPloop = b.create<mlir::affine::AffineParallelOp>(
      loc, llvm::None, llvm::None, lowerBoundMap, lowerBoundOperands,
      upperBoundMap, upperBoundOperands, 1);
  ->
  mlir::affine::AffineParallelOp newPloop = b.create<mlir::affine::AffineParallelOp>(
      loc, TypeRange(), ArrayRef<arith::AtomicRMWKind>(), lowerBoundMap, lowerBoundOperands,
      upperBoundMap, upperBoundOperands, 1);


  llvm::cl::opt<const TranslationFunction *, false, TranslationParser>
      translationRequested("", llvm::cl::desc("Translation to perform"),
                           llvm::cl::Required);
  ->
  llvm::cl::opt<const Translation *, false, TranslationParser>
      translationRequested("", llvm::cl::desc("Translation to perform"),
                           llvm::cl::Required);

@ivanradanov ivanradanov force-pushed the add-polymer2 branch 3 times, most recently from fa3538f to da8784d Compare December 11, 2023 17:53
@ivanradanov
Copy link
Collaborator

Now we have separate polymer and non-polymer builds.

Crashes in the tests have been fixed, now we would actually have to look into the test outputs and fix the checks up (or XFAIL them and leave them as todo?)

@ivanradanov
Copy link
Collaborator

It works on my machine...

@ivanradanov ivanradanov force-pushed the add-polymer2 branch 3 times, most recently from 5ffba6b to 491f8b6 Compare January 15, 2024 05:22
Co-authored-by: Emil VATAI <emil.vatai@gmail.com>
Co-authored-by: William Moses <gh@wsmoses.com>
@ivanradanov ivanradanov merged commit 4b04755 into main Jan 25, 2024
9 checks passed
@wsmoses wsmoses deleted the add-polymer2 branch January 25, 2024 00:56
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.

8 participants