-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from felix5572/master
update for if_cuda_multi_devices
- Loading branch information
Showing
9 changed files
with
122 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"batch":{ | ||
"batch_type": "shell", | ||
"context_type": "local", | ||
"local_root" : "test_if_cuda_multi_devices/", | ||
"remote_root" : "tmp_if_cuda_multi_devices/", | ||
"hostname": "39.106.xx.xxx", | ||
"username": "user1" | ||
}, | ||
"resources":{ | ||
"number_node": 1, | ||
"cpu_per_node": 4, | ||
"gpu_per_node": 4, | ||
"queue_name": "GPU_2080Ti", | ||
"group_size": 16, | ||
"para_deg": 2, | ||
"strategy": { | ||
"if_cuda_multi_devices": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"train":{ | ||
"batch":{ | ||
"batch_type": "pbs", | ||
"context_type": "lazy_local", | ||
"local_root": "./" | ||
}, | ||
"resources":{ | ||
"number_node": 1, | ||
"cpu_per_node": 4, | ||
"gpu_per_node": 1, | ||
"queue_name": "T4_4_14", | ||
"group_size": 5 | ||
} | ||
}, | ||
"md":{ | ||
"batch":{ | ||
"batch_type": "Shell", | ||
"context_type": "lazy_local", | ||
"local_root": "./" | ||
}, | ||
"resources":{ | ||
"number_node": null, | ||
"cpu_per_node": null, | ||
"gpu_per_node": 0, | ||
"queue_name": null, | ||
"group_size": 5 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
dpdispatcher_unittest_7 | ||
dpdispatcher_unittest_9 | ||
dpdispatcher_unittest_6 | ||
dpdispatcher_unittest_14 | ||
dpdispatcher_unittest_10 | ||
dpdispatcher_unittest_8 | ||
dpdispatcher_unittest_12 | ||
dpdispatcher_unittest_5 | ||
dpdispatcher_unittest_1 | ||
dpdispatcher_unittest_2 | ||
dpdispatcher_unittest_13 | ||
dpdispatcher_unittest_4 | ||
dpdispatcher_unittest_11 | ||
dpdispatcher_unittest_3 | ||
dpdispatcher_unittest_0 | ||
dpdispatcher_unittest_15 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import sys, os, shutil | ||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | ||
__package__ = 'tests' | ||
from .context import Submission, Job, Task, Resources | ||
from .context import Shell | ||
from .context import LocalContext | ||
from .context import get_file_md5 | ||
from .context import Machine | ||
|
||
import unittest | ||
|
||
class TestShellTrival(unittest.TestCase): | ||
def setUp(self): | ||
self.maxDiff = None | ||
|
||
def test_shell_trival(self): | ||
machine = Machine.load_from_json_file(json_path='jsons/machine.if_cuda_multi_devices.json') | ||
submission = Submission(work_base='test_dir/', resources=machine.resources, forward_common_files=['test.txt'], backward_common_files=['out.txt']) | ||
task_list = [] | ||
for ii in range(16): | ||
task = Task(command=f"echo dpdispatcher_unittest_{ii}", task_work_path='./', forward_files=[], backward_files=[], outlog='out.txt') | ||
task_list.append(task) | ||
submission.register_task_list(task_list=task_list) | ||
submission.bind_batch(batch=machine.batch) | ||
submission.run_submission(clean=False) | ||
|
||
for ii in ['out.txt', 'test.txt']: | ||
f1 = os.path.join('test_if_cuda_multi_devices/', 'test_dir/', ii) | ||
f2 = os.path.join('tmp_if_cuda_multi_devices/', submission.submission_hash, ii) | ||
self.assertEqual(get_file_md5(f1), get_file_md5(f2)) | ||
|
||
@classmethod | ||
def tearDownClass(self): | ||
# pass | ||
shutil.rmtree('tmp_if_cuda_multi_devices/') | ||
|
||
|
||
|
||
|
||
|