-
Notifications
You must be signed in to change notification settings - Fork 9
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
avoid excessive inlining by moving YaoBlocks.mat
to func.func
defs
#344
base: main
Are you sure you want to change the base?
Conversation
There's sth suspicious: the this code... op = func.call(
[R.theta.mlir_data];
result_0=[IR.TensorType((2, 2), IR.Type(T))],
callee=IR.Attribute(symname("rz", S, T)),
)
@show IR.nattrs(op) IR.Attribute(symname("rz", S, T)) IR.name(op)
IR.attr!(op, "callee", IR.Attribute(symname("rz", S, T)))
@show IR.nattrs(op) ...prints...
UPDATEI had to use a @jumerckx we should add better checks to the op bindings on the new generator |
finally works. some notes:
%1004 = call @rz_Float64_ComplexF64(%271) : (tensor<f64>) -> tensor<2x2xcomplex<f64>>
%1005 = stablehlo.transpose %1004, dims = [1, 0] : (tensor<2x2xcomplex<f64>>) -> tensor<2x2xcomplex<f64>>
%1006 = stablehlo.reshape %1005 : (tensor<2x2xcomplex<f64>>) -> tensor<2x2xcomplex<f64>>
%1007 = stablehlo.transpose %1006, dims = [1, 0] : (tensor<2x2xcomplex<f64>>) -> tensor<2x2xcomplex<f64>>
|
it = IR.OperationIterator(IR.body(module_top())) | ||
return any(it) do op | ||
IR.name(op) == "func.func" || return false | ||
|
||
String(IR.attr(op, 2).named_attribute.name) == "sym_name" || | ||
error("expected sym_name attribute") | ||
|
||
_symname = String(IR.Attribute(IR.attr(op, 2).named_attribute.attribute)) | ||
_symname == symname(name, ParamType, OutElType) || return false | ||
return true | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use a SymbolTable
for this: https://github.com/EnzymeAD/Reactant.jl/blob/main/src/mlir/IR/SymbolTable.jl
@@ -211,7 +211,7 @@ rmattr!(operation::Operation, name) = | |||
API.mlirOperationRemoveAttributeByName(operation, name) | |||
|
|||
function lose_ownership!(operation::Operation) | |||
@assert operation.owned | |||
# @assert operation.owned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is causing this ? This seems suspicious
this is the MWE i'm working with
on
@code_hlo optimize=false
seems to work wellbut when i do
optimize=true
, it segfaults