Skip to content
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

Tracking issue for missing Batch Op Interface #152

Open
Pangoraw opened this issue Nov 5, 2024 · 3 comments
Open

Tracking issue for missing Batch Op Interface #152

Pangoraw opened this issue Nov 5, 2024 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Pangoraw
Copy link
Collaborator

Pangoraw commented Nov 5, 2024

NOTE: Strikethrough ops are deliberately not implemented because the default broadcasting behavior of enzyme batch is enough.

  • StableHLO
    • AbsOp
    • AddOp
    • AfterAllOp
    • AllGatherOp
    • AllReduceOp
    • AllToAllOp
    • AndOp
    • Atan2Op
    • BatchNormGradOp
    • BatchNormInferenceOp
    • BatchNormTrainingOp
    • BitcastConvertOp
    • BroadcastInDimOp
    • CaseOp
    • CbrtOp
    • CeilOp
    • CholeskyOp
    • ClampOp
    • CollectiveBroadcastOp
    • CollectivePermuteOp
    • CompareOp
    • ComplexOp
    • CompositeOp
    • ConcatenateOp
    • ConstantOp
    • ConvertOp
    • ConvolutionOp Generic batch op interface #151
    • CosineOp
    • ClzOp
    • CustomCallOp
    • DivOp
    • DotGeneralOp
    • DynamicBroadcastInDimOp
    • DynamicConvOp
    • DynamicGatherOp
    • DynamicIotaOp
    • DynamicPadOp
    • DynamicReshapeOp
    • DynamicSliceOp
    • DynamicUpdateSliceOp
    • ExpOp
    • Expm1Op
    • FftOp
    • FloorOp
    • GatherOp
    • GetDimensionSizeOp
    • GetTupleElementOp
    • IfOp Generic batch op interface #151
    • ImagOp
    • InfeedOp
    • IotaOp
    • IsFiniteOp
    • LogOp
    • Logp1Op
    • LogisticOp
    • MapOp
    • MaxOp
    • MinOp
    • MulOp
    • NegateOp
    • NotOp
    • OptimizationBarrierOp
    • OrOp
    • OutfeedOp
    • PadOp
    • PartitionIdOp
    • PopcntOp
    • PowOp
    • RealOp
    • RecvOp
    • ReduceOp
    • ReducePrecisionOp
    • ReduceScatterOp
    • ReduceWindowOp
    • RemainderOp
    • ReplicaIdOp
    • ReshapeOp
    • ReverseOp Generic batch op interface #151
    • RngOp
    • RngBitGeneratorOp
    • RoundOp
    • RoundNearestEvenOp
    • RsqrtOp
    • ScatterOp
    • SelectOp
    • SelectAndScatterOp
    • SendOp
    • ShiftLeftOp
    • ShiftRightArithmeticOp
    • ShiftRightLogicalOp
    • SignOp
    • SineOp
    • SliceOp
    • SortOp
    • SqrtOp
    • SubtractOp
    • TanhOp
    • TransposeOp
    • TriangularSolveOp
    • TupleOp
    • UniformDequantizeOp
    • UniformQuantizeOp
    • WhileOp Generic batch op interface #151
    • XorOp
    • Deprecated operations in StableHLO
      • BroadcastOp
      • CreateTokenOp
      • CrossReplicaSumOp
      • DotOp
      • EinsumOp
      • TorchIndexSelectOp
      • UnaryEinsumOp
  • CHLO
    • Binary Element-wise Operations
      • BroadcastAddOp
      • BroadcastAtan2Op
      • BroadcastDivOp
      • BroadcastMaxOp
      • BroadcastMinOp
      • BroadcastMulOp
      • BroadcastNextAfterOp
      • BroadcastPolygammaOp
      • BroadcastPowOp
      • BroadcastRemOp
      • BroadcastShiftLeftOp
      • BroadcastShiftRightArithmeticOp
      • BroadcastShiftRightLogicalOp
      • BroadcastSubOp
      • BroadcastZetaOp
    • Binary Logical Element-wise Operations
      • BroadcastAndOp
      • BroadcastOrOp
      • BroadcastXorOp
    • Non-broadcasting Binary Operations
      • NextAfterOp
      • PolygammaOp
      • ZetaOp
    • ComplexOp
    • Unary Element-wise Operations
      • AcosOp
      • AcoshOp
      • AsinOp
      • AsinhOp
      • AtanOp
      • AtanhOp
      • BesselI1eOp
      • ConjOp
      • CoshOp
      • SinhOp
      • TanOp
      • ConstantOp (shared with StableHLO_ConstantOp)
      • ConstantLikeOp
      • DigammaOp
      • ErfOp
      • ErfInvOp
      • ErfcOp
      • IsInfOp
      • IsNegInfOp
      • IsPosInfOp
      • LgammaOp
    • BroadcastCompareOp
    • BroadcastSelectOp
    • TopKOp
@mofeing
Copy link
Collaborator

mofeing commented Nov 5, 2024

... because the default broadcasting behavior of enzyme batch is enough.

Do you mean unrolling or leave the op unchanged?

@Pangoraw
Copy link
Collaborator Author

Pangoraw commented Nov 5, 2024

The batch pass will take the original op:

%0 = stablehlo.add %arg0, %arg1 : tensor<10xf32>

and just prepend the broadcasted dimensions (e.g. 20x4):

%0 = stablehlo.add %arg0, %arg1 : tensor<20x4x10xf32>

This is the default behavior for all ops unless they implement BatchOpInterface.

@Pangoraw Pangoraw added good first issue Good for newcomers help wanted Extra attention is needed labels Nov 6, 2024
@wsmoses
Copy link
Member

wsmoses commented Nov 8, 2024

whileop definitely shouldn't be unrolled here in most cases [since it almost always has a number of iterations fixed by a constant aka non data-dependent value]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants