Skip to content

const manager 常量注册可以采用高效实现 #363

Description

@wwens7

当前 const manager 中对于重复常量的判断需要做一次d2h(如果在非 cpu 设备上),当 tensor shape 较大时开销较大。@LeoLau94 提议只按 tensor 的 meta hash 进行分桶,桶内通过tensor.equal进行判断去重避免 D2H 拷贝,且 memcmp 性能也更好。

Originally posted by @LeoLau94 in #342 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions