Added n_workers in generate_data for diffusion_FWI#1229
Added n_workers in generate_data for diffusion_FWI#1229Dibyajyoti-Chakraborty wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
Greptile OverviewGreptile SummaryThis PR adds a PR Description Notes:
Important Files Changed
Critical Issues Identified:
Recommendation: Before merging, implement proper GPU memory management (e.g., memory limits per worker, GPU locks, or torch multiprocessing) and address the formatting issues. Consider adding validation to ensure Confidence Score: 2/5 - While the performance optimization intent is valid, the implementation has significant resource management risks that could cause runtime failures. |
| args: list[tuple[str, str, int, int]] = [ | ||
| (filepath, output_path, i % num_gpus, user_source_frequency) | ||
| for i, filepath in enumerate(file_list) |
There was a problem hiding this comment.
logic: Multiple workers will be assigned to the same GPU (via modulo), but each worker loads models/data onto the same GPU device without coordination. This could cause CUDA out-of-memory errors. Have you tested this with multiple workers per GPU to ensure GPU memory usage doesn't exceed available VRAM?
There was a problem hiding this comment.
It has been tested. Default n_wrokers are set according to that.
String formatting in logging Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
PhysicsNeMo Pull Request
Description
Added option to multiple workers per GPU in
generate_data.pyfor diffusion_FWI. Now it can use multiple workers (default 8) for each GPU for faster generation.Checklist
Dependencies
Review Process
All PRs are reviewed by the PhysicsNeMo team before merging.
Depending on which files are changed, GitHub may automatically assign a maintainer for review.
We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.
AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.