[diffusion] chore: revise process title#18446
Conversation
Summary of ChangesHello @mickqian, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the clarity and debuggability of GPU worker processes within the diffusion module by revising their naming convention. The change ensures that process titles are set after the distributed environment is fully initialized and incorporates detailed information about the active model parallel groups, allowing for easier identification and monitoring of individual processes in a distributed setup. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
/tag-and-rerun-ci |
There was a problem hiding this comment.
Code Review
This pull request revises how the process title is set for diffusion workers, providing more detailed information about the parallelization strategy being used. The change is a good improvement for observability. I've suggested a small refactoring to make the new title-building logic more concise and maintainable.
| suffix = "" | ||
| if get_tp_world_size() != 1: | ||
| tp_rank = get_tp_rank() | ||
| suffix += f"_TP{tp_rank}" | ||
| if get_ulysses_parallel_world_size() != 1: | ||
| u_rank = get_ulysses_parallel_rank() | ||
| suffix += f"_U{u_rank}" | ||
| if get_ring_parallel_world_size() != 1: | ||
| r_rank = get_ring_parallel_rank() | ||
| suffix += f"_R{r_rank}" | ||
| if get_classifier_free_guidance_world_size() != 1: | ||
| c_rank = get_classifier_free_guidance_rank() | ||
| suffix += f"_C{c_rank}" |
There was a problem hiding this comment.
The code for building the process title suffix is a bit repetitive. You can make it more concise and maintainable by using a data-driven approach with a list comprehension. This avoids repeating the if world_size != 1 check and string concatenation logic.
parallel_info = [
("TP", get_tp_world_size, get_tp_rank),
("U", get_ulysses_parallel_world_size, get_ulysses_parallel_rank),
("R", get_ring_parallel_world_size, get_ring_parallel_rank),
("C", get_classifier_free_guidance_world_size, get_classifier_free_guidance_rank),
]
suffix = "".join([
f"_{prefix}{rank_fn()}"
for prefix, world_size_fn, rank_fn in parallel_info
if world_size_fn() != 1
])* www/pr/ks: (265 commits) [BugFix][PD]Fix metadata_buffer_index leak when aborted in PD (sgl-project#17483) Refactoring Mooncake TE as a shared distributed component (sgl-project#17810) [ModelOPT] Support Qwen 3 Next Coder NVFP4 (sgl-project#18224) Update author information in pyproject.toml (sgl-project#18453) [Kimi-K2.5] Fix missing `quant_config` in `KimiK25` (sgl-project#18440) Add tensor parallelism support to LFM2 ShortConv layers (sgl-project#17777) [diffusion] chore: revise process title (sgl-project#18446) Fix TRT-LLM MLA backend applying k_scale to BF16 KV cache in BMM1 (sgl-project#18396) [diffusion] refactor: group component loaders under the component_loaders/ directory (sgl-project#18438) [ModelOpt] Fix broken Qwen3-235B-A22B-Instruct-2507-NVFP4 launch (sgl-project#18189) [diffusion] feat: support efficient sequence shard (sgl-project#18161) [CI] fix: notebook ci may not working (sgl-project#18417) fix: sync server_args.kv_cache_dtype when detecting FP8 KV cache (sgl-project#18394) [Fix] Fix backend selection after flashinfer version update (sgl-project#18364) [diffusion] platform: support WAN/FLUX/Qwen-Image/Qwen-Image-edit on Ascend (sgl-project#13662) fix: fix NVFP4 Kimi-K2.5 weight mapping and exclude list (sgl-project#18370) [diffusion] feat: support saving videos directly on the server to avoid the overhead of tensor transfer (sgl-project#18253) [diffusion] fix: respect dist_timeout option (sgl-project#18386) [Doc] Fix outdated `--fp4-gemm-backend` documentation (sgl-project#18350) [diffusion] fix: remove unnecessary norm_type argument from GLM-Image dits (sgl-project#18382) ...
after this PR, the setting of
--num-gpus=4 --ulysses-degree=2 --enable-cfg-parallelwould look like this in nvidia-smi:Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci