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 Python wheel building + Publishing workflow #70

Merged
merged 16 commits into from
Sep 24, 2023

Conversation

necessary129
Copy link
Contributor

@necessary129 necessary129 commented Jun 24, 2023

A docker image is made in necessary129/manylinux2014-LLVM
with prebuilt LLVM + cmake + ninja

cibuildwheel is being used to generate the wheels. Which
uses auditwheel to bundle linked libraries. So the ELF
patching in preparation.py is not needed.

The includes can be be found by Python by itself. Only utils.h
needs to be specifically included.

wheels are automatically made for all linux x86_64 Python versions
from 3.6 to 3.11

On publishing a release, the Python package is also published to
testpypi (as a proof of concept) -- This should be changed to actual pypi
on the main branch.

Each wheel is also down to ~5MB from ~60MB

Will close #52

The testpypi package: https://test.pypi.org/project/IR2Vec/

A docker image is made in necessary129/manylinux2014-LLVM with
prebuilt LLVM + cmake + ninja

cibuildwheel is being used to generate the wheels. Which
uses `auditwheel` to bundle linked libraries. So the ELF
patching in `preparation.py` is not needed.

The includes can be be found by Python by itself. Only `utils.h`
needs to be specifically included.
A new musl docker image was made. Which would make it possible to
build musl wheels also.
Will publish to pypi on release
@necessary129 necessary129 force-pushed the python-packaging-3 branch 4 times, most recently from 0173bab to 1d34c00 Compare June 30, 2023 00:35
Also removed the prebuild wheels as wheel as CI autogenerated now
@svkeerthy svkeerthy requested review from svkeerthy and ShikharJain97 and removed request for svkeerthy July 4, 2023 01:37
@svkeerthy
Copy link
Member

Hi @necessary129, core.cpp also needs to be updated. Please have a look. Also, we may have some sort of tests written (very similar to the current make verify-all in IR2Vec) to check the functionality.

Will also publish to testpypi first on release, and a manual workflow
dispatch will have the option to deploy to actual pypi
@necessary129
Copy link
Contributor Author

Hi @necessary129, core.cpp also needs to be updated. Please have a look. Also, we may have some sort of tests written (very similar to the current make verify-all in IR2Vec) to check the functionality.

Added tests. They only test the program vectors in oracle at the moment because the function names in oracle and those produced by the Python binding is different.

@necessary129 necessary129 marked this pull request as ready for review July 10, 2023 06:24
@necessary129 necessary129 force-pushed the python-packaging-3 branch 2 times, most recently from de5e1af to a7d5393 Compare July 10, 2023 06:40
Compare the python module output to the oracle
@necessary129 necessary129 force-pushed the python-packaging-3 branch 3 times, most recently from 21397c8 to f109e22 Compare July 17, 2023 09:48
Will test each FA and SYM flevel embeddings also
Also fix a memory leak caused by not freeing the `__cxx::demangle`
return pointer
Python wheels are built in GLIBc ~ 2.17 so some functions are not
demangled properly. So we rebuild them using the ir2vec binary and
test the Python output against it.

The ir2vec binary output is tested against the actual oracle in another
workflow. So, this should be fine.
clang doesn't compile on musllinux directly. Need to figure that out.
in the meantime, don't build it. musl is not common anyway.
@svkeerthy svkeerthy merged commit d36ac2c into IITH-Compilers:main Sep 24, 2023
2 checks passed
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.

pip package to support python environment
2 participants