Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference PP changes for neox #1899

Merged
merged 30 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
64a58c7
Synchronize the GPUs for the text-generation inference test
Mar 3, 2022
d153b09
change pp to run inference
Mar 4, 2022
ec0edd5
support ckpt conversion between pp<->seq
jeffra Mar 15, 2022
a145129
remove conversion code, its now moved to client side
jeffra Mar 15, 2022
1aa5148
add the inference-api changes to support the GPT-Neox inference at de…
Mar 28, 2022
00d3be6
fix the accuracy issue on the GPTNeoX inference
Apr 1, 2022
525e9e7
fixing parameter copy
Apr 1, 2022
7e96581
add inference global
jeffra Apr 2, 2022
69b611e
Merge branch 'master' into inference/pipechanges
jeffra Apr 19, 2022
c271cc7
clean-up
jeffra Apr 20, 2022
586c93f
cleanup
jeffra Apr 20, 2022
676023e
more clean-up
jeffra Apr 20, 2022
da45d1a
Merge branch 'master' into inference/pipechanges
jeffra Apr 20, 2022
73afc65
more clean-up/docs
jeffra Apr 20, 2022
a31a93d
formatting
jeffra Apr 20, 2022
cecde18
fix minor issue with injection
Apr 20, 2022
e3e0a9a
Merge branch 'inference/pipechanges' of github.com:microsoft/DeepSpee…
Apr 20, 2022
9e5e1ce
refine the pipe module to get a map of the fwd_funcs to be able to in…
Apr 20, 2022
afdcac4
fix DSE
jeffra Apr 20, 2022
a16adb9
add final_linear to state dict factory ckpt split
jeffra Apr 20, 2022
7b3a75e
Merge branch 'master' into inference/pipechanges
jeffra Apr 21, 2022
a82ae85
fix for circular import issue
jeffra Apr 21, 2022
9eff79c
Merge branch 'inference/pipechanges' of github.com:microsoft/DeepSpee…
jeffra Apr 21, 2022
3a3109c
comment out sanity check for now
jeffra Apr 22, 2022
346186b
Merge branch 'master' into inference/pipechanges
RezaYazdaniAminabadi Apr 22, 2022
3f490ae
fix layernorm-param issue & compilation on newer version of torch
Apr 22, 2022
1891e30
change the default trainig_mp_size to 1
Apr 22, 2022
8bd754f
Merge branch 'master' into inference/pipechanges
jeffra Apr 26, 2022
5afbee9
fix for curand on amd
jeffra Apr 26, 2022
8627db7
fix syntax error
jeffra Apr 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix layernorm-param issue & compilation on newer version of torch
  • Loading branch information
Reza Yazdani committed Apr 22, 2022
commit 3f490aec334454b996157777d665aac73e7e9774
6 changes: 4 additions & 2 deletions deepspeed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def init_inference(model,
ep_size=1,
moe=False,
moe_experts=1,
moe_type='standard'):
moe_type='standard',
args=None):
"""Initialize the DeepSpeed InferenceEngine.

Arguments:
Expand Down Expand Up @@ -298,6 +299,7 @@ def init_inference(model,
replace_with_kernel_inject,
moe,
moe_experts,
moe_type)
moe_type,
args)

return engine
9 changes: 5 additions & 4 deletions deepspeed/inference/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def __init__(self,
replace_with_kernel_inject=False,
moe=False,
moe_experts=1,
moe_type='standard'):
moe_type='standard',
config=None):
"""
Args:
model: torch.nn.Module
Expand All @@ -68,7 +69,7 @@ def __init__(self,

self.module = model

self._get_model_config_generate()
self._get_model_config_generate(config)

self.mp_world_size = mp_size
self.checkpoint = checkpoint
Expand Down Expand Up @@ -133,8 +134,8 @@ def __init__(self,
else:
self.module.register_forward_pre_hook(self._pre_forward_hook)

def _get_model_config_generate(self):
self.config = getattr(self.module, 'config', None)
def _get_model_config_generate(self, config):
self.config = getattr(self.module, 'config', None) if config is None else config
self.generate = getattr(self.module, 'generate', None)

def _create_model_parallel_group(self):
Expand Down
9 changes: 6 additions & 3 deletions deepspeed/module_inject/replace_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,12 @@ def replace_with_policy(child,
heads=num_attention_heads,
layer_norm_eps=config.layer_norm_eps if hasattr(
config,
'layer_norm_eps') else (config.layer_norm_epsilon if hasattr(
config,
'layer_norm_epsilon') else 1.0e-5),
'layer_norm_eps') else
(config.layer_norm_epsilon
if hasattr(config,
'layer_norm_epsilon') else config.layernorm_epsilon
if hasattr(config,
'layernorm_epsilon') else 1.0e-12),
fp16=fp16,
pre_layer_norm=preln,
mp_size=mp_size,
Expand Down
3 changes: 3 additions & 0 deletions op_builder/stochastic_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def __init__(self):
def absolute_name(self):
return f'deepspeed.ops.transformer.{self.NAME}_op'

def extra_ldflags(self):
return ['-lcurand']

def nvcc_args(self):
args = super().nvcc_args()
args.append('-D__STOCHASTIC_MODE__')
Expand Down
3 changes: 3 additions & 0 deletions op_builder/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def __init__(self, name=None):
def absolute_name(self):
return f'deepspeed.ops.transformer.{self.NAME}_op'

def extra_ldflags(self):
return ['-lcurand']

def sources(self):
return [
'csrc/transformer/ds_transformer_cuda.cpp',
Expand Down
3 changes: 3 additions & 0 deletions op_builder/transformer_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ def sources(self):
'csrc/transformer/inference/csrc/apply_rotary_pos_emb.cu',
]

def extra_ldflags(self):
return ['-lcurand']

def include_paths(self):
return ['csrc/transformer/inference/includes']