-
Notifications
You must be signed in to change notification settings - Fork 112
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
mlir: Add Enzyme ops removal on structured control flow #2200
Conversation
return mlir::enzyme::CacheInfo::batchType(mlir::ShapedType::kDynamic); | ||
} | ||
|
||
mlir::Type mlir::enzyme::CacheInfo::batchType(int64_t dim) { |
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.
so there is already an Enzyme Autodiff Type interface, which should have a method for batching (and if not that would probably be the right place for this)
enzyme/Enzyme/MLIR/Implementations/SCFAutoDiffOpInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
assert(width == 1 && "unsupported width != 1"); | ||
return self; | ||
Type getShadowType(Type self, int64_t width) const { | ||
return batchType(self, width); |
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.
in a separate different PR, it may be worthwhile switching getShadowType and the likes to take an ArrayRef<int64_t> indices to batch on (@jumerckx did something similar when adding batched differentiation broadcast earlier)
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.
looks good, though there's some unrelated batch stuff here that probably shouldn't be here (maybe leftover from debugging)
Yeah I had cherry-picked changes from #2181 before it was merged, the diff should be more correct now that I rebased. |
TODO:
Cache<f32> -> tensor<?xf32>
.