Aharrypotter commented on PR #19814: URL: https://github.com/apache/tvm/pull/19814#issuecomment-4785274672
Just to record the rationale for `relax.reverse_sequence` for future reference: Making it a first-class op (instead of emitting `emit_te`/`call_tir` straight from the frontend) keeps the design consistent with how the other manipulate ops work. It mirrors `relax.flip` almost exactly — a thin op that infers StructInfo and legalizes to its TOPI compute via `bb.call_te(topi.reverse_sequence, ...)`. The benefits: - The op-level semantics survive until legalization, so passes (pattern matching, fusion, structural checks) can still reason about it instead of seeing an opaque PrimFunc. - Any other frontend that needs it (e.g. ONNX `ReverseSequence`) can reuse the same op instead of hand-rolling another lowering. - The frontend test can assert on `R.reverse_sequence` directly, which is how we verify the lowering stays clean. So this isn't a one-off wrapper — it follows the established `flip`/`gather_elements`/`squeeze`/... pattern where the Relax op owns the semantics + StructInfo and TOPI owns the compute. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
