MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / forward

Method forward

codegeex/megatron/model/module.py:180–186  ·  view source on GitHub ↗
(self, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

178 self.float16_convertor = float16_convertor
179
180 def forward(self, *inputs, **kwargs):
181 if mpu.is_pipeline_first_stage():
182 inputs = fp32_to_float16(inputs, self.float16_convertor)
183 outputs = self.module(*inputs, **kwargs)
184 if mpu.is_pipeline_last_stage():
185 outputs = float16_to_fp32(outputs)
186 return outputs
187
188 def state_dict(self, destination=None, prefix="", keep_vars=False):
189 return self.module.state_dict(destination, prefix, keep_vars)

Callers

nothing calls this directly

Calls 2

fp32_to_float16Function · 0.85
float16_to_fp32Function · 0.85

Tested by

no test coverage detected