Skip to content

Fix GB300 segfaults from destroying an async memory pool with pending frees in test_arrow_object_lifetime - #24688

Draft
bdice wants to merge 30 commits into
NVIDIA:mainfrom
bdice:fix-gb300-parquet-segfault
Draft

bdice wants to merge 30 commits into
NVIDIA:mainfrom
bdice:fix-gb300-parquet-segfault

Conversation

@bdice

@bdice bdice commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes the GB300-only segfaults in pylibcudf's parquet tests (e.g. test_read_parquet_basic, nightly example). These are not caused by #24590.

Root cause

test_interop.py::test_arrow_object_lifetime installs a temporary rmm.mr.CudaAsyncMemoryResource, allocates a table from it, restores the previous resource, and lets the async resource, and therefore its stream-ordered memory pool, be destroyed while GPU work and frees on that pool are still pending. After that, the next nvCOMP 6 hardware decompression (the Blackwell Decompression Engine, which only GB300 has in our CI) in the same process segfaults inside the CUDA driver at a later cuStreamSynchronize. It started with the nvCOMP 6.0 upgrade (#24580). It needs other processes using the GPU concurrently, so it showed up as a random parquet test crashing in whichever pytest-xdist worker had run this test earlier.

How it was isolated (all on GB300 in this PR's CI):

  • Forcing the CUDA decompression backend removes the crash, and the same build with the hardware backend crashes. Legacy vs. per-thread default stream, kvikio threading, nvCOMP's pinned pool, and dependency versions are not factors.
  • Delta-debugging a crashing worker's exact 2,311-test history, replayed in 8 concurrent processes, reduced it to test_arrow_object_lifetime followed by a parquet read.
  • ci/gb300_repro.py reproduces it without cuDF's test suite, and its lowest layer uses only cuda-python plus a pylibcudf parquet read (8 concurrent processes x 3 rounds):
setup before the parquet read processes that segfault
none 0/24
RMM async MR + table, destroyed with frees pending 15–19/24
same, cudaDeviceSynchronize() before destroy 0/24
raw cuda-python pool: async writes + frees, destroyed with work pending 24/24
same, synchronized before destroy 0/24
same, pending, CUDA backend instead of hardware decompression 0/24

The underlying bug is in the CUDA driver / nvCOMP 6 hardware decompression path. Destroying a pool with outstanding work is allowed by the CUDA API, since its release is deferred.

Fix

Synchronize the device before the test's temporary async resource is released, so its pool is never destroyed with work pending. The test now also asserts directly, via a weak reference, that the table keeps the resource alive, instead of relying on a segfault to detect a lifetime bug. No library changes are needed, and hardware decompression stays enabled.

Validation (GB300, full pylibcudf suite with --numprocesses=8)

  • A/B where only test_interop.py differs: original 2/6 runs crash, fixed 0/10 (11,585 passed each run).
  • gb300-validate (6 full-suite runs per head): 0 crashes or failures on every head validated (24 runs total), and the GB300 wheel-tests-cudf job passes.

Follow-ups outside this PR: report the driver/nvCOMP bug, and consider having RMM's cuda_async_memory_resource synchronize before cudaMemPoolDestroy.

Note on CI configuration

As requested for this investigation, this PR's .github/workflows/pr.yaml runs tests only on GB300: an arm64 CUDA 13 wheel build on CPU runners, the pylibcudf wheel tests, and ci/gb300_validate.sh (6 full-suite runs that fail on any crash or test failure, plus the ci/gb300_repro.py reproduction matrix). Revert pr.yaml and delete ci/gb300_* before merging; the fix itself is only python/pylibcudf/tests/test_interop.py.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@bdice bdice added the DO NOT MERGE Hold off on merging; see PR for details label Oct 19, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1764999

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ccb8065

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ba8515b

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7baf366

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e392838

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d7c7601

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 883c4f6

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test dac3b03

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 77441db

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3f56bab

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 24c9e7e

1 similar comment
@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 24c9e7e

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 536941f

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Oct 19, 2026
@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c55ab88

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ed82f19

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b02e3cf

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test aa7fad7

@github-actions github-actions Bot added Python Affects Python cuDF API. pylibcudf Issues specific to the pylibcudf package labels Oct 19, 2026
@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9c09137

@bdice bdice removed the DO NOT MERGE Hold off on merging; see PR for details label Oct 19, 2026
@bdice bdice changed the title Fix test_read_parquet_basic segfault on GB300 Fix GB300 segfaults from destroying an async memory pool with pending frees in test_arrow_object_lifetime Oct 19, 2026
@bdice bdice added bug Something isn't working non-breaking Non-breaking change labels Oct 19, 2026
@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a05f967

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 81c3a6c

1 similar comment
@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 81c3a6c

@bdice

bdice commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 60d9966

@bdice

bdice commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 17ad09a

@bdice

bdice commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test acaf7cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant