mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-12-03 04:13:20 +00:00
[PP Middleware] Add bwd and step for PP middleware (#2111)
* add bwd and step for PP middleware * pre-commit Co-authored-by: Ziyue Jiang <ziyue.jiang@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ class MLP(nn.Module):
|
||||
def forward(self, x):
|
||||
for layer in self.layers:
|
||||
x = layer(x)
|
||||
return x
|
||||
return x.sum()
|
||||
|
||||
class DAG_MLP(nn.Module):
|
||||
def __init__(self, dim: int, layers: int):
|
||||
@@ -46,7 +46,7 @@ class DAG_MLP(nn.Module):
|
||||
for layer in self.layers:
|
||||
x = layer(x)
|
||||
y = self.dag_layer(y)
|
||||
return x, y
|
||||
return x.sum(), y.sum()
|
||||
|
||||
class RpcTestModel(nn.Module):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user