mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-08 20:40:34 +00:00
[FX] refactor experimental tracer and adapt it with hf models (#3157)
* pass gpt trace and meta_prop * pass t5 trace and meta_prop * [FX] refactor experimental tracer and adapt it with hf models * pass all mainstream model zoo * fix CI * fix CI * fix CI * fix CI * fix CI * fix CI * fix CI * fix CI * skip tests * fix CI * using packaging version * polish
This commit is contained in:
@@ -20,7 +20,7 @@ def union(a, b):
|
||||
return {**a, **b}
|
||||
|
||||
|
||||
def compute_size_in_bytes(elem: torch.Tensor | Dict | List | Tuple | int) -> int:
|
||||
def compute_size_in_bytes(elem: Union[torch.Tensor, Dict, List, Tuple, int]) -> int:
|
||||
"""Compute the size of a tensor or a collection of tensors in bytes.
|
||||
|
||||
Args:
|
||||
@@ -195,8 +195,8 @@ class MetaInfo:
|
||||
s += f'\n\thas buffer of size {_format_memory(self.buffer_size)}'
|
||||
if self.output_size:
|
||||
s += f'\n\thas output activation of size {_format_memory(self.output_size)}'
|
||||
if self.total_size:
|
||||
s += f'\n\thas total activation of size {_format_memory(self.total_size)}'
|
||||
# if self.total_size:
|
||||
# s += f'\n\thas total activation of size {_format_memory(self.total_size)}'
|
||||
if self.temp_size:
|
||||
s += f'\n\thas temp activation of size {_format_memory(self.temp_size)}'
|
||||
if self.backward_size:
|
||||
|
Reference in New Issue
Block a user