Repository navigation
Wire up Daft execution/S3 tuning and fix Ray parallelism collapse - #18
Merged
Merged
Conversation
The DAFT_* and S3_* knobs in config.py were never applied: the project never called daft.set_execution_config, and daft only reads a handful of DAFT_* env vars natively; daft_io_config also dropped every S3 tuning field. configure_daft_runner now applies the execution config for both runners and S3Config receives connections/retries/timeouts. Analyze stages read a tiny manifest, so byte-based scan task splitting never kicks in and the whole download+analysis chain ran as a single Ray task. spread_partitions splits the manifest before download (ANALYZE_NUM_PARTITIONS, auto = 2x cluster CPUs on Ray), and coalesce_for_write merges partitions before write_json so parallelism does not translate into tiny output files. write_lance calls now honor LANCE_MAX_ROWS_PER_FILE / LANCE_MAX_BYTES_PER_FILE. Stability: model UDFs get max_retries=2, actor ready timeout raised to 600s for cold starts that download models, and the DeepSeek llm_prompt gets concurrency (DEEPSEEK_CONCURRENCY) and on_error="ignore" backed by the existing try_deserialize/fill_null null handling.
This was referenced Jul 15, 2026
Merged
FANNG1
pushed a commit
that referenced
this pull request
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
对照 Daft v0.7.15 源码 review 后发现:项目里定义的大部分调优参数从未真正传给 Daft,而且大规模在 Ray 上跑时并行度会坍缩成单个 task。
config.py里的DAFT_*变量是死配置——项目从未调用daft.set_execution_config,而 Daft 原生只从环境读取少数几个DAFT_*变量(DaftExecutionConfig::from_env)。daft_io_config()没有把任何 S3 调优字段传进去(max_connections、重试、超时、retry mode)。改动
接通死配置
configure_daft_runner()对 native 和 Ray 两种 runner 都调用daft.set_execution_config(...)(morsel size、dynamic batching、scan task 切分/合并、JSON 目标文件大小、maintain_order、actor 就绪超时)。S3Config补齐max_connections/num_tries/ 退避 / 连接+读取超时 /retry_mode。修复并行度坍缩
ANALYZE_NUM_PARTITIONS(默认 auto):spread_partitions()在下载前切分 manifest;Ray 模式自动推导为 2× 集群 CPU 数。image 和 audio 两个 analyze 都已接入。coalesce_for_write()在write_json前把分区收敛到约 N/8,高并行度不会转化为大量小输出文件。write_lance调用全部传入LANCE_MAX_ROWS_PER_FILE/LANCE_MAX_BYTES_PER_FILE(此前也是死配置),在 pylance 7 禁用 blob compaction 期间由写入侧控制 fragment 大小。稳定性
ImageQualityUDF、_ImageEmbedUDF、AsrUDF、_EmbedUDF)加max_retries=2。DAFT_ACTOR_UDF_READY_TIMEOUT默认 300 → 600(大量 actor 同时冷启动 + 首次下载模型的场景)。llm_prompt增加concurrency=DEEPSEEK_CONCURRENCY(新配置,默认 8)和on_error="ignore",由已有的try_deserialize/fill_null兜底 null。验证
spread_partitions各分支、coalesce_for_write)。set_execution_config生效(default_morsel_size=32、actor_udf_ready_timeout=600等)。