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

Merge continuous infrastructure to Main #328

Closed
6 of 7 tasks
willow-ahrens opened this issue Dec 5, 2023 · 9 comments · Fixed by #419
Closed
6 of 7 tasks

Merge continuous infrastructure to Main #328

willow-ahrens opened this issue Dec 5, 2023 · 9 comments · Fixed by #419
Assignees
Labels
blocking Someone is blocked on this
Milestone

Comments

@willow-ahrens
Copy link
Collaborator

willow-ahrens commented Dec 5, 2023

We decided to leave z3 out of it. Here's the final list of what's needed:

  • ScaleArray
  • ProductArray
  • singlerlelevels.jl
  • singlelistlevels.jl
  • continuous usage test cases from PLDI case studies
  • simplify_program.jl
  • parameterized storage types for arrays of open or closed intervals
@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

Decided not to merge https://github.com/willow-ahrens/Finch.jl/blob/3b2504bab426e591e89d4beff937f17336366c09/src/looplets/lookups.jl#L50?

I'm not quite sure this is always right?

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

Decided not to merge

https://github.com/willow-ahrens/Finch.jl/blob/3b2504bab426e591e89d4beff937f17336366c09/src/looplets/switches.jl#L58-L65
This looks good but not sure if it's always right.

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

Might need to merge simplify_program.jl and symbolic.jl likely have some rules that should be merged, perhaps we could add test cases for them too?

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

  • scale.jl and product.jl should be merged, with a restriction that the extent cannot be negative. If we could figure out a syntax to make it clearer whether we want a scalearray in the expression A[2 * i] that would help. We would also include the changes to wrapperize in this PR.

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

@willow-ahrens
Copy link
Collaborator Author

willow-ahrens commented Dec 6, 2023

Might need to merge continuous extent changes in dimensionalize.jl

@willow-ahrens
Copy link
Collaborator Author

@nullplay, this is all I have after looking at the diffs between branches. Let me know if I missed anything! I'm prioritizing this because I'd like to merge these before refactoring Finch any further.

@willow-ahrens willow-ahrens added the blocking Someone is blocked on this label Dec 9, 2023
@willow-ahrens
Copy link
Collaborator Author

Here's the rules that might need merging:

        # handles counting query 
        (@rule block(~s1..., declare(~a::isvariable, ~v::isconstant), ~s2..., freeze(~a), ~s3...) => begin
            if ortho(a, s2) 
                block(s1..., Postwalk(@rule a => v)(block(s3...)))
            end
        end),
        (@rule access(~a::isliteral, reader(), ~j...) => getval(a)), 


        (@rule block(~s1..., thaw(~a::isvariable), ~s2..., freeze(~a), ~s3...) => if ortho(a, s2)
        (@rule block(~s1..., thaw(~a::isvariable), ~s2..., freeze(~a), ~s3...) => if ortho(a, s2)
            block(s1..., s2..., s3...)
            block(s1..., s2..., s3...)
        end),
        end),

        # For better discordant traversal 
        (@rule loop(~idx, ~ext::isvirtual, ~body) => begin
            body_2 = Postwalk(@rule block(define(~a::isvariable, idx), loop(~idx2, ~ext2::isvirtual, ~body2)) => begin
                if idx ∉ getunbound(body2)
                    if ext2.val.start == a && ext2.val.stop == a
                        loop(idx2, ext, body2)
                    end
                end
            end)(body)

            if body_2 !== nothing
               body_2
            end
        end),

    ]
    ]
end
end


@@ -216,8 +248,18 @@ function visit_simplify(node::FinchNode)
end
end
    root = Rewrite(Prewalk((x) -> if x.kind === literal 
        if x.val isa Finch.Limit
            if x.val == drop_eps(x.val)
                literal(drop_eps(x.val))
            end
        end
    end))(root)

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

Successfully merging a pull request may close this issue.

2 participants