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

Method forward

DeepSpeedExample/megatron/model/transformer.py:121–135  ·  view source on GitHub ↗
(self, hidden_states)

Source from the content-addressed store, hash-verified

119 skip_bias_add=True)
120
121 def forward(self, hidden_states):
122
123 # [s, b, 4hp]
124 intermediate_parallel, bias_parallel = self.dense_h_to_4h(hidden_states)
125
126 if self.bias_gelu_fusion:
127 intermediate_parallel = \
128 bias_gelu_impl(intermediate_parallel, bias_parallel)
129 else:
130 intermediate_parallel = \
131 self.activation_func(intermediate_parallel + bias_parallel)
132
133 # [s, b, h]
134 output, output_bias = self.dense_4h_to_h(intermediate_parallel)
135 return output, output_bias
136
137
138class ParallelSelfAttention(MegatronModule):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected