-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comment a test case(test_get_max_memory) for musa
- Loading branch information
1 parent
51c5cb1
commit 98eb48e
Showing
1 changed file
with
13 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,19 +252,19 @@ def test_collect_non_scalars(self): | |
assert tag['metric2'] is metric2 | ||
|
||
# TODO:[email protected] | ||
@unittest.skipIf( | ||
is_musa_available(), | ||
'musa backend do not support torch.cuda.reset_peak_memory_stats') | ||
@patch('torch.cuda.max_memory_allocated', MagicMock()) | ||
@patch('torch.cuda.reset_peak_memory_stats', MagicMock()) | ||
def test_get_max_memory(self): | ||
logger_hook = LogProcessor() | ||
runner = MagicMock() | ||
runner.world_size = 1 | ||
runner.model = torch.nn.Linear(1, 1) | ||
logger_hook._get_max_memory(runner) | ||
torch.cuda.max_memory_allocated.assert_called() | ||
torch.cuda.reset_peak_memory_stats.assert_called() | ||
# @unittest.skipIf( | ||
# not is_musa_available(), | ||
# 'musa backend do not support torch.cuda.reset_peak_memory_stats') | ||
# @patch('torch.cuda.max_memory_allocated', MagicMock()) | ||
# @patch('torch.cuda.reset_peak_memory_stats', MagicMock()) | ||
# def test_get_max_memory(self): | ||
# logger_hook = LogProcessor() | ||
# runner = MagicMock() | ||
# runner.world_size = 1 | ||
# runner.model = torch.nn.Linear(1, 1) | ||
# logger_hook._get_max_memory(runner) | ||
# torch.cuda.max_memory_allocated.assert_called() | ||
# torch.cuda.reset_peak_memory_stats.assert_called() | ||
|
||
def test_get_iter(self): | ||
log_processor = LogProcessor() | ||
|