-
Notifications
You must be signed in to change notification settings - Fork 96
Error Handling #174
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
Open
surfiniaburger
wants to merge
20
commits into
meta-pytorch:main
Choose a base branch
from
surfiniaburger:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Error Handling #174
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit fixes a critical bug where the Gunicorn server for the DIPG environment would crash when receiving a malformed string from the LLM. The crash was caused by unhandled exceptions in the reward functions during string parsing. This commit addresses the issue by: 1. **Hardening Reward Functions:** Wrapping the parsing logic within each reward function in `dipg_environment.py` with a `try...except` block. This ensures that any malformed string will be caught, penalized with a `missing_answer_penalty`, and will no longer crash the server process. 2. **Adding a Regression Test:** A new test case, `test_malformed_step`, has been added to `test_dipg_environment.py`. This test sends a known problematic string to the server to verify that it handles the error gracefully and does not crash, preventing future regressions. 3. **Client-Side Resilience:** The Jupyter notebook `dipg-rl.ipynb` was also updated to make the training loop more resilient. It now catches `ReadTimeout` and `ConnectionError` exceptions, which can occur if the server crashes for any reason, and continues the training process.
…med-input Fix server crash on malformed LLM responses
This commit provides a comprehensive fix for the training script crashes caused by `ReadTimeout` and `ConnectionError` exceptions. The root cause was the environment server crashing on malformed LLM-generated strings. This commit addresses the issue on multiple levels: 1. **Server-Side Robustness:** The core logic in `dipg_environment.py` has been hardened. The `step` function, which calculates rewards, now contains a `try...except` block that catches any exception during reward calculation. This prevents a single malformed response from crashing the entire server process. Instead, an error is logged, and a penalty is assigned. 2. **Client-Side Resilience:** A new file, `reward_function.py`, has been created to provide the user with a corrected `create_reward_fn`. This function now correctly handles both `ConnectionError` and `ReadTimeout` exceptions, preventing the client-side training script from crashing and allowing it to continue robustly. 3. **Regression Testing:** The existing regression test, `test_malformed_step`, was used to verify that the server no longer crashes when receiving malformed input, ensuring the server-side fix is effective.
…med-input Fix Server Crash and Provide Robust Client-Side Function
update notebook
hierarchical logic
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
hierarchical logic
update notebook
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hardened the server so that it would not crash if the data were malformed.