[Story] Reduce Fallback in `cudf.pandas`
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
# Problem Statement
When cuDF fails to execute user code via `cudf.pandas` (due to unsupported APIs, OOM errors, etc.), `cudf.pandas` falls back to host execution using pandas. Currently, we run the pandas test suite with cudf.pandas with a fairly high pass rate, but with less than half of the tests running with GPU acceleration. This issue proposes how we plan to improve the latter case.
Ideally, we would accelerate 100% of the pandas API, but it is likely that we will never achieve that goal for the long tail of pandas features. More realistically, we should completely document all of cases that we do not accelerate and be able to test that we are accelerating what we want.
To achieve this, we need the following:
- [ ] Collect data on fallback: We should run the pandas suite with environment variable `LOG_FAST_FALLBACK=True` and new generate fallback logs. For example, here is what one log looks like after running on one of the tests in [Pandas](https://github.com/pandas-dev/pandas/tree/main/pandas/tests/frame).
```
{"debug_type": "LOG_FAST_FALLBACK", "failed_call": "pandas.core.indexes.timedeltas.timedelta_range(, start='1 day', periods=100, freq='D')", "exception": "NotImplementedError", "exception_message": "Fast implementation not available. Falling back to the slow implementation", "slow_object": "pandas.core.indexes.timedeltas.timedelta_range", "args_passed": ", start='1 day', periods=100, freq='D'", "kwargs_passed": {"start": "'1 day'", "periods": "100", "freq": "'D'"}, "args_types_passed": "", "kwargs_types_passed": "start=str, periods=int, freq=str"}
```
- [ ] Add documentation: We should document the steps to generate the fallback logs in the [developer documentation](https://docs.rapids.ai/api/cudf/stable/developer_guide/cudf_pandas/)
- [ ] Open Issues: Based off the logs generated we should open sub-issues of this one for each case of fallback that we believe we can improve. As each PR is merged, we can track the GPU usage rate as shown in the pandas test diff job summary
Contributor guide
Assessment
This issue has not been assessed yet.