Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
c1492e50
Commit
c1492e50
authored
Jan 10, 2023
by
oahzxl
Browse files
add test in import
parent
fd818cf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
tests/test_autochunk/test_autochunk_codegen.py
tests/test_autochunk/test_autochunk_codegen.py
+3
-1
tests/test_autochunk/test_autochunk_search.py
tests/test_autochunk/test_autochunk_search.py
+3
-1
No files found.
tests/test_autochunk/test_autochunk_codegen.py
View file @
c1492e50
...
@@ -6,7 +6,6 @@ import torch.fx
...
@@ -6,7 +6,6 @@ import torch.fx
import
torch.multiprocessing
as
mp
import
torch.multiprocessing
as
mp
import
colossalai
import
colossalai
from
colossalai.autochunk.autochunk_codegen
import
AutoChunkCodeGen
from
colossalai.core
import
global_context
as
gpc
from
colossalai.core
import
global_context
as
gpc
from
colossalai.fx
import
ColoTracer
from
colossalai.fx
import
ColoTracer
from
colossalai.fx.codegen.activation_checkpoint_codegen
import
CODEGEN_AVAILABLE
from
colossalai.fx.codegen.activation_checkpoint_codegen
import
CODEGEN_AVAILABLE
...
@@ -16,6 +15,9 @@ from colossalai.fx.profiler import MetaTensor
...
@@ -16,6 +15,9 @@ from colossalai.fx.profiler import MetaTensor
from
colossalai.utils
import
free_port
from
colossalai.utils
import
free_port
from
tests.test_autochunk.evoformer.evoformer
import
evoformer_base
from
tests.test_autochunk.evoformer.evoformer
import
evoformer_base
if
CODEGEN_AVAILABLE
:
from
colossalai.autochunk.autochunk_codegen
import
AutoChunkCodeGen
def
_test_fwd
(
model
:
torch
.
nn
.
Module
,
gm
:
ColoGraphModule
,
node
,
pair
):
def
_test_fwd
(
model
:
torch
.
nn
.
Module
,
gm
:
ColoGraphModule
,
node
,
pair
):
# for memory test
# for memory test
...
...
tests/test_autochunk/test_autochunk_search.py
View file @
c1492e50
...
@@ -6,7 +6,6 @@ import torch.fx
...
@@ -6,7 +6,6 @@ import torch.fx
import
torch.multiprocessing
as
mp
import
torch.multiprocessing
as
mp
import
colossalai
import
colossalai
from
colossalai.autochunk.autochunk_codegen
import
AutoChunkCodeGen
from
colossalai.core
import
global_context
as
gpc
from
colossalai.core
import
global_context
as
gpc
from
colossalai.fx.codegen.activation_checkpoint_codegen
import
CODEGEN_AVAILABLE
from
colossalai.fx.codegen.activation_checkpoint_codegen
import
CODEGEN_AVAILABLE
from
colossalai.fx.passes.meta_info_prop
import
MetaInfoProp
from
colossalai.fx.passes.meta_info_prop
import
MetaInfoProp
...
@@ -14,6 +13,9 @@ from colossalai.fx.profiler import MetaTensor
...
@@ -14,6 +13,9 @@ from colossalai.fx.profiler import MetaTensor
from
colossalai.utils
import
free_port
from
colossalai.utils
import
free_port
from
tests.test_autochunk.evoformer.evoformer
import
evoformer_base
from
tests.test_autochunk.evoformer.evoformer
import
evoformer_base
if
CODEGEN_AVAILABLE
:
from
colossalai.autochunk.autochunk_codegen
import
AutoChunkCodeGen
def
assert_chunk_infos
(
chunk_infos
,
max_memory
,
msa_len
,
pair_len
):
def
assert_chunk_infos
(
chunk_infos
,
max_memory
,
msa_len
,
pair_len
):
found_regions
=
[
i
[
"region"
]
for
i
in
chunk_infos
]
found_regions
=
[
i
[
"region"
]
for
i
in
chunk_infos
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment