Skip to content

Conversation

@AzizCode92
Copy link
Contributor

@AzizCode92 AzizCode92 commented Sep 4, 2025

Purpose

The __exit__ method of the RemoteOpenAIServer is not sufficient to clean up GPU memory.
This creates a race condition between the different tests in CI.
This PR ensures we properly clean the GPU memory when exiting the openAI remote server.

Solves: #24144

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@AzizCode92 AzizCode92 changed the title [feat]: ensure the gpu memory is cleaned when exiting the remote openAI remote server [fix]: ensure the gpu memory is cleaned when exiting the remote openAI remote server Sep 4, 2025
@AzizCode92 AzizCode92 marked this pull request as ready for review September 4, 2025 18:41
@AzizCode92 AzizCode92 changed the title [fix]: ensure the gpu memory is cleaned when exiting the remote openAI remote server [ci]: ensure the gpu memory is cleaned when exiting the remote openAI remote server Sep 4, 2025
@AzizCode92 AzizCode92 changed the title [ci]: ensure the gpu memory is cleaned when exiting the remote openAI remote server [ci/testing]: ensure the gpu memory is cleaned when exiting the remote openAI remote server Sep 4, 2025
tests/utils.py Outdated
self.proc.kill()
# GPU memory cleanup
try:
if torch.cuda.is_available():
Copy link
Member

Choose a reason for hiding this comment

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

Let's use current_platform so that the tests can run on other platforms as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

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.

2 participants