Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

cxy-1993 (donald chen)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 29 2023, 8:13 AM (35 w, 2 d)

Recent Activity

Sep 29 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

ftynse acknowledged my rationale with a "like" on Discourse, so I suspect this is good to go?

Sep 29 2023, 5:41 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

rebase main

Sep 29 2023, 4:47 PM · Restricted Project, Restricted Project

Sep 21 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

This patch has already been rebased onto the main branch and passed precheckin. I don't have write access to the LLVM repo. Could you please help me to push this code into the master, Thanks. @Mogball

Sep 21 2023, 7:23 AM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

rebase main

Sep 21 2023, 6:17 AM · Restricted Project, Restricted Project

Sep 19 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

DIdn't the forum RFC conclude on using the parameters attribute for this instead of adding new fields?

Sep 19 2023, 5:06 AM · Restricted Project, Restricted Project

Sep 16 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

@rriddle ping :) Could you please spare some time to review this patch, thank you!

Sep 16 2023, 6:11 AM · Restricted Project, Restricted Project

Aug 21 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

@rriddle Please help me review this piece of code. Thank you for your time. :)

Aug 21 2023, 12:59 AM · Restricted Project, Restricted Project

Aug 12 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

@rriddle Ping :)

Aug 12 2023, 5:32 PM · Restricted Project, Restricted Project

Aug 10 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

@rriddle @mehdi_amini Could you kindly spare a moment to review the updated code at your convenience? Thank you for your time and consideration.

Aug 10 2023, 1:07 AM · Restricted Project, Restricted Project

Aug 7 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

ping @mehdi_amini @rriddle Could you please take some time to help me with the review and merging of this patch? Thank you. :)

Aug 7 2023, 3:45 PM · Restricted Project, Restricted Project

Aug 2 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

Ping @rriddle Could you please help me review this piece of code? Thank you! :)

Aug 2 2023, 5:58 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update docs

Aug 2 2023, 5:36 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

+1. This patch makes sense to me. Having this level of granularity is useful.

Do any of the upstream transformations need to be taught about this?

Aug 2 2023, 4:48 PM · Restricted Project, Restricted Project

Aug 1 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

I have already modified the default range of side effects to "partial" and made necessary adjustments to various ops based on your feedback. I am reaching out to kindly request another code review for the changes I have made. @mehdi_amini

Aug 1 2023, 11:50 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

I see where you're coming from, but I'm much more on the side of avoiding footgun in our APIs: especially this kind, where it won't be caught until there is a subtle miscompute which requires long hours of debug.

Aug 1 2023, 4:53 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update patch according to review comments

Aug 1 2023, 4:48 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

I believe that when we say “write full” to a particular resource, this write is certain to occur. Therefore, any writes to this resource before that point can be killed by this operation. If the write is only possible, and we shouldn't explicitly mark it as writing all resources, do you think this approach is feasible?

It might be ok, I am not sure it is conservative in every situation? Assuming it is, it should likely be the default, right now your MemAlloc default to full.

Aug 1 2023, 3:28 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

Thank you for your guidance. I have update the patch according to your comment. @mehdi_amini

Aug 1 2023, 3:10 AM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Do not set side effects stage for operations where we cannot determine the order of side effects on all values.

Aug 1 2023, 2:45 AM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

Sorry, I don't know how to reply inline comment...
The copy like example read source on stage 0 and write target on stage 1. By using stages, we indicate the sequence in which these two side effects occur. Is it enough for "stage" or we need to provide more exmaple?.

Aug 1 2023, 2:00 AM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

Regarding May/Must associated with the effect, I believe you are referring to the relationship between memrefs. If that's the case, we will leave this issue to the pass to invoke alias analysis. If it's not, please let me know.

No I wasn't referring to alias analysis (where "May alias"/"Must alias" is important) but to the read/write effects: how do we model an op that may write the full resource, or may not?
We can say that conservatively we say "write full" when it may do so, but then you can't use this information for kill the liveness of the entire resource.

Aug 1 2023, 1:41 AM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

Thanks for your advice.
The "partial/full region" aspect of the effect is also an important feature in side effect, i have already added them to the member variable of EffectInstance and they can be specified via the 'td' parameter.
Regarding May/Must associated with the effect, I believe you are referring to the relationship between memrefs. If that's the case, we will leave this issue to the pass to invoke alias analysis. If it's not, please let me know.

Aug 1 2023, 1:30 AM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update style

Aug 1 2023, 1:15 AM · Restricted Project, Restricted Project
cxy-1993 updated the summary of D156087: [MLIR] Add stage to side effect.
Aug 1 2023, 1:08 AM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Add effectOnFullRegion to side effect and update docs according to commentsx

Aug 1 2023, 1:07 AM · Restricted Project, Restricted Project

Jul 31 2023

cxy-1993 retitled D156087: [MLIR] Add stage to side effect from [MLIR] Add index to side effect to [MLIR] Add stage to side effect.
Jul 31 2023, 10:26 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

I agree with your suggestion of making 'stage' as a member variable in the side effect class. I have already updated the code and added the necessary documentation based on your advice. I kindly request you to review it once again. Thank you so much for your valuable comments! @mehdi_amini

Jul 31 2023, 7:23 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Updated the code according to the latest review comments

Jul 31 2023, 7:19 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

I still think documentation is missing, I don't see a definition of "Stage" yet?

Jul 31 2023, 5:54 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update test

Jul 31 2023, 5:38 PM · Restricted Project, Restricted Project
cxy-1993 edited reviewers for D156087: [MLIR] Add stage to side effect, added: mehdi_amini; removed: rriddle, antiagainst, bondhugula, ThomasRaoux, dcaballe, springerm, nicolasvasilache, herhut.

Could you please help me review this piece of code again @mehdi_amini . Also, I am unable to trigger the tests for this commit again. I found online that it's currently only allowed for maintainers to trigger the tests. Could you please help me trigger the tests? Thank you very much for your assistance.

Jul 31 2023, 5:14 PM · Restricted Project, Restricted Project

Jul 29 2023

cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Rename SideEffectOrderAttr -> SideEffectStageAttr

Jul 29 2023, 5:54 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

There is likely some documentation to update.

Also I'm not sure that "index" is expressive enough to carry the intent here. The closest I can relate here is pipeline stages in VLIW for example, so maybe the word "stage" should appear in the API?

Jul 29 2023, 5:42 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Updated the code according to the review comments

Jul 29 2023, 5:40 PM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update patch fixes coding style

Jul 29 2023, 4:14 AM · Restricted Project, Restricted Project
cxy-1993 updated the diff for D156087: [MLIR] Add stage to side effect.

Update the patch according to the discussion in https://discourse.llvm.org/t/rfc-add-effect-index-in-memroy-effect/72235/4

Jul 29 2023, 3:09 AM · Restricted Project, Restricted Project

Jul 24 2023

cxy-1993 added a comment to D156087: [MLIR] Add stage to side effect.

This is the RFC corresponding to this patch:https://discourse.llvm.org/t/rfc-add-effect-index-in-memroy-effect/72235

Jul 24 2023, 1:19 AM · Restricted Project, Restricted Project
cxy-1993 requested review of D156087: [MLIR] Add stage to side effect.
Jul 24 2023, 1:03 AM · Restricted Project, Restricted Project

May 24 2023

cxy-1993 added a comment to D151287: [mlir] [scf] Add RegionBranchOpInterface to scf.forall and scf.parallel op.

Could you please help me push this patch to master @springerm

May 24 2023, 2:41 AM · Restricted Project, Restricted Project
cxy-1993 added a comment to D151287: [mlir] [scf] Add RegionBranchOpInterface to scf.forall and scf.parallel op.

scf.parallel can have an scf.reduce terminator.
E.g.:

%init = arith.constant 0.0 : f32
scf.parallel (%iv) = (%lb) to (%ub) step (%step) init (%init) -> f32 {
  %elem_to_reduce = load %buffer[%iv] : memref<100xf32>
  scf.reduce(%elem_to_reduce) : f32 {
    ^bb0(%lhs : f32, %rhs: f32):
      %res = arith.addf %lhs, %rhs : f32
      scf.reduce.return %res : f32
  }
}
May 24 2023, 12:35 AM · Restricted Project, Restricted Project

May 23 2023

cxy-1993 updated the diff for D151287: [mlir] [scf] Add RegionBranchOpInterface to scf.forall and scf.parallel op.

Update coding style.

May 23 2023, 11:23 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D151287: [mlir] [scf] Add RegionBranchOpInterface to scf.forall and scf.parallel op.

As discussed on https://discourse.llvm.org/t/why-scf-forall-op-doesnt-have-regionbranchop-interface/70789/4, these two operation has special terminators.

May 23 2023, 10:09 PM · Restricted Project, Restricted Project
cxy-1993 requested review of D151287: [mlir] [scf] Add RegionBranchOpInterface to scf.forall and scf.parallel op.
May 23 2023, 9:59 PM · Restricted Project, Restricted Project

Apr 15 2023

cxy-1993 abandoned D147790: [mlir] [bufferization] Fix dealloc errors..
Apr 15 2023, 7:44 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D148408: [mlir][tensor][bufferize] Fix dealloc placement in scf.forall op.

This patch solves deallocs placement error, but i still have some questions:

  1. 'memref.dealloc' is generated in bufferization process of 'scf.for_all' operation. It seems to me that this placement error is caused by illegal insertion, but expect others to fix it. is this over-coupling?
  2. If we accept this approach, any operation contains in terminator region should do same things as tensor.paralle_insert_slice on bufferize, Or should we abstract this behavior as interface or something?

I was just tried to contributing to llvm community, maybe i missed some important rationales. Thank you in advance for any help and explanation.

A bit of background: This bug was caused by our buffer deallocation strategy, which is currently too simple: it always places deallocs at the end of a block, right before the terminator. This worked great, until we added scf.for_all, which was the first time that we had an op with a terminator that does more than just yielding.

You are right, this is a not an ideal solution because the root problem is the original placement of the dealloc. We have plans to revamp the buffer deallocation logic this summer: One-Shot Bufferize would no longer insert any deallocations. This would be done by a separate pass. This change here is the smallest change to fix the issue for now, without writing a bunch of code that will be deleted in a month.

Contributions are always welcome, so please keep them coming :)

Apr 15 2023, 7:40 PM · Restricted Project, Restricted Project
cxy-1993 added a comment to D148408: [mlir][tensor][bufferize] Fix dealloc placement in scf.forall op.

This patch solves deallocs placement error, but i still have some questions:

  1. 'memref.dealloc' is generated in bufferization process of 'scf.for_all' operation. It seems to me that this placement error is caused by illegal insertion, but expect others to fix it. is this over-coupling?
  2. If we accept this approach, any operation contains in terminator region should do same things as tensor.paralle_insert_slice on bufferize, Or should we abstract this behavior as interface or something?
Apr 15 2023, 6:38 AM · Restricted Project, Restricted Project
cxy-1993 added a comment to D147790: [mlir] [bufferization] Fix dealloc errors..

Can you try this patch: https://reviews.llvm.org/D148408. I ran into a similar issue today and I think this should fix it.

Apr 15 2023, 6:12 AM · Restricted Project, Restricted Project

Apr 7 2023

cxy-1993 requested review of D147790: [mlir] [bufferization] Fix dealloc errors..
Apr 7 2023, 8:09 AM · Restricted Project, Restricted Project