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

GH-40236: [Python][CI] Disable generating C lines in Cython tracebacks #40225

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Feb 24, 2024

Rationale for this change

We're getting timeouts (on AppVeyor) and very long compilation times (on GHA wheel builds) for lib.cpp, a Cython-generated C++ file. Examination suggests that lib.cpp is more than 300 thousand lines long, and we can hypothesize that this can blow up available memory on some machines and compilers.

What changes are included in this PR?

Disable a not really useful (and undocumented) Cython feature to make C++ code slightly easier to compile.

Are these changes tested?

Yes. This solves, at least temporarily, the timeout issues on AppVeyor and makes the wheel builds much faster (down to ~35 minutes for the wheel build step, instead of 3 hours).

Are there any user-facing changes?

No.

@pitrou
Copy link
Member Author

pitrou commented Feb 24, 2024

@github-actions crossbow submit wheel-windows*

This comment was marked as outdated.

@pitrou
Copy link
Member Author

pitrou commented Feb 26, 2024

Surprisingly, this fixes (at least for the time being) the PyArrow compilation time issues. I'll make a proper issue for this and mark the PR ready for review. @raulcd @jorisvandenbossche

@pitrou pitrou changed the title EXPERIMENT: [Python][CI] Disable generating C lines in Cython tracebacks GH-40236: [Python][CI] Disable generating C lines in Cython tracebacks Feb 26, 2024
Copy link

⚠️ GitHub issue #40236 has been automatically assigned in GitHub to PR creator.

@pitrou pitrou marked this pull request as ready for review February 26, 2024 15:14
@pitrou
Copy link
Member Author

pitrou commented Feb 26, 2024

@github-actions crossbow submit -g wheel -g python

Copy link

Revision: d27ff9a

Submitted crossbow builds: ursacomputing/crossbow @ actions-e32362e5a6

Task Status
test-conda-python-3.10 GitHub Actions
test-conda-python-3.10-cython2 GitHub Actions
test-conda-python-3.10-hdfs-2.9.2 GitHub Actions
test-conda-python-3.10-hdfs-3.2.1 GitHub Actions
test-conda-python-3.10-pandas-latest GitHub Actions
test-conda-python-3.10-pandas-nightly GitHub Actions
test-conda-python-3.10-spark-v3.5.0 GitHub Actions
test-conda-python-3.10-substrait GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-upstream_devel GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.8 GitHub Actions
test-conda-python-3.8-pandas-1.0 GitHub Actions
test-conda-python-3.8-spark-v3.5.0 GitHub Actions
test-conda-python-3.9 GitHub Actions
test-conda-python-3.9-pandas-latest GitHub Actions
test-cuda-python GitHub Actions
test-debian-11-python-3-amd64 Azure
test-debian-11-python-3-i386 GitHub Actions
test-fedora-39-python-3 Azure
test-ubuntu-20.04-python-3 Azure
test-ubuntu-22.04-python-3 GitHub Actions
wheel-macos-big-sur-cp310-arm64 GitHub Actions
wheel-macos-big-sur-cp311-arm64 GitHub Actions
wheel-macos-big-sur-cp312-arm64 GitHub Actions
wheel-macos-big-sur-cp38-arm64 GitHub Actions
wheel-macos-big-sur-cp39-arm64 GitHub Actions
wheel-macos-catalina-cp310-amd64 GitHub Actions
wheel-macos-catalina-cp311-amd64 GitHub Actions
wheel-macos-catalina-cp312-amd64 GitHub Actions
wheel-macos-catalina-cp38-amd64 GitHub Actions
wheel-macos-catalina-cp39-amd64 GitHub Actions
wheel-manylinux-2-28-cp310-amd64 GitHub Actions
wheel-manylinux-2-28-cp310-arm64 GitHub Actions
wheel-manylinux-2-28-cp311-amd64 GitHub Actions
wheel-manylinux-2-28-cp311-arm64 GitHub Actions
wheel-manylinux-2-28-cp312-amd64 GitHub Actions
wheel-manylinux-2-28-cp312-arm64 GitHub Actions
wheel-manylinux-2-28-cp38-amd64 GitHub Actions
wheel-manylinux-2-28-cp38-arm64 GitHub Actions
wheel-manylinux-2-28-cp39-amd64 GitHub Actions
wheel-manylinux-2-28-cp39-arm64 GitHub Actions
wheel-manylinux-2014-cp310-amd64 GitHub Actions
wheel-manylinux-2014-cp310-arm64 GitHub Actions
wheel-manylinux-2014-cp311-amd64 GitHub Actions
wheel-manylinux-2014-cp311-arm64 GitHub Actions
wheel-manylinux-2014-cp312-amd64 GitHub Actions
wheel-manylinux-2014-cp312-arm64 GitHub Actions
wheel-manylinux-2014-cp38-amd64 GitHub Actions
wheel-manylinux-2014-cp38-arm64 GitHub Actions
wheel-manylinux-2014-cp39-amd64 GitHub Actions
wheel-manylinux-2014-cp39-arm64 GitHub Actions
wheel-windows-cp310-amd64 GitHub Actions
wheel-windows-cp311-amd64 GitHub Actions
wheel-windows-cp312-amd64 GitHub Actions
wheel-windows-cp38-amd64 GitHub Actions
wheel-windows-cp39-amd64 GitHub Actions

@danepitkin
Copy link
Member

Here's the Cython issue[1] for reference. It looks like we are just removing string data (line number + function name) in traces. The issue states this is good to have in production. Looks like we are just adding too much in once file (hence GH-40166).

[1]cython/cython#1205

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Feb 26, 2024
@pitrou
Copy link
Member Author

pitrou commented Feb 26, 2024

Thanks for looking at this @danepitkin . I'll merge this in the interest of improving PR feedback.

@pitrou pitrou merged commit 8ec7044 into apache:main Feb 26, 2024
13 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Feb 26, 2024
@pitrou pitrou deleted the cython-c-lines-in-traceback branch February 26, 2024 16:28
@jorisvandenbossche
Copy link
Member

Nice!

Do you actually understand what we "lost" with this change?
I don't remember ever seen tracebacks from cython that include line numbers for the generated C code (it does include line numbers for the cython code, which is useful, and that is also kept after this change).

@pitrou
Copy link
Member Author

pitrou commented Feb 27, 2024

Like you I never saw any C line numbers in Cython-generated tracebacks. It seems that an additional setting is involved, which is off by default, so Cython was really generating unused information.

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Feb 28, 2024
…cebacks (apache#40225)

### Rationale for this change

We're getting timeouts (on AppVeyor) and very long compilation times (on GHA wheel builds) for `lib.cpp`, a Cython-generated C++ file. Examination suggests that `lib.cpp` is more than 300 thousand lines long, and we can hypothesize that this can blow up available memory on some machines and compilers.

### What changes are included in this PR?

Disable a not really useful (and undocumented) Cython feature to make C++ code slightly easier to compile.

### Are these changes tested?

Yes. This solves, at least temporarily, the timeout issues on AppVeyor and makes the wheel builds much faster (down to ~35 minutes for the wheel build step, instead of 3 hours).

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40236

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
…cebacks (apache#40225)

### Rationale for this change

We're getting timeouts (on AppVeyor) and very long compilation times (on GHA wheel builds) for `lib.cpp`, a Cython-generated C++ file. Examination suggests that `lib.cpp` is more than 300 thousand lines long, and we can hypothesize that this can blow up available memory on some machines and compilers.

### What changes are included in this PR?

Disable a not really useful (and undocumented) Cython feature to make C++ code slightly easier to compile.

### Are these changes tested?

Yes. This solves, at least temporarily, the timeout issues on AppVeyor and makes the wheel builds much faster (down to ~35 minutes for the wheel build step, instead of 3 hours).

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40236

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants