#22360·cudf

[BUG] cudf-polars 串流模式广播错误

作者: mlubin创建于 2026年5月3日更新于 2026年9月22日
标签bugcudf-polars

from future import annotations

import numpy as np import polars as pl

def make_lf(n: int) -> pl.LazyFrame: return pl.LazyFrame({ "key": np.random.default_rng(0).integers(0, 100, size=n, dtype=np.int32), }).with_columns( pl.lit(np.arange(n, dtype=np.uint64)).alias("var_id"), )

def try_collect(n: int, executor: str) -> str: engine = pl.GPUEngine(raise_on_fail=True, executor=executor) try: df = make_lf(n).collect(engine=engine) return f"OK ({df.height} rows)" except RuntimeError as e: return f"FAIL: {e}"

if name == "main": print("Polars:", pl.version) import cudf print("cudf: ", cudf.version) print() for n in [100_000, 500_000, 1_000_000, 1_500_000, 2_000_000, 5_000_000]: print(f"n={n:>10} streaming: {try_collect(n, 'streaming')}") print() print(f"n={5_000_000:>10} in-memory: {try_collect(5_000_000, 'in-memory')}")