Skip to content

Commit

Permalink
Add pinning for pyarrow in wheels (#17018)
Browse files Browse the repository at this point in the history
We have recently observed a number of seg faults in our Python tests. From some investigation, the error comes from the import of pyarrow loading the bundled libarrow.so, and in particular when that library runs a jemalloc function `background_thread_entry`. We have observed similar (but not identical) errors in the past that have to do with as-yet unsolved problems in the way that arrow handles multi-threaded environments. The error is currently only observed on arm runners and with pyarrow 17.0.0. In my tests the error is highly sensitive to everything from import order to unrelated code segments, suggesting a race condition, some form of memory corruption, or perhaps symbol resolution errors at runtime. As a result, I have had limited success in drilling down further into specific causes, especially since attempts to rebuild libarrow.so also squash the error and I therefore cannot use debug symbols. From some offline discussion we decided that avoiding the problematic version is a sufficient fix for now. Due to the sensitivity, I am simply skipping 17.0.0 in this PR. I suspect that future builds of pyarrow will also usually not exhibit this bug (although it may recur occasionally on specific versions of pyarrow). Therefore, rather than lowering the upper bound I would prefer to allow us to float and see if and when this problem reappears. Since our DFG+RBB combination for wheel builds does not yet support any matrix entry other than `cuda`, I'm using environment markers to specify the constraint rather than a matrix entry in dependencies.yaml.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #17018
  • Loading branch information
vyasr authored Oct 9, 2024
1 parent 5b931ac commit ded4dd2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
11 changes: 10 additions & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,18 @@ dependencies:
- cython>=3.0.3
pyarrow_run:
common:
- output_types: [conda, requirements, pyproject]
- output_types: [conda]
packages:
- pyarrow>=14.0.0,<18.0.0a0
- output_types: [requirements, pyproject]
packages:
# pyarrow 17.0.0 wheels have a subtle issue around threading that
# can cause segmentation faults around imports on arm. It appears to
# be highly dependent on the exact build configuration, so we'll just
# avoid 17.0.0 for now unless we observe similar issues in future
# releases as well.
- pyarrow>=14.0.0,<18.0.0a0; platform_machine=='x86_64'
- pyarrow>=14.0.0,<18.0.0a0,!=17.0.0; platform_machine=='aarch64'
cuda_version:
specific:
- output_types: conda
Expand Down
3 changes: 2 additions & 1 deletion python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ dependencies = [
"packaging",
"pandas>=2.0,<2.2.4dev0",
"ptxcompiler",
"pyarrow>=14.0.0,<18.0.0a0",
"pyarrow>=14.0.0,<18.0.0a0,!=17.0.0; platform_machine=='aarch64'",
"pyarrow>=14.0.0,<18.0.0a0; platform_machine=='x86_64'",
"pylibcudf==24.12.*,>=0.0.0a0",
"rich",
"rmm==24.12.*,>=0.0.0a0",
Expand Down
2 changes: 1 addition & 1 deletion python/cudf_polars/tests/expressions/test_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_bool_agg(agg, request):
expr = getattr(pl.col("a"), agg)()
q = df.select(expr)

assert_gpu_result_equal(q)
assert_gpu_result_equal(q, check_exact=False)


@pytest.mark.parametrize("cum_agg", expr.UnaryFunction._supported_cum_aggs)
Expand Down
3 changes: 2 additions & 1 deletion python/pylibcudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ dependencies = [
"libcudf==24.12.*,>=0.0.0a0",
"nvtx>=0.2.1",
"packaging",
"pyarrow>=14.0.0,<18.0.0a0",
"pyarrow>=14.0.0,<18.0.0a0,!=17.0.0; platform_machine=='aarch64'",
"pyarrow>=14.0.0,<18.0.0a0; platform_machine=='x86_64'",
"rmm==24.12.*,>=0.0.0a0",
"typing_extensions>=4.0.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
Expand Down

0 comments on commit ded4dd2

Please sign in to comment.