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

Head commit for run:
39e0c7e96c9eb97ad660b1ae85955da278f373d2 / Hangshuai He 
<[email protected]>
[Relax][PyTorch] Fix masked_select VM build (#19937)

This PR fixes the PyTorch ExportedProgram importer lowering for
`torch.masked_select`.

  Previously, `masked_select` lowered to:

  - flatten data and mask
  - `nonzero(mask_flat)`
  - `squeeze(axis=[0])`
  - `take(data_flat, indices)`

However, the result of `R.nonzero` only carried rank information. The
following `R.squeeze` over the dynamic nonzero output could remain
unhandled during build/VM execution.

This PR inserts a `match_cast` after `R.nonzero` using the exported
output metadata, preserving the dynamic selected-length dimension before
`squeeze`.

  A numerical regression test is also added to cover:

PyTorch eager -> torch.export -> Relax import -> build -> VM run ->
output comparison

  Testing:

- `python -m pytest -q
tests/python/relax/test_frontend_from_exported_program.py -k
'masked_select'`

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

With regards,
GitHub Actions via GitBox


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

Reply via email to