Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for PaddlePaddle #1334

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mvasiljevicTT
Copy link

Add initial support for compiling PaddlePaddle modules, following the PyTorch approach for module compilation.

Main changes:

forge/forge/module.py : Added a wrapper for Paddle modules, with PyTorch tensors as inputs and outputs, keeping the parameter names and converting their values to PyTorch tensors.

forge/forge/python_codegen.py : Mostly mirrors the PyTorch implementation, except for write_param_parser, where parameter values are cast from Paddle tensors to PyTorch tensors.

forge/forge/verify/verify.py : Modified verify function to expect inputs from the original model and convert them to Torch tensors for the compiled model.

forge/test/mlir/test_ops_paddle.py : Added tests based on existing PyTorch tests, using Paddle or PyTorch tensors as inputs for explicitly set models (as paddle.nn.Layer) or models loaded from file (as paddle.nn.TranslatedLayer)

The branch is in line with mvasiljevic/paddle_support branch of tt-tvm.

@dgolubovicTT dgolubovicTT self-requested a review February 27, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants