Skip to content

[shardformer] Refactor shardformer api#4001

Merged
FrankLeeeee merged 7 commits intohpcaitech:refactor/shardformerfrom
FoolPlayer:refactor/shardformer
Jun 15, 2023
Merged

[shardformer] Refactor shardformer api#4001
FrankLeeeee merged 7 commits intohpcaitech:refactor/shardformerfrom
FoolPlayer:refactor/shardformer

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

fixed #4000

📝 What does this PR do?

Refactor shardformer api to integrate with d_tensor, etc

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

Comment on lines 112 to 113
staticmethod1,
staticmethod2,
Copy link
Copy Markdown
Contributor

@FrankLeeeee FrankLeeeee Jun 15, 2023

Choose a reason for hiding this comment

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

The element in the param_replacement list is not staticmethod, it is just function.

Comment thread colossalai/shardformer/policies/basepolicy.py
@staticmethod
def inject_policy() -> Union[Tuple[nn.Module, nn.Module], None]:
@abstractmethod
def new_model_class(self) -> Union[nn.Module, None]:
Copy link
Copy Markdown
Contributor

@FrankLeeeee FrankLeeeee Jun 15, 2023

Choose a reason for hiding this comment

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

-> Union[Type[nn.Module], None].

Comment thread colossalai/shardformer/policies/bert.py Outdated
Comment on lines +57 to +59
def new_model_class(self):
# do nothing
return self.model
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should return None?

@FrankLeeeee FrankLeeeee linked an issue Jun 15, 2023 that may be closed by this pull request
@FrankLeeeee FrankLeeeee merged commit 1700db5 into hpcaitech:refactor/shardformer Jun 15, 2023
@FoolPlayer FoolPlayer deleted the refactor/shardformer branch June 16, 2023 01:45
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 16, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
FrankLeeeee pushed a commit that referenced this pull request Jun 16, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 21, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
FrankLeeeee pushed a commit that referenced this pull request Jun 26, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
flybird11111 pushed a commit to flybird11111/ColossalAI that referenced this pull request Jul 3, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
FrankLeeeee pushed a commit that referenced this pull request Jul 4, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
ver217 pushed a commit to ver217/ColossalAI that referenced this pull request Jul 13, 2023
* fix an error in readme

* simplify code

* refactor shardformer

* add todo

* remove slicer

* resolve code review
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.

[shardformer] refactor shardformer api

2 participants