MCPcopy Create free account
hub / github.com/THUDM/GLM / forward

Method forward

mpu/layers.py:233–243  ·  view source on GitHub ↗
(self, input_)

Source from the content-addressed store, hash-verified

231 stride=stride, return_master_weight=keep_master_weight_for_test)
232
233 def forward(self, input_):
234 # Set up backprop all-reduce.
235 input_parallel = copy_to_model_parallel_region(input_)
236 # Matrix multiply.
237 output_parallel = F.linear(input_parallel, self.weight, self.bias)
238 if self.gather_output:
239 # All-gather across the partitions.
240 output = gather_from_model_parallel_region(output_parallel)
241 else:
242 output = output_parallel
243 return output
244
245
246class RowParallelLinear(torch.nn.Module):

Callers

nothing calls this directly

Tested by

no test coverage detected