-
Notifications
You must be signed in to change notification settings - Fork 111
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
Split TTNN into C++ library and Python binding #16418
Comments
I'll check this one @ayerofieiev-tt |
This was referenced Feb 18, 2025
dgomezTT
added a commit
that referenced
this issue
Mar 1, 2025
Now we will have to libraries, ttnncpp and ttnn, where ttnncpp will work as c++ backend while the tin library is the wrapper for python ### Ticket #16418 ### Problem description Our implementation of ttnn was coupled to python, so if anybody wanted to use the api directly from cpp, it could generate some linking issues. ### What's changed With ttnn divided in two, a user could link to the cpp backend without having to link to python, or use the python wrapper, depending on the use case. This gives more flexibility to our users to decide the way they decide to interact with the backend ### Checklist - [x] [All post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/all-post-commit-workflows.yaml) CI passes - [x] [Blackhole Post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml) CI passes (if applicable) - [X ] [Model regression](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-models.yaml) CI passes (if applicable) - [x] [Device performance regression](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-device-models.yaml) CI passes (if applicable) - [ ] **(For models and ops writers)** Full [new models tests](https://github.com/tenstorrent/tt-metal/actions/workflows/full-new-models-suite.yaml) CI passes (if applicable) - [ ] New/Existing tests provide coverage for changes
Added a division between python and C++, If you want to compile only without python, you can use the flag --without-python-bindings (which is documented now) and it will generate a ttnncpp library. Otherwise you will get the classical ttnn library. If you want to push this forward, you can change the type of ttnncpp to be dynamic and link to the library you need. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
GGML requires minimal dependency. However currently TTNN built the Python binding into the same shared object as the rest of TTNN. Forcing any programs linked against TTNN to also depend on Python. Which I expect to cause trouble while upstreaming the GGML backend.
Currently the only way to get rid of the Python dependency is via an undocumented flag
WITH_PYTHON_BINDINGS
in CMake. Which is a stop gap implemented early on. But forces 2 builds of TTNN if users wish to also develop in Python and there is no way in GGML to detect if TTNN wants to link against Python from outside.Describe the solution you'd like
Split TTNN into 2 components. A C++ library and a Python binding.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: