tlopex opened a new pull request, #19599: URL: https://github.com/apache/tvm/pull/19599
This PR improves TIRX buffer-like argument handling for tile ops. Now TIRX already canonicalizes `BufferLoad` into `BufferRegion` in several C++ builder paths such as `T.reads`, `T.writes`, and `T.match_buffer`. However, the Python tile-op builder path had separate handling: it only converted plain `Buffer` arguments into full-buffer regions, while `BufferLoad` arguments could still be passed through as scalar loads. This PR makes the tile-op path use the same buffer-like canonicalization model: - `Buffer` becomes a full `BufferRegion` - `BufferLoad` becomes a single-point `BufferRegion` - `BufferRegion` remains unchanged To avoid duplicating region construction logic in Python, this PR exposes the existing C++ helpers `BufferRegion::FullRegion` and `BufferRegion::FromPoint` to Python, and updates both Python tile-op canonicalization and the existing C++ `BufferRegionFromLoad` helper to use `FromPoint`. The PR also adds `T.buffer_from_ptr(...)` as a script-level convenience for constructing a buffer view from a pointer or `BufferLoad`. And care is taken to preserve scalar expression behavior for ambiguous overloads. For example, `T.max(A[i], B[j])` remains a scalar expression, while explicit tile-op forms such as `T.max(A[i], B[j], axes=0)` canonicalize the `BufferLoad` arguments into single-point regions. -- 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]
