Skip to content
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

ci: skip test_data_equal on the GPU machine #4260

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 26, 2024

This test crashes on the machine iZ0xih0eykcp6eddga4w5iZ with exit code 1: https://github.com/deepmodeling/deepmd-kit/actions/runs/11533273426/job/32106001782

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced test execution control to ensure compatibility with CPU environments during continuous integration.
  • Tests

    • Updated the test_data_equal method to conditionally skip tests based on the testing device and CI status.
    • Retained cleanup procedures in the tearDown method to ensure proper test environment management.

This test crashes on the machine iZ0xih0eykcp6eddga4w5iZ with exit code 1: https://github.com/deepmodeling/deepmd-kit/actions/runs/11533273426/job/32106001782

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz added Test CUDA Trigger test CUDA workflow and removed Python labels Oct 26, 2024
Copy link
Contributor

coderabbitai bot commented Oct 26, 2024

📝 Walkthrough

Walkthrough

The pull request modifies the test_io.py file to enhance the IOTest class and its test methods. It introduces a conditional test skipping mechanism based on the testing environment by adding an import statement for CI and TEST_DEVICE. The test_data_equal method is updated with a decorator to skip tests when the device is not CPU and the CI flag is set. The tearDown method is explicitly called in the TestDeepPot class, ensuring proper cleanup after tests. Overall, the changes focus on control flow enhancements without altering core test logic.

Changes

File Path Change Summary
source/tests/consistent/io/test_io.py - Added import for CI and TEST_DEVICE.
- Updated test_data_equal with conditional skip decorator.
- Explicitly called tearDown in TestDeepPot.

Possibly related PRs

  • chore(ci): skip more tests on GPU CI #4200: This PR introduces the CI variable in source/tests/utils.py, which is directly related to the changes in the main PR that also involve the use of the CI variable for conditional test skipping in test_io.py.
  • ci: limit downloaded files in build_docker #4242: This PR modifies the workflow to limit downloaded files, which indirectly relates to the CI environment changes in the main PR, as both involve improving the CI process, although it does not directly affect the test logic.
  • ci: bump tensorflow/build image to 2.18 #4252: This PR updates the TensorFlow build image, which may relate to the overall CI environment but does not have a direct connection to the test modifications in the main PR.

Suggested labels

Python

Suggested reviewers

  • iProzd
  • wanghan-iapcm

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
source/tests/consistent/io/test_io.py (1)

74-74: Consider documenting and investigating the GPU limitation

While skipping the test is a valid short-term solution, consider:

  1. Adding a comment in the test explaining why it's CPU-only
  2. Creating a tracking issue to investigate the root cause of GPU failures
  3. Adding this limitation to the testing documentation

Example comment to add above the decorator:

# This test is currently limited to CPU due to crashes on GPU machines in CI
# See issue #<number> for tracking the investigation of GPU compatibility

Would you like me to help create a tracking issue for investigating the GPU compatibility of this test?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fa61d69 and bb0206f.

📒 Files selected for processing (1)
  • source/tests/consistent/io/test_io.py (2 hunks)
🔇 Additional comments (1)
source/tests/consistent/io/test_io.py (1)

24-27: LGTM: Clean import additions

The new imports for CI and TEST_DEVICE are well-organized and necessary for implementing the conditional test skipping mechanism.

source/tests/consistent/io/test_io.py Show resolved Hide resolved
@github-actions github-actions bot removed the Test CUDA Trigger test CUDA workflow label Oct 26, 2024
@njzjz
Copy link
Member Author

njzjz commented Oct 26, 2024

It works.

@njzjz njzjz requested a review from wanghan-iapcm October 26, 2024 18:22
@njzjz
Copy link
Member Author

njzjz commented Oct 26, 2024

But I am still wondering what is the reason for the crash. Is it due to out-of-memory? @caic99 Are there detailed logs on that machine?

Copy link

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.23%. Comparing base (fa61d69) to head (bb0206f).
Report is 3 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #4260   +/-   ##
=======================================
  Coverage   84.23%   84.23%           
=======================================
  Files         549      549           
  Lines       51462    51463    +1     
  Branches     3051     3051           
=======================================
+ Hits        43348    43349    +1     
- Misses       7153     7154    +1     
+ Partials      961      960    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Oct 28, 2024
Merged via the queue into deepmodeling:devel with commit aba932c Oct 28, 2024
63 checks passed
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