Skip to content

[test] refactor tests with spawn#3452

Merged
FrankLeeeee merged 7 commits intohpcaitech:mainfrom
FrankLeeeee:feature/testing-utils
Apr 6, 2023
Merged

[test] refactor tests with spawn#3452
FrankLeeeee merged 7 commits intohpcaitech:mainfrom
FrankLeeeee:feature/testing-utils

Conversation

@FrankLeeeee
Copy link
Copy Markdown
Contributor

@FrankLeeeee FrankLeeeee commented Apr 5, 2023

📌 Checklist before creating the PR

  • I have created an issue for this PR for traceability
  • The title follows the standard format: [doc/gemini/tensor/...]: A concise description
  • I have added relevant tags if possible for us to better distinguish different PRs

🚨 Issue number

Link this PR to your issue with words like fixed to automatically close the linked issue upon merge

e.g. fixed #1234, closed #1234, resolved #1234

Fixed #3458

📝 What does this PR do?

Summarize your work here.
if you have any plots/diagrams/screenshots/tables, please attach them here.

This PR refactored the test-related code into the colossalai.testing module.

  • moved free_port to colossalai.testing as it is only used in testing
  • implemented the spawn function to automatically spawn a function with the same port
  • implemented the clear_cache_before_run decorator to lower the memory usage

💥 Checklist before requesting a review

  • I have linked my PR to an issue (instruction)
  • My issue clearly describes the problem/feature/proposal, with diagrams/charts/table/code if possible
  • I have performed a self-review of my code
  • I have added thorough tests.
  • I have added docstrings for all the functions/methods I implemented

⭐️ Do you enjoy contributing to Colossal-AI?

  • 🌝 Yes, I do.
  • 🌚 No, I don't.

Tell us more if you don't enjoy contributing to Colossal-AI.

@FrankLeeeee FrankLeeeee force-pushed the feature/testing-utils branch from 2b2f1b5 to 1e60a9b Compare April 6, 2023 01:41
@FrankLeeeee
Copy link
Copy Markdown
Contributor Author

Screenshot 2023-04-06 at 14 46 22

These two tests failed due to network error, I have tested them locally.

@FrankLeeeee FrankLeeeee enabled auto-merge (squash) April 6, 2023 06:50
@FrankLeeeee FrankLeeeee merged commit 80eba05 into hpcaitech:main Apr 6, 2023
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.

[FEATURE]: refactored tests with spawn

2 participants