Skip to content

Commit

Permalink
[Mosaic] C++ apply-vector-layout: don't skip unrecognized operations …
Browse files Browse the repository at this point in the history
…in `applyLayoutOp`

Although the TODO says to return failure, this is actually done at the end of the function (and this way we handle the case for ops without vector args).

PiperOrigin-RevId: 584575120
  • Loading branch information
tlongeri authored and jax authors committed Nov 22, 2023
1 parent 8457b02 commit 4c9f2ac
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions jaxlib/mosaic/dialect/tpu/transforms/apply_vector_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3664,12 +3664,6 @@ FailureOr<Value> relayout(OpBuilder &builder, Value v, VectorLayout src,
// For example, we should verify that ops that were supposed to generate
// replicated outputs satisfy that requirement.
LogicalResult applyLayoutOp(RewriteContext &ctx, Operation &op) {
// TODO(tlongeri): Once we support all ops, return failure instead.
if (!rules().contains(op.getName().getStringRef()) &&
!OpTrait::hasElementwiseMappableTraits(&op)) {
return success();
}

// When an operation does not have any operands, the layout_in tuple is empty.
// If one of the operands is not of vector type, the corresponding entry in
// the layout_in tuple will be None. The same applies to the results of the
Expand Down

0 comments on commit 4c9f2ac

Please sign in to comment.