-
Notifications
You must be signed in to change notification settings - Fork 60
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 wheel builds #901
Add wheel builds #901
Conversation
Co-authored-by: Lawrence Mitchell <[email protected]>
Co-authored-by: Lawrence Mitchell <[email protected]>
Co-authored-by: Lawrence Mitchell <[email protected]>
Co-authored-by: Lawrence Mitchell <[email protected]>
This reverts commit c595e93.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vyas for all the hard work here! 🙏
Had some thoughts on simplifying the version handling below
ftext = f.read() | ||
major = re.findall("^#define.*UCP_API_MAJOR.*", ftext, re.MULTILINE) | ||
minor = re.findall("^#define.*UCP_API_MINOR.*", ftext, re.MULTILINE) | ||
versioneer.get_versions = get_versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am curious why we are overwriting the version function here? It seems simpler just to not use versioneer at all in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @wence- here, but the answer here is related to his answer to your other query about why not directly use the version: this hack ensures that we get the right version encoded in _version.py
so that ucp.__version__
is correct when users import and use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's all part of the same dance.
The other approach would be to rewrite _version.py
in the wheel-building process to fill in the version by hand. But this is kind of what versioneer does any, so this monkeypatch is simpler.
@@ -56,6 +63,10 @@ def get_ucp_version(): | |||
cmdclass = versioneer.get_cmdclass(cmdclass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we condition this on whether the version was set externally and skip this if so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the discussions around versioneer.get_version
I think it's more appropriate to leave all of this unconditional and make the versioneer monkey patch the only conditional change.
# TODO: At present the ucx-py naming scheme is not dynamic and will not | ||
# support different CUDA major versions if we need to build wheels. It is | ||
# hardcoded in pyproject.toml, so overriding it here will not work. | ||
# name="ucx-py" + os.getenv("RAPIDS_PY_WHEEL_CUDA_SUFFIX", default=""), | ||
ext_modules=ext_modules, | ||
cmdclass=cmdclass, | ||
version=versioneer.get_version(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just pass the version here if known
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale for this is as for the approach we took in dask-cuda. I copy the description:
The GIT_DESCRIBE_TAG and VERSION_SUFFIX environment variables are used
to control the name and version of the created conda/pypi package.
They should, however, not be used to control the version of the
installed package by overriding the versioneer cmdclass since that
leaves an unmodified _version.py file in the installed package
directory. A consequence is that the version reported by
dask_cuda.version is "0+unknown".
We cannot always use the versioneer-provided cmdclass unmodified since
PEP440 specifically forbids PyPI from accepting packages that have local
version identifiers (as used by versioneer). To get around this, when setup.py
detects it is building a PyPI package (GIT_DESCRIBE_TAG is in the environment),
patch the version returned from versioneer with a PyPI-compatible one.
Specifically. If we don't use versioneer here, then the dynamic code in __init__.py
which imports _version
and calls get_versions()
will report nonsense for wheel packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
cibw-before-build: "cp {package}/.github/build-scripts/patch-wheel.sh /patch-wheel.sh" | ||
# Also rewrite the name in the pyproject.toml file. | ||
# TODO: Eventually this needs to be done more generically. | ||
cibw-before-build: "cp {package}/.github/build-scripts/patch-wheel.sh /patch-wheel.sh && sed -i 's/name = \"ucx-py\"/name = \"ucx-py-cu11\"/g' {package}/pyproject.toml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking we could also capture this in a patch we apply as part of the build. No strong feelings about that or this approach though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick to this approach for now and punt determining an "optimal" long-term solution for the next release. I don't know if we want to store multiple patches in the repo since that will create multiple sources of truth (the GHA workflow will also need to have access to the current CUDA version, for instance). I think it will be cleaner in the long run to use this sort of scripting approach that reacts to the values of inputs to the workflow.
@jakirkham do you have further concerns here about the version management (or anything else)? |
In the interest of getting things in for code freeze I'm going to go ahead and merge this. If there are any outstanding concerns about the version handling we can address that in the next release. |
@gpucibot merge |
Ah I guess I don't have write access to this repository. @wence- or @pentschev could you please merge this? Thanks! |
@gpucibot merge |
This PR adds support for building wheels of ucx-py. Authors: - Vyas Ramasubramani (https://github.com/vyasr) - Benjamin Zaitlen (https://github.com/quasiben) - Sevag H (https://github.com/sevagh) Approvers: - Lawrence Mitchell (https://github.com/wence-) - Joseph (https://github.com/jolorunyomi) URL: rapidsai#901
This PR adds support for building wheels of ucx-py.