ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[hotfix]: Remove math.prod dependency

Open JThh opened this issue 2 years ago • 3 comments

📌 Checklist before creating the PR

  • [x] I have created an issue for this PR for traceability
  • [x] 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

Fixed #2832

📝 What does this PR do?

Removes dependency on the math.prod functionality and replaces it with reduce and operator.mul that are backward compatible with Python3.7.

💥 Checklist before requesting a review

  • [x] I have linked my PR to an issue (instruction)
  • [x] My issue clearly describes the problem/feature/proposal, with diagrams/charts/table/code if possible
  • [x] 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?

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

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

JThh avatar Feb 20 '23 11:02 JThh

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4222743567. Read our "CONTRIBUTING.md" for more reference to the code style.

github-actions[bot] avatar Feb 21 '23 09:02 github-actions[bot]

The code coverage for the changed files is 89%.

Click me to view the complete report
Name                               Stmts   Miss  Cover
------------------------------------------------------
colossalai/nn/_ops/view.py            63      8    87%
colossalai/tensor/colo_tensor.py     165     16    90%
------------------------------------------------------
TOTAL                                228     24    89%

github-actions[bot] avatar Feb 21 '23 10:02 github-actions[bot]

Hi, @JThh The pre-commit CI fails. Could you polish your code with pre-commit? You can refer to https://github.com/hpcaitech/ColossalAI/blob/main/CONTRIBUTING.md#code-style

binmakeswell avatar Feb 22 '23 03:02 binmakeswell

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4252824424. Read our "CONTRIBUTING.md" for more reference to the code style.

github-actions[bot] avatar Feb 23 '23 12:02 github-actions[bot]

The code coverage for the changed files is 89%.

Click me to view the complete report
Name                               Stmts   Miss  Cover
------------------------------------------------------
colossalai/nn/_ops/view.py            63      8    87%
colossalai/tensor/colo_tensor.py     165     16    90%
------------------------------------------------------
TOTAL                                228     24    89%

github-actions[bot] avatar Feb 23 '23 13:02 github-actions[bot]

The code coverage for the changed files is 89%.

Click me to view the complete report
Name                               Stmts   Miss  Cover
------------------------------------------------------
colossalai/nn/_ops/view.py            63      8    87%
colossalai/tensor/colo_tensor.py     165     16    90%
------------------------------------------------------
TOTAL                                228     24    89%

github-actions[bot] avatar Feb 23 '23 13:02 github-actions[bot]