Skip to content

Honor timeout settings in subprocess run wrapper - #689

Open
ipanfilo wants to merge 2 commits into
devfrom
ipanfilo/run_timeout
Open

Honor timeout settings in subprocess run wrapper#689
ipanfilo wants to merge 2 commits into
devfrom
ipanfilo/run_timeout

Conversation

@ipanfilo

@ipanfilo ipanfilo commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix CI distributed tests RCCL EADDRINUSE failure after previous test timeout

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Torchrun timeout wrapper honors timeout setting from subprocess.run call

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@ipanfilo
ipanfilo requested a review from Micky774 August 1, 2026 01:14
@ipanfilo ipanfilo added the ci-level 2 CI test level 2 label Aug 1, 2026
@ipanfilo
ipanfilo marked this pull request as ready for review August 1, 2026 01:28
Comment on lines +37 to +40
explicit = int(os.environ.get("TE_DIST_LAUNCH_KILL_AFTER", "60"))
if run_timeout and run_timeout < 2*explicit:
return max(1, run_timeout // 2)
return max(1, explicit)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is run_timeout meant to be in contrast to explicit?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is timeout passed to subprocess.run(). If explicit is too high, we split run_timeout to terminate and kill parts

@ipanfilo
ipanfilo requested a review from Micky774 August 4, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-level 2 CI test level 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants