Skip to content

Commit

Permalink
Fix transformer kernel call parameters (microsoft#81)
Browse files Browse the repository at this point in the history
* fix transformer kernel call parameters

* remove post-ln modeling
  • Loading branch information
RezaYazdaniAminabadi authored Feb 1, 2021
1 parent cadc355 commit fde14be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions BingBertSquad/turing/nvidia_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def __init__(self, config, args):
pre_layer_norm=False)

self.layer = nn.ModuleList([
copy.deepcopy(DeepSpeedTransformerLayer(i, cuda_config))
for i in range(config.num_hidden_layers)
copy.deepcopy(DeepSpeedTransformerLayer(cuda_config))
for _ in range(config.num_hidden_layers)
])
else:
layer = BertLayer(config)
Expand Down
4 changes: 2 additions & 2 deletions BingBertSquad/turing/nvidia_modelingpreln.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ def __init__(self, config, args):
pre_layer_norm=True)

self.layer = nn.ModuleList([
copy.deepcopy(DeepSpeedTransformerLayer(i, cuda_config))
for i in range(config.num_hidden_layers)
copy.deepcopy(DeepSpeedTransformerLayer(cuda_config))
for _ in range(config.num_hidden_layers)
])
else:
layer = BertLayer(config)
Expand Down
4 changes: 2 additions & 2 deletions bing_bert/nvidia/modelingpreln.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ def __init__(self, config, args, sparse_attention_config=None):
stochastic_mode=args.stochastic_mode)

self.layer = nn.ModuleList([
copy.deepcopy(DeepSpeedTransformerLayer(i, cuda_config))
for i in range(config.num_hidden_layers)
copy.deepcopy(DeepSpeedTransformerLayer(cuda_config))
for _ in range(config.num_hidden_layers)
])
else:
layer = BertLayer(config)
Expand Down

0 comments on commit fde14be

Please sign in to comment.