Name |
Last commit
|
Last update |
---|---|---|
.. | ||
__init__.py | ||
_ffi_api.py | ||
_ffi_transform_api.py | ||
adt.py | ||
attrs.py | ||
base.py | ||
container.py | ||
expr.py | ||
function.py | ||
json_compact.py | ||
module.py | ||
tensor_type.py | ||
transform.py | ||
type.py | ||
type_relation.py |
* [NODE][IR] Introduce StructuralHash for the Unified IR. This PR introduces a new way to handle structural hash for the unified IR. - Each object can now register an optional SEqualHash function, which describes how to reduce its structural equality to sequence of hash values. - Optionally, the object can choose to allow labeling of vars(e.g. function parameters) by calling DefHash - We implemented a non-recursive structural hasher that maintains its own stack to traverse te IR. This PR also improves the hash value property from the previous relay's hash utility. In particular, the graph node mode hashs a DAG differently from a tree by attaching an unique occurence index to each graph node. In all of the test cases so far, structural_hash is consistent with structural_equal. - if structrual(x, y) then structural_hash(x) == structural_hash(y) - if structural_hash(x) == structural_hash(y) then highly likely structural_equal(x, y) - hash no collison is found in our testcases. Ideally we should work on automatically generating these functions in the future. * Fix cases for EnvFunc and Array dims * fix testcase * Update src/node/structural_hash.cc Co-Authored-By: 雾雨魔理沙 <lolisa@marisa.moe> Co-authored-by: 雾雨魔理沙 <lolisa@marisa.moe>
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
__init__.py | Loading commit data... | |
_ffi_api.py | Loading commit data... | |
_ffi_transform_api.py | Loading commit data... | |
adt.py | Loading commit data... | |
attrs.py | Loading commit data... | |
base.py | Loading commit data... | |
container.py | Loading commit data... | |
expr.py | Loading commit data... | |
function.py | Loading commit data... | |
json_compact.py | Loading commit data... | |
module.py | Loading commit data... | |
tensor_type.py | Loading commit data... | |
transform.py | Loading commit data... | |
type.py | Loading commit data... | |
type_relation.py | Loading commit data... |