Skip to content

[shardformer] add gpt2 policy and modify shard and slicer to support#3883

Merged
FrankLeeeee merged 3 commits intohpcaitech:feature/shardformerfrom
FoolPlayer:newpolicy
Jun 7, 2023
Merged

[shardformer] add gpt2 policy and modify shard and slicer to support#3883
FrankLeeeee merged 3 commits intohpcaitech:feature/shardformerfrom
FoolPlayer:newpolicy

Conversation

@FoolPlayer
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

📝 What does this PR do?

Add support to GPT2, and modify shard and slicer code to support multihead attention layer

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

@FoolPlayer FoolPlayer changed the title add gpt2 policy and modify shard and slicer to support [shardformer] add gpt2 policy and modify shard and slicer to support Jun 1, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2023

The code coverage for the changed files is 3%.

Click me to view the complete report
Name                                                Stmts   Miss  Cover
-----------------------------------------------------------------------
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               124    124     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%
-----------------------------------------------------------------------
TOTAL                                                1038   1011     3%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2023

The code coverage for the changed files is 2%.

Click me to view the complete report
Name                                                Stmts   Miss  Cover
-----------------------------------------------------------------------
colossalai/nn/layer/parallel_1d/_operation.py          53     35    34%
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               124    124     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%
-----------------------------------------------------------------------
TOTAL                                                1038   1020     2%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 7, 2023

The code coverage for the changed files is 3%.

Click me to view the complete report
Name                                                Stmts   Miss  Cover
-----------------------------------------------------------------------
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%
-----------------------------------------------------------------------
TOTAL                                                1037   1010     3%

@FrankLeeeee FrankLeeeee merged commit 69b1a22 into hpcaitech:feature/shardformer Jun 7, 2023
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 8, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 8, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 8, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
@FoolPlayer FoolPlayer deleted the newpolicy branch June 12, 2023 07:01
@FrankLeeeee FrankLeeeee added shardformer example example-related issuer or pull request labels Jun 15, 2023
FrankLeeeee pushed a commit that referenced this pull request Jun 26, 2023
…3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
flybird11111 pushed a commit to flybird11111/ColossalAI that referenced this pull request Jul 3, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
FrankLeeeee pushed a commit that referenced this pull request Jul 4, 2023
…3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
ver217 pushed a commit to ver217/ColossalAI that referenced this pull request Jul 13, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
ver217 pushed a commit to ver217/ColossalAI that referenced this pull request Jul 13, 2023
…pcaitech#3883)

* add gpt2 policy and modify shard and slicer to support

* remove unused code

* polish code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

example example-related issuer or pull request shardformer

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants