Support level reduction interface for multiple secret operands - #3324
Conversation
c18ec95 to
1bb8df9
Compare
280ca75 to
aa3e7c4
Compare
| linalg::Conv1DNcwFcwOp::attachInterface< | ||
| LinalgReducesLevelOpInterfaceModel<linalg::Conv1DNcwFcwOp>>(*ctx); | ||
| linalg::Conv2DNhwcFhwcOp::attachInterface< | ||
| LinalgReducesLevelOpInterfaceModel<linalg::Conv2DNhwcFhwcOp>>(*ctx); |
There was a problem hiding this comment.
The one that we work with in ConvertToCiphertextSemanctics and LayoutPropagation is instead NchwFchw. Why is this the conv2d that is registered?
| levelVal = level.getInt(); | ||
| } else if (level.isMaxLevel()) { | ||
| levelVal = levelBudget; | ||
| } else { |
There was a problem hiding this comment.
What if it is Uninit or Invalid? is it right to continue, or should a bootstrap be added?
There was a problem hiding this comment.
I think both of these should trigger an error.
| SmallVector<OpOperand*> getOperandsToReduce( | ||
| Operation* op, const DataFlowSolver* solver) const { | ||
| SmallVector<OpOperand*> result; | ||
| for (auto& operand : op->getOpOperands()) { |
There was a problem hiding this comment.
I don't know much about this, but my untrusty sidekick tells me that we should use getDpsInputOperands to avoid the outs accumulator that getOpOperands includes in the output
There was a problem hiding this comment.
You're right, but I think we only want to avoid the outs accumulator because we know that these ops will not reduce the level of the outs.
226c98f to
2a731fa
Compare
This is intended to support an eager (greedy) bootstrap placement pass earlier in the pipeline, by treating linalg ops and polynomial evaluation ops all as atomic, ensuring bootstraps aren't inserted mid-loop. To support that, we need to know at level analysis time which of the (potentially multiple) operands of a linalg op are secret. For ops like ct-ct mul, this is a hard requirement, and for ops like matvec, we have seen cases where the vector or the matrix can be secret while the other is plaintext. PiperOrigin-RevId: 962442140
2a731fa to
b5fd466
Compare
Support level reduction interface for multiple secret operands
This is intended to support an eager (greedy) bootstrap placement pass earlier in the pipeline, by treating linalg ops and polynomial evaluation ops all as atomic, ensuring bootstraps aren't inserted mid-loop.
To support that, we need to know at level analysis time which of the (potentially multiple) operands of a linalg op are secret. For ops like ct-ct mul, this is a hard requirement, and for ops like matvec, we have seen cases where the vector or the matrix can be secret while the other is plaintext.