Files
apache--tvm/python
Soowon Jeong 545c3325ad [Relax][Frontend][TFLite] Fix bool REDUCE_ANY/REDUCE_ALL compile failure (#19415)
## Problem

#19413 registered `REDUCE_ANY` / `REDUCE_ALL` as `_convert_reduce` with
`relax.op.max` / `relax.op.min`. These TFLite ops are bool-only (per TFL
op schema: `TFL_ReduceAnyOp` / `TFL_ReduceAllOp` take and return
`TFL_BoolTensor`), and `relax.op.max` / `relax.op.min` are not defined
on bool, so any real model using these ops fails at compile time with:

```
Cannot decide min_value for type bool
Cannot decide max_value for type bool
```

The existing structural-equality test passed because it never attempted
to compile the converted module (E2E is gated on `CI_ENV_NIGHTLY`).

## Fix

Introduce a dedicated `_convert_reduce_bool` handler that casts the
input to int8, reduces with max/min, and casts back to bool. Update the
test to compile the expected module so this lowering is exercised
without `CI_ENV_NIGHTLY`.

## Testing

Verified compile + VM-run (TF converter → Relax → LLVM) across the full
shape / axes / keepdims matrix from `test_reduction_bool_ops`: 12 cases,
all PASS.

Follow-up to #19413.
2026-04-17 22:47:58 -04:00
..