debug-cudf-pandas

Diagnose and fix pandas test suite failures under the cudf.pandas GPU compatibility layer.

9.7k|1.1k|Updated May 7, 2017
One-click install
npx skills add https://github.com/rapidsai/cudf --skill debug-cudf-pandas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cudf-pandas
Source: https://github.com/rapidsai/cudf/tree/main/.agents/skills/debug-cudf-pandas
Command: npx skills add https://github.com/rapidsai/cudf --skill debug-cudf-pandas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When the pandas test suite runs under cudf.pandas (the zero-code-change GPU accelerator), failing tests can stem from cudf implementation bugs, proxy/dispatch issues, missing proxy registrations, conversion bugs, or environment gaps. This Skill provides a systematic workflow to reproduce failures, isolate the root cause, implement a correct fix, and verify it without regressions.

Core Features & Use Cases

  • Structured diagnosis pipeline: Reproduce failures with the pandas test harness, compare direct cudf behavior against pandas, and use environment variables like CUDF_PANDAS_FAIL_ON_FALLBACK and LOG_FAST_FALLBACK to trace proxy-layer fallbacks.
  • Guardrails against bad fixes: Enforces rules prohibiting test-specific special cases, CPU fallback as a fix, private pandas APIs, pyarrow as an execution backend, and behavior that diverges from pandas.
  • xfail/skip marker management: Guides updates to the pandas-testing-plugin.py dictionaries and dependency additions via dependencies.yaml and rapids-dependency-file-generator.
  • Use Case: Given a failing node ID like tests/groupby/test_reductions.py::test_first_last_skipna[Float64-False-False-first], reproduce it, determine whether the bug is in cudf core or the proxy layer, implement a minimal fix, and verify no module-level regressions.

Quick Start

Debug the failing pandas test tests/groupby/test_reductions.py::test_first_last_skipna under cudf.pandas and implement a fix.

Frequently Asked Questions about debug-cudf-pandas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a failing pandas test under cudf.pandas?

Run the failing pytest node ID with bash python/cudf/cudf/pandas/scripts/run-pandas-tests.sh followed by the node ID and -xvs. Then write a minimal script comparing direct cudf output to pandas output to determine whether the bug is in cudf core or the proxy layer.

How do I trace GPU-to-CPU fallback in cudf.pandas?

Set CUDF_PANDAS_FAIL_ON_FALLBACK=1 to raise instead of silently falling back, or LOG_FAST_FALLBACK=1 to log every fallback with function name and exception. CUDF_PANDAS_DEBUGGING=1 runs both paths in parallel and warns on divergence.

Can I fix cudf.pandas test failures by forcing CPU fallback?

No, forcing pandas CPU fallback by raising exceptions inside cudf is prohibited as a fix. Fallback is only acceptable when supporting the behavior would require implementing large, entirely new cudf features, and even then it needs user approval.

Why does a pandas test fail even without cudf.pandas enabled?

If the test also fails under vanilla pandas, the cause is environmental or upstream, not a cudf bug. Common causes include missing packages like xlsxwriter or lxml that pandas CI installs, version mismatches, or a genuine pandas test bug.

What are the limitations of this debugging workflow?

The workflow stops when a fix requires modifying .pyx, .cu, .cuh, or CMakeLists.txt files since compilation is out of scope. It also stops when divergence from pandas is intentional or after three investigation cycles without convergence.