Skip to content

[WIP Fix pipe close warnings#129

Draft
H-Huang wants to merge 2 commits intometa-pytorch:mainfrom
H-Huang:fix_pg_pipe
Draft

[WIP Fix pipe close warnings#129
H-Huang wants to merge 2 commits intometa-pytorch:mainfrom
H-Huang:fix_pg_pipe

Conversation

@H-Huang
Copy link
Copy Markdown
Contributor

@H-Huang H-Huang commented Mar 10, 2025

I'm seeing the warnings below on program exit. This PR adds the shutdown method to atexit handler and rewrites the shutdown logic to exit cleanly which fixes the warnings.

got unexpected error in future handler: 
Traceback (most recent call last):
  File "/home/howardhuang/local/torchft/torchft/process_group.py", line 1168, in _future_handler
    cmd = future_pipe.recv(timedelta(seconds=10))
  File "/home/howardhuang/local/torchft/torchft/multiprocessing.py", line 21, in recv
    out = self._pipe.recv()
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError
got unexpected error in future handler: 
Traceback (most recent call last):
  File "/home/howardhuang/local/torchft/torchft/process_group.py", line 1168, in _future_handler
    cmd = future_pipe.recv(timedelta(seconds=10))
  File "/home/howardhuang/local/torchft/torchft/multiprocessing.py", line 21, in recv
    out = self._pipe.recv()
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/home/howardhuang/.conda/envs/torchft/lib/python3.10/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError
[W310 15:51:52.585664080 CudaIPCTypes.cpp:16] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 10, 2025
@H-Huang H-Huang changed the title Fix pipe close warnings [WIP] Fix pipe close warnings Mar 10, 2025
@H-Huang H-Huang requested a review from d4l3k March 10, 2025 22:55
@H-Huang H-Huang marked this pull request as draft March 10, 2025 23:36
@H-Huang H-Huang changed the title [WIP] Fix pipe close warnings Fix pipe close warnings Mar 12, 2025
@H-Huang H-Huang marked this pull request as ready for review March 12, 2025 14:38
@H-Huang H-Huang requested a review from fegin March 12, 2025 14:38
@H-Huang H-Huang marked this pull request as draft March 12, 2025 17:50
@H-Huang H-Huang changed the title Fix pipe close warnings [WIP Fix pipe close warnings Mar 12, 2025
@H-Huang H-Huang removed request for d4l3k and fegin March 12, 2025 17:51
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Mar 20, 2026

Hi @H-Huang!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants