The GitHub Actions job "Teams" on tvm.git/main has succeeded.
Run started by GitHub user tlopex (triggered by tlopex).

Head commit for run:
71c634f8b1340abec6b2bd69bf2bea5f41cbb521 / HoYi 
<[email protected]>
[Relax][Frontend][TFLite] Add `RANDOM_UNIFORM`, `RANDOM_STANDARD_NORMAL`, and 
`MULTINOMIAL` (#19473)

## Summary

This PR adds support for the TFLite `RANDOM_UNIFORM`,
`RANDOM_STANDARD_NORMAL`, and `MULTINOMIAL` operators in the Relax
TFLite frontend, covering the items I claimed in #19412.

`RANDOM_UNIFORM` and `RANDOM_STANDARD_NORMAL` are lowered to seeded
`tvm.contrib.random` calls with dynamic shape support. `MULTINOMIAL` is
lowered by composing existing Relax ops around
`relax.op.multinomial_from_uniform`.

  ## Changes

  ### Frontend
1. Add converter registrations for `RANDOM_UNIFORM`,
`RANDOM_STANDARD_NORMAL`, and `MULTINOMIAL`.
  2. Add shared helpers to:
     - parse TFLite `RandomOptions` seeds
- convert shape tensors to Relax shape expressions for dynamic-shape
random ops
  3. Lower `RANDOM_UNIFORM` to `tvm.contrib.random.uniform`.
  4. Lower `RANDOM_STANDARD_NORMAL` to `tvm.contrib.random.normal`.
  5. Lower `MULTINOMIAL` by:
     - applying `R.nn.softmax` to logits
     - generating seeded uniform samples
     - calling `R.multinomial_from_uniform`
     - reshaping the result to `[batch_size, num_samples]`

  ### Runtime
1. Extend `src/runtime/contrib/random/random.cc` to accept seeded calls
for `tvm.contrib.random.uniform` and `tvm.contrib.random.normal`.
2. Preserve compatibility with the existing unseeded calling convention.
 
  ## Testing
All tests pass:
  ```bash
pytest
tests/python/relax/test_frontend_tflite.py::test_random_uniform_dynamic_shape
\

tests/python/relax/test_frontend_tflite.py::test_random_standard_normal_dynamic_shape
\

tests/python/relax/test_frontend_tflite.py::test_multinomial_dynamic_num_samples
-v
```
  ## References

  - #19412
  - Claimed items: MULTINOMIAL, RANDOM_STANDARD_NORMAL, RANDOM_UNIFORM

Report URL: https://github.com/apache/tvm/actions/runs/25211858275

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to