MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / forward

Method forward

DeepSpeedExample/megatron/model/module.py:172–178  ·  view source on GitHub ↗
(self, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

170
171
172 def forward(self, *inputs, **kwargs):
173 if mpu.is_pipeline_first_stage():
174 inputs = fp32_to_float16(inputs, self.float16_convertor)
175 outputs = self.module(*inputs, **kwargs)
176 if mpu.is_pipeline_last_stage():
177 outputs = float16_to_fp32(outputs)
178 return outputs
179
180
181 def state_dict(self, destination=None, prefix='', keep_vars=False):

Callers

nothing calls this directly

Calls 2

fp32_to_float16Function · 0.70
float16_to_fp32Function · 0.70

Tested by

no test coverage detected