Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
DeepSpeed
提交
8552bd6a
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 搜索 >>
未验证
提交
8552bd6a
编写于
8月 22, 2023
作者:
L
Logan Adams
提交者:
GitHub
8月 22, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into loadams/low-cpu-mem-ut
上级
d1bc2cb8
d9a889d5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
5 deletion
+20
-5
tests/unit/common.py
tests/unit/common.py
+2
-4
tests/unit/inference/test_inference.py
tests/unit/inference/test_inference.py
+18
-1
未找到文件。
tests/unit/common.py
浏览文件 @
8552bd6a
...
...
@@ -22,9 +22,6 @@ import pytest
from
_pytest.outcomes
import
Skipped
from
_pytest.fixtures
import
FixtureLookupError
,
FixtureFunctionMarker
# Worker timeout *after* the first worker has completed.
DEEPSPEED_UNIT_WORKER_TIMEOUT
=
120
# Worker timeout for tests that hang
DEEPSPEED_TEST_TIMEOUT
=
600
...
...
@@ -114,6 +111,7 @@ class DistributedExec(ABC):
requires_cuda_env
=
True
reuse_dist_env
=
False
_pool_cache
=
{}
exec_timeout
=
DEEPSPEED_TEST_TIMEOUT
@
abstractmethod
def
run
(
self
):
...
...
@@ -170,7 +168,7 @@ class DistributedExec(ABC):
skip_msgs_async
=
pool
.
starmap_async
(
self
.
_dist_run
,
args
)
try
:
skip_msgs
=
skip_msgs_async
.
get
(
DEEPSPEED_TEST_TIMEOUT
)
skip_msgs
=
skip_msgs_async
.
get
(
self
.
exec_timeout
)
except
mp
.
TimeoutError
:
# Shortcut to exit pytest in the case of a hanged test. This
# usually means an environment error and the rest of tests will
...
...
tests/unit/inference/test_inference.py
浏览文件 @
8552bd6a
...
...
@@ -550,13 +550,14 @@ class TestAutoTensorParallelism(DistributedTest):
"model_family, model_name"
,
(
[
"gpt2"
,
"EleutherAI/gpt-neo-2.7B"
],
[
"gpt2"
,
"EleutherAI/gpt-j-6b"
],
#["gpt2", "EleutherAI/gpt-j-6b"], # Causing OOM for this test
[
"gpt2"
,
"gpt2-xl"
],
),
)
@
pytest
.
mark
.
parametrize
(
"task"
,
[
"lambada_standard"
])
class
TestLMCorrectness
(
DistributedTest
):
world_size
=
1
exec_timeout
=
1200
# Give these tests longer to complete
def
test
(
self
,
model_family
,
model_name
,
task
):
# imports here to avoid import errors when pytest collects tests
...
...
@@ -565,6 +566,21 @@ class TestLMCorrectness(DistributedTest):
import
lm_eval.tasks
import
lm_eval.evaluator
# The bootstrap_stderr function in lm_eval.metrics uses a
# multiprocessing Pool to increase performance. Since we use a Pool for
# our distributed tests and cannot nest Pools, we must redefine and
# patch this function with a version that does not use Pool.
def
no_pool_bootstrap_stderr
(
f
,
xs
,
iters
):
from
lm_eval.metrics
import
_bootstrap_internal
from
lm_eval.metrics
import
sample_stddev
res
=
[]
chunk_size
=
min
(
1000
,
iters
)
for
i
in
range
(
iters
//
chunk_size
):
res
.
extend
(
_bootstrap_internal
(
f
,
chunk_size
)((
i
,
xs
)))
return
sample_stddev
(
res
)
lm_eval
.
metrics
.
bootstrap_stderr
=
no_pool_bootstrap_stderr
local_rank
=
os
.
getenv
(
"LOCAL_RANK"
,
"0"
)
device
=
torch
.
device
(
get_accelerator
().
device_name
(
local_rank
))
dtype
=
torch
.
float
...
...
@@ -586,6 +602,7 @@ class TestLMCorrectness(DistributedTest):
get_accelerator
().
synchronize
()
bs_time
=
time
.
time
()
-
start
getattr
(
lm
,
model_family
).
to
(
"cpu"
)
ds_model
=
deepspeed
.
init_inference
(
getattr
(
lm
,
model_family
),
mp_size
=
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录