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
ff644ee5
Unverified
Commit
ff644ee5
authored
Jun 22, 2022
by
Jiarui Fang
Committed by
GitHub
Jun 22, 2022
Browse files
polish unitest test with titans (#1152)
parent
f1f51990
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
tests/test_data_pipeline_tensor_parallel/test_cifar_with_data_pipeline_tensor.py
...e_tensor_parallel/test_cifar_with_data_pipeline_tensor.py
+7
-3
No files found.
tests/test_data_pipeline_tensor_parallel/test_cifar_with_data_pipeline_tensor.py
View file @
ff644ee5
...
...
@@ -16,12 +16,10 @@ from colossalai.core import global_context as gpc
from
colossalai.logging
import
get_dist_logger
from
colossalai.nn
import
CrossEntropyLoss
from
colossalai.nn.lr_scheduler
import
CosineAnnealingWarmupLR
from
colossalai.utils
import
is_using_pp
,
get_dataloader
from
colossalai.utils
import
get_dataloader
from
colossalai.pipeline.pipelinable
import
PipelinableContext
from
tqdm
import
tqdm
from
torchvision.datasets
import
CIFAR10
from
torchvision
import
transforms
from
titans.model.vit
import
vit_tiny_patch4_32
BATCH_SIZE
=
4
NUM_EPOCHS
=
60
...
...
@@ -41,6 +39,12 @@ def run_trainer(rank, world_size, port):
logger
=
get_dist_logger
()
pipelinable
=
PipelinableContext
()
try
:
from
titans.model.vit
import
vit_tiny_patch4_32
except
ImportError
:
logger
.
warning
(
'skip the test_cifar_with_data_pipeline_tensor test because titan is not installed'
)
logger
.
warning
(
'please install titan from https://github.com/hpcaitech/Titans'
)
return
with
pipelinable
:
model
=
vit_tiny_patch4_32
()
pipelinable
.
to_layer_list
()
...
...
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