Skip to content

Allow to disable stdout hiding for TP#44608

Merged
michaelbenayoun merged 4 commits intohuggingface:mainfrom
michaelbenayoun:tp_hide_stdout_option
Mar 12, 2026
Merged

Allow to disable stdout hiding for TP#44608
michaelbenayoun merged 4 commits intohuggingface:mainfrom
michaelbenayoun:tp_hide_stdout_option

Conversation

@michaelbenayoun
Copy link
Member

What does this PR do?

By default, initialize_tensor_parallelism hides stdout and stderr for ranks > 0. While convenient, this is not perfect for dev and debugging. I suggest we simply add a flag to be able to disable this feature if wanted.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

device_map = tp_device
# Silence output for non-primary ranks
if index > 0:
if index > 0 and os.environ.get("HF_TP_SILENCE_NON_PRIMARY_RANK_OUTPUT", "1") == "1":
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to enable stdout on all ranks by default and filter through torchrun using --local-ranks-filter <local rank>. What do you think ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we could do that. Because the current behavior is kind of unexpected.

@michaelbenayoun
Copy link
Member Author

Done

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, clap, gpt_neox_japanese, jamba, lasr, lfm2, lfm2_moe, olmo3, paddleocr_vl, qwen2_5_vl, qwen2_vl, sam_hq, vibevoice_acoustic_tokenizer, vibevoice_asr

@michaelbenayoun michaelbenayoun added this pull request to the merge queue Mar 12, 2026
Merged via the queue into huggingface:main with commit 745341d Mar 12, 2026
28 checks passed
@michaelbenayoun michaelbenayoun deleted the tp_hide_stdout_option branch March 12, 2026 19:36
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.

3 participants