mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-06 19:40:28 +00:00
[fx/meta/rpc] move _meta_registration.py to fx folder / register fx functions with compatibility checks / remove color debug (#1710)
* [fx] move meta registration * [fx] fix tests. * [fx] fix test. * [fx] fix. * [meta] refactor meta registration.py. * [fx] add compatibility descriptions. * [fx] polish import. * [fx] add a decorator. * [fx] fix tests. * [fx] remove print. * [fx] edit raise error. * [fx] edit raise error. * [fx] add type hint. * [fx] fix import in experimental. * [rpc] remove color debug. * [meta] fix naming.
This commit is contained in:
32
colossalai/fx/profiler/constants.py
Normal file
32
colossalai/fx/profiler/constants.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import torch
|
||||
|
||||
__all__ = ['ALIAS_ATEN', 'INPLACE_NEW', 'INPLACE_MATH_ATEN', 'CLONE_ATEN']
|
||||
|
||||
aten = torch.ops.aten
|
||||
|
||||
ALIAS_ATEN = [
|
||||
aten.detach.default,
|
||||
aten.t.default,
|
||||
aten.transpose.int,
|
||||
aten.view.default,
|
||||
aten._unsafe_view.default,
|
||||
aten._reshape_alias.default,
|
||||
]
|
||||
|
||||
INPLACE_NEW = [
|
||||
aten.empty_like.default,
|
||||
aten.new_empty_strided.default,
|
||||
]
|
||||
|
||||
INPLACE_MATH_ATEN = [
|
||||
aten.add_.Tensor,
|
||||
aten.sub_.Tensor,
|
||||
aten.div_.Tensor,
|
||||
aten.div_.Scalar,
|
||||
aten.mul_.Tensor,
|
||||
aten.bernoulli_.float,
|
||||
]
|
||||
|
||||
CLONE_ATEN = [
|
||||
aten.clone.default,
|
||||
]
|
Reference in New Issue
Block a user