-
Notifications
You must be signed in to change notification settings - Fork 27
container level timeouts #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,12 +2,16 @@ | |||||||||||||||||||||||||||||||||||||||||
| # Modal apps on specific devices. We will fix this later. | ||||||||||||||||||||||||||||||||||||||||||
| from modal_runner import app, cuda_image, modal_run_config | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Container-level timeout (seconds) - kills container regardless of GPU state | ||||||||||||||||||||||||||||||||||||||||||
| # This is the nuclear option for hung GPUs that don't respond to signals | ||||||||||||||||||||||||||||||||||||||||||
| MODAL_CONTAINER_TIMEOUT = 300 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
4
to
+8
|
||||||||||||||||||||||||||||||||||||||||||
| # Container-level timeout (seconds) - kills container regardless of GPU state | |
| # This is the nuclear option for hung GPUs that don't respond to signals | |
| MODAL_CONTAINER_TIMEOUT = 300 | |
| import os | |
| # Container-level timeout (seconds) - kills container regardless of GPU state | |
| # This is the nuclear option for hung GPUs that don't respond to signals | |
| # Make this configurable and give it a higher default than any expected signal timeout. | |
| def _get_modal_container_timeout(default: int = 900) -> int: | |
| raw = os.getenv("MODAL_CONTAINER_TIMEOUT") | |
| if raw is None: | |
| return default | |
| try: | |
| value = int(raw) | |
| return value if value > 0 else default | |
| except (TypeError, ValueError): | |
| return default | |
| MODAL_CONTAINER_TIMEOUT = _get_modal_container_timeout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout calculation logic doesn't account for different submission modes. The code only uses "ranked_timeout" from config, but according to the codebase, there are three different timeout values: "test_timeout", "benchmark_timeout", and "ranked_timeout" corresponding to different submission modes (test, benchmark, leaderboard). This means test and benchmark submissions will incorrectly use the ranked_timeout value (180s default) instead of their respective timeout values. Consider using a similar approach to the one in src/libkernelbot/launchers/github.py which has a get_timeout function that properly maps the mode to the correct timeout value.