tlopex opened a new pull request, #18269:
URL: https://github.com/apache/tvm/pull/18269

   ### **Overview**
   This PR implements a Relax to Python Function Converter that transforms 
Relax functions into executable Python functions using PyTorch operations. This 
enables seamless conversion between TVM's Relax IR and Python/PyTorch 
environments, which provides enhanced debugging capabilities and leveraging 
existing PyTorch operator libraries for testing and deployment purposes.
   
   ### **Key Feature**
   - **High-level operator mapping**: Maps 60+ Relax operators to corresponding 
PyTorch APIs
   - **Special operation handling**: Supports `call_tir`, `call_dps_packed`, 
and Relax function calls with DLPack integration
   - **Symbolic shape support**: Handles symbolic shapes and dynamic tensor 
operations
   
   ### **Example**
   ```python
   from tvm.relax.relax_to_pyfunc_converter import RelaxToPyFuncConverter
   
   # Convert Relax functions to Python functions
   converter = RelaxToPyFuncConverter(ir_module)
   converted_ir_mod = converter.convert("my_function")
   
   # Execute converted function with PyTorch tensors
   result = converted_ir_mod.pyfuncs['my_function'](input_tensor)
   ```


-- 
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]

Reply via email to