Skip to content

Add at-least-1-operand verification for collective ops#2917

Open
brucechanglongxu wants to merge 1 commit intoopenxla:mainfrom
brucechanglongxu:fix-variadic-op-verification
Open

Add at-least-1-operand verification for collective ops#2917
brucechanglongxu wants to merge 1 commit intoopenxla:mainfrom
brucechanglongxu:fix-variadic-op-verification

Conversation

@brucechanglongxu
Copy link
Copy Markdown

Hit this while fuzzing — you can construct an all_reduce, all_gather,
or all_to_all with zero variadic operands and it passes verification
silently. MHLO already guards against this but StableHLO doesn't.

The fix adds an early operands.empty() check in each verifier /
type-inference function. Nothing fancy, just parity with MHLO. Also
added a verify test file covering the three ops.

Fixes #2764

AllReduceOp, AllGatherOp, and AllToAllOp all accept variadic operands
but didn't verify that at least one is provided. This is enforced in
MHLO but was missing in StableHLO. Zero operands would either silently
pass verification or crash downstream.

Fixes openxla#2764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AllReduceOp missing verification for missing operand

1 participant