Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
DeepSpeed
提交
fe678544
D
DeepSpeed
项目概览
Greenplum
/
DeepSpeed
上一次同步 12 个月
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeed
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
fe678544
编写于
11月 17, 2022
作者:
M
Michael Wyatt
提交者:
GitHub
11月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add missing Inference sub-configs (#2518)
上级
e59f8054
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
11 deletion
+35
-11
deepspeed/inference/config.py
deepspeed/inference/config.py
+20
-9
deepspeed/runtime/zero/config.py
deepspeed/runtime/zero/config.py
+2
-2
docs/code-docs/source/inference-init.rst
docs/code-docs/source/inference-init.rst
+13
-0
未找到文件。
deepspeed/inference/config.py
浏览文件 @
fe678544
...
...
@@ -125,19 +125,20 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
"""
Set to true to inject inference kernels for models such as, Bert, GPT2,
GPT-Neo and GPT-J. Otherwise, the injection_dict provides the names of two
linear layers as a tuple:
(attention_output projection, transformer output
projection)
linear layers as a tuple:
`(attention_output projection, transformer output projection)`
"""
dtype
:
DtypeEnum
=
torch
.
float16
"""
Desired model data type, will convert model to this type.
Supported target types:
torch.half, torch.int8, torch.float
Supported target types:
`torch.half`, `torch.int8`, `torch.float`
"""
tensor_parallel
:
DeepSpeedTPConfig
=
Field
({},
alias
=
"tp"
)
"""
Configuration for tensor parallelism used to split the model across several GPUs.
Configuration for tensor parallelism used to split the model across several
GPUs. Expects a dictionary containing values for :any:`DeepSpeedTPConfig`.
"""
enable_cuda_graph
:
bool
=
False
...
...
@@ -147,7 +148,10 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
"""
zero
:
DeepSpeedZeroConfig
=
{}
""" ZeRO configuration to use with the Inference Engine. """
"""
ZeRO configuration to use with the Inference Engine. Expects a dictionary
containing values for :any:`DeepSpeedZeroConfig`.
"""
triangular_masking
:
bool
=
Field
(
True
,
alias
=
"tm"
)
"""
...
...
@@ -156,7 +160,10 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
"""
moe
:
Union
[
bool
,
DeepSpeedMoEConfig
]
=
{}
""" Specify if the type of Transformer is MoE. """
"""
Specify if the type of Transformer is MoE. Expects a dictionary containing
values for :any:`DeepSpeedMoEConfig`.
"""
quant
:
QuantizationConfig
=
{}
"""
...
...
@@ -167,7 +174,8 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
in if we want to mention that there is extra-grouping for the MLP part of a
Transformer layer (e.g. (True, 8) shows we quantize the model using 8
groups for all the network except the MLP part that we use 8 extra
grouping).
grouping). Expects a dictionary containing values for
:any:`QuantizationConfig`.
"""
#todo: refactor the following 3 into the new checkpoint_config
...
...
@@ -191,7 +199,10 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
"""
checkpoint_config
:
InferenceCheckpointConfig
=
Field
({},
alias
=
"ckpt_config"
)
""" TODO: Add docs """
"""
TODO: Add docs. Expects a dictionary containing values for
:any:`InferenceCheckpointConfig`.
"""
return_tuple
:
bool
=
True
"""
...
...
@@ -216,7 +227,7 @@ class DeepSpeedInferenceConfig(DeepSpeedConfigModel):
injection_policy
:
Dict
=
Field
(
None
,
alias
=
"injection_dict"
)
"""
Dictionary mapping a client nn.Module to its corresponding injection
policy. e.g.,
{BertLayer : deepspeed.inference.HFBertLayerPolicy}
policy. e.g.,
`{BertLayer : deepspeed.inference.HFBertLayerPolicy}`
"""
injection_policy_tuple
:
tuple
=
None
...
...
deepspeed/runtime/zero/config.py
浏览文件 @
fe678544
...
...
@@ -139,7 +139,7 @@ class DeepSpeedZeroConfig(DeepSpeedConfigModel):
"""
Enable offloading of model parameters to CPU or NVMe. This frees up GPU
memory for larger models or batch sizes. Valid only with stage 3. Expects a
dictionary containing values for
`DeepSpeedZeroOffloadParamConfig`_
.
dictionary containing values for
:any:`DeepSpeedZeroOffloadParamConfig`
.
"""
offload_optimizer
:
Optional
[
DeepSpeedZeroOffloadOptimizerConfig
]
=
None
...
...
@@ -147,7 +147,7 @@ class DeepSpeedZeroConfig(DeepSpeedConfigModel):
Enable offloading of optimizer state to CPU or NVMe, and optimizer
computation to CPU. This frees up GPU memory for larger models or batch
sizes. Valid for ZeRO stage 1, 2, 3. Expects a dictionary containing values
for
`DeepSpeedZeroOffloadOptimizerConfig`_
.
for
:any:`DeepSpeedZeroOffloadOptimizerConfig`
.
"""
sub_group_size
:
int
=
Field
(
pp_int
(
1e9
),
ge
=
0
)
...
...
docs/code-docs/source/inference-init.rst
浏览文件 @
fe678544
...
...
@@ -15,6 +15,19 @@ the ``InferenceEngine``. The config should be passed as a dictionary to
.. _DeepSpeedInferenceConfig:
.. autopydantic_model:: deepspeed.inference.config.DeepSpeedInferenceConfig
.. _DeepSpeedTPConfig:
.. autopydantic_model:: deepspeed.inference.config.DeepSpeedTPConfig
.. _DeepSpeedMoEConfig:
.. autopydantic_model:: deepspeed.inference.config.DeepSpeedMoEConfig
.. _QuantizationConfig:
.. autopydantic_model:: deepspeed.inference.config.QuantizationConfig
.. _InferenceCheckpointConfig:
.. autopydantic_model:: deepspeed.inference.config.InferenceCheckpointConfig
Example config:
.. code-block:: python
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录