Skip to content

[sync] sync feature/shardformer with develop#3931

Merged
FoolPlayer merged 14 commits intohpcaitech:mainfrom
FrankLeeeee:sync/develop-to-shardformer
Jun 9, 2023
Merged

[sync] sync feature/shardformer with develop#3931
FoolPlayer merged 14 commits intohpcaitech:mainfrom
FrankLeeeee:sync/develop-to-shardformer

Conversation

@FrankLeeeee
Copy link
Copy Markdown
Contributor

📌 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

N/A

📝 What does this PR do?

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

This PR syncs the feature/shardformer with the develop branch to bring the changes of dtensor and device mesh to the feature/shardformer branch.

💥 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.

ver217 and others added 14 commits May 25, 2023 13:09
* [dtensor] polish sharding spec docstring

* [dtensor] polish sharding spec example docstring
…develop

[sync] sync feature/dtensor with develop
* [doc] add lazy init en doc

* [doc] add lazy init zh doc

* [doc] add lazy init doc in sidebar

* [doc] add lazy init doc test

* [doc] fix lazy init doc link
[feature] updated device mesh and dtensor
* init shardformer code structure

* add implement of sharder (inject and replace)

* add implement of replace layer to colossal layer

* separate different layer policy, add some notion

* implement 1d and 2d slicer, can tell col or row

* fix bug when slicing and inject model

* fix some bug; add inference test example
…caitech#3816)

* init shardformer code structure

* add implement of sharder (inject and replace)

* add implement of replace layer to colossal layer

* separate different layer policy, add some notion

* implement 1d and 2d slicer, can tell col or row

* fix bug when slicing and inject model

* fix some bug; add inference test example

* add share weight and train example

* add train

* add docstring and readme

* add docstring for other files

* pre-commit
* [shardformer] refactored the user api

* polish code
* update readme with modules content

* remove img
…caitech#3856)

* add dropout layer, add dropout test

* modify seed manager as context manager

* add a copy of col_nn.layer

* add dist_crossentropy loss; separate module test

* polish the code

* fix dist crossentropy loss
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2023

The code coverage for the changed files is 57%.

Click me to view the complete report
Name                                                      Stmts   Miss  Cover
-----------------------------------------------------------------------------
colossalai/device/device_mesh.py                            143      6    96%
colossalai/lazy/lazy_init.py                                299     40    87%
colossalai/nn/layer/parallel_1d/_operation.py                53     26    51%
colossalai/shardformer/__init__.py                            0      0   100%
colossalai/shardformer/layer/__init__.py                      0      0   100%
colossalai/shardformer/layer/_operation.py                   54     54     0%
colossalai/shardformer/layer/dist_crossentropy.py            49     49     0%
colossalai/shardformer/layer/dropout.py                      32     32     0%
colossalai/shardformer/layer/layers.py                      464    464     0%
colossalai/shardformer/model/__init__.py                      0      0   100%
colossalai/shardformer/model/modeling_bert.py                20     20     0%
colossalai/shardformer/policies/__init__.py                   0      0   100%
colossalai/shardformer/policies/autopolicy.py                22     22     0%
colossalai/shardformer/policies/basepolicy.py                49     49     0%
colossalai/shardformer/policies/bert.py                      40     40     0%
colossalai/shardformer/policies/gpt2.py                      35     35     0%
colossalai/shardformer/shard/__init__.py                      4      4     0%
colossalai/shardformer/shard/shard_config.py                 14     14     0%
colossalai/shardformer/shard/sharder.py                     123    123     0%
colossalai/shardformer/shard/slicer.py                       50     50     0%
colossalai/shardformer/utils/__init__.py                      0      0   100%
colossalai/shardformer/utils/utils.py                        28     28     0%
colossalai/tensor/comm_spec.py                              253     93    63%
colossalai/tensor/d_tensor/__init__.py                        3      0   100%
colossalai/tensor/d_tensor/comm_spec.py                     151     35    77%
colossalai/tensor/d_tensor/d_tensor.py                       67     11    84%
colossalai/tensor/d_tensor/layout.py                         38      1    97%
colossalai/tensor/d_tensor/layout_converter.py              202     13    94%
colossalai/tensor/d_tensor/sharding_spec.py                 105     14    87%
tests/test_device/test_device_mesh.py                        11      1    91%
tests/test_device/test_init_logical_pg.py                    27      1    96%
tests/test_lazy/lazy_init_utils.py                           71     14    80%
tests/test_lazy/test_distribute.py                           73      3    96%
tests/test_tensor/test_dtensor/test_comm_spec.py             81      1    99%
tests/test_tensor/test_dtensor/test_dtensor.py               67      5    93%
tests/test_tensor/test_dtensor/test_layout_converter.py      91      1    99%
tests/test_tensor/test_shape_consistency.py                  50      2    96%
tests/test_tensor/test_sharded_linear.py                    130      1    99%
tests/test_tensor/test_sharding_spec.py                      13      1    92%
-----------------------------------------------------------------------------
TOTAL                                                      2912   1253    57%

@FoolPlayer FoolPlayer merged commit 24651fd into hpcaitech:main Jun 9, 2023
@FrankLeeeee FrankLeeeee deleted the sync/develop-to-shardformer branch June 9, 2023 01:34
@FrankLeeeee FrankLeeeee restored the sync/develop-to-shardformer branch June 9, 2023 01:44
@FrankLeeeee FrankLeeeee deleted the sync/develop-to-shardformer branch June 9, 2023 01:48
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.

3 participants