Skip to content

Commit 819156e

Browse files
committed
Merge branch 'main' into pipe
2 parents 053eee5 + 3d35a26 commit 819156e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2589
-1046
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, reopened, synchronize]
66
branches:
77
- 'dev'

.vim-arsync

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
remote_host qiyuan
2+
remote_user hanxv
3+
remote_port '0'
4+
remote_path /home/hanxv/workspace/BMTrain/
5+
local_path /Users/tachicoma/projects/BMTrain/
6+
ignore_dotfiles 0
7+
ignore_path ["*.pt", "*.nsys-rep"]
8+
auto_sync_up 1
9+
remote_or_local remote
10+
sleep_before_sync 0
11+
rsync_flags ["--max-size=10m"]

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
</div>
2929

3030
## What's New
31+
- 2024/02/26 **BMTrain** [1.0.0](https://github.com/OpenBMB/BMTrain/releases/tag/v1.0.0) released. Code refactoring and Tensor parallel support. See the detail in [update log](docs/UPDATE_1.0.0.md)
32+
- 2023/08/17 **BMTrain** [0.2.3](https://github.com/OpenBMB/BMTrain/releases/tag/v0.2.3) released. See the [update log](docs/UPDATE_0.2.3.md).
3133
- 2022/12/15 **BMTrain** [0.2.0](https://github.com/OpenBMB/BMTrain/releases/tag/0.2.0) released. See the [update log](docs/UPDATE_0.2.0.md).
3234
- 2022/06/14 **BMTrain** [0.1.7](https://github.com/OpenBMB/BMTrain/releases/tag/0.1.7) released. ZeRO-2 optimization is supported!
3335
- 2022/03/30 **BMTrain** [0.1.2](https://github.com/OpenBMB/BMTrain/releases/tag/0.1.2) released. Adapted to [OpenPrompt](https://github.com/thunlp/OpenPrompt)and [OpenDelta](https://github.com/thunlp/OpenDelta).
@@ -51,7 +53,7 @@ Our [documentation](https://bmtrain.readthedocs.io/en/latest/index.html) provide
5153

5254
- From pip (recommend) : ``pip install bmtrain``
5355

54-
- From source code: download the package and run ``python setup.py install``
56+
- From source code: download the package and run ``pip install .``
5557

5658
Installing BMTrain may take a few to ten minutes, as it requires compiling the c/cuda source code at the time of installation.
5759
We recommend compiling BMTrain directly in the training environment to avoid potential problems caused by the different environments.
@@ -68,7 +70,6 @@ Before you can use BMTrain, you need to initialize it at the beginning of your c
6870
import bmtrain as bmt
6971
bmt.init_distributed(
7072
seed=0,
71-
zero_level=3, # support 2 and 3 now
7273
# ...
7374
)
7475
```
@@ -118,9 +119,9 @@ class MyModule(bmt.DistributedModule): # changed here
118119
super().__init__()
119120
self.param = bmt.DistributedParameter(torch.empty(1024)) # changed here
120121
self.module_list = torch.nn.ModuleList([
121-
bmt.Block(SomeTransformerBlock()), # changed here
122-
bmt.Block(SomeTransformerBlock()), # changed here
123-
bmt.Block(SomeTransformerBlock()) # changed here
122+
bmt.Block(SomeTransformerBlock(), zero_level=3), # changed here, support 2 and 3 now
123+
bmt.Block(SomeTransformerBlock(), zero_level=3), # changed here, support 2 and 3 now
124+
bmt.Block(SomeTransformerBlock(), zero_level=3) # changed here, support 2 and 3 now
124125
])
125126

126127
def forward(self):
@@ -181,7 +182,8 @@ class MyModule(bmt.DistributedModule):
181182

182183
def forward(self):
183184
x = self.param
184-
x = self.module_list(x, 1, 2, 3) # changed here
185+
for module in self.module_list:
186+
x = module(x, 1, 2, 3)
185187
return x
186188

187189
```

0 commit comments

Comments
 (0)