Add Numpy Frontend Support to Ivy Transpiler #28847
Labels
NumPy Frontend
Developing the NumPy Frontend, checklist triggered by commenting add_frontend_checklist
ToDo
A ToDo list of tasks
Transpiler
Anything related to transpiling
Description:
The current implementation of
ivy.transpile
supports"torch"
as the solesource
argument. This allows transpiling PyTorch functions or classes to target frameworks like TensorFlow, JAX, or NumPy. This task aims to extend the functionality by adding Numpy as a validsource
, enabling transpilation of Numpy code to other frameworks via Ivy's intermediate representation.For example, after completing this task, we should be able to transpile Numpy code using:
Goals:
The main objective is to implement the first two stages of the transpilation pipeline for Numpy:
Once these stages are complete, the rest of the pipeline can be reused to target other frameworks like JAX, PyTorch, or TensorFlow. The steps would look as follows:
This mirrors the existing pipeline for PyTorch:
Key Tasks:
Add Native Framework-Specific Implementations for Core Transformation Passes:
native_numpy_recursive_transformer.py
for traversing and transforming Numpy native source code.native_torch_recursive_transformer.py
as a reference (example here)Define the Transformation Pipeline for Numpy to Numpy Frontend IR:
source_to_frontend_translator_config.py
to handle the stagesource='numpy', target='numpy_frontend'
(example here).Define the Transformation Pipeline for Numpy Frontend IR to Ivy:
frontend_to_ivy_translator_config.py
to handle the stagesource='numpy_frontend', target='ivy'
(example here).Add Stateful Classes for Numpy
Understand and Leverage Reusability:
Testing:
Additional Notes:
The text was updated successfully, but these errors were encountered: