Skip to content

fix(checkpoint): resolve relative path issue in Ray checkpoint writer#979

Open
cmgzn wants to merge 2 commits into
mainfrom
fix/checkpoint-relative-path
Open

fix(checkpoint): resolve relative path issue in Ray checkpoint writer#979
cmgzn wants to merge 2 commits into
mainfrom
fix/checkpoint-relative-path

Conversation

@cmgzn
Copy link
Copy Markdown
Collaborator

@cmgzn cmgzn commented May 14, 2026

Ray's write_parquet is executed by Ray workers whose working directory may differ from the main process. When checkpoint_dir or work_dir is a relative path (e.g., './tmp/...'), Ray workers cannot resolve it correctly, resulting in empty checkpoint directories.

Fix: convert work_dir and checkpoint_dir to absolute paths during PartitionedRayExecutor initialization.

Ray's write_parquet is executed by Ray workers whose working directory
may differ from the main process. When checkpoint_dir or work_dir is a
relative path (e.g., './tmp/...'), Ray workers cannot resolve it
correctly, resulting in empty checkpoint directories.

Fix: convert work_dir and checkpoint_dir to absolute paths during
PartitionedRayExecutor initialization.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the RayExecutorPartitioned class to ensure that work_dir and checkpoint_dir are converted to absolute paths. Feedback was provided regarding the unconditional use of os.path.abspath, which can corrupt remote URIs (such as S3 paths) and may lead to a TypeError if the path is null. It is recommended to implement checks to ensure absolute path conversion is only applied to local, non-null paths.

Comment thread data_juicer/core/executor/ray_executor_partitioned.py Outdated
Comment thread data_juicer/core/executor/ray_executor_partitioned.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant