Closed yongwww closed 1 year ago
Hi @tqchen @YuchenJin My initial understanding about WellFormed check here is that we need to ensure VarBinding’s value is not a PrimFunc. Seems PrimFunc may appear in many other places, such as CallNode’s args, do we need to check all of them?
My initial understanding about WellFormed check here is that we need to ensure VarBinding’s value is not a PrimFunc. Seems PrimFunc may appear in many other places, such as CallNode’s args, do we need to check all of them?
When there’s a PrimFunc being a Call argument, the IR does not comply to normal form. The well-formed check already has checks for normal form, so I think it is not needed to add checks at other sites. https://github.com/tlc-pack/relax/blob/83adb870240a13ae75d0dcfac93e81bb2f3bcf59/src/relax/analysis/well_formed.cc#L42-L56 https://github.com/tlc-pack/relax/blob/83adb870240a13ae75d0dcfac93e81bb2f3bcf59/src/relax/analysis/well_formed.cc#L244-L249
Yeah, I think the IsLeafNode
helper function would take care of that. You can put in an xfail
test case for the well-formedness check to make sure it would be rejected.
thanks @MasterJH5574 @slyubomirsky @tqchen for the review!
thanks @yongwww please also send a PR to patch apache/unity
thanks @yongwww please also send a PR to patch apache/unity
Thanks @tqchen !, I will do that. Just took a look at the tvm/unity branch, well_formed pass is not there yet. I guess it would be good to wait until the pass is landed.
well-form pass now lands, please send the patch in :)
fix for #304