You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LinkExecutables pass overrides duplicate named tensors #5946
symbol conflict: '__constant_4xi8'
target op:
vm.rodata @__constant_4xi8 dense<[0, 0, 0, 1]> : tensor<4xi8>
(visibility public)
source op:
vm.rodata @__constant_4xi8 dense<[0, 0, 1, 0]> : tensor<4xi8>
(visibility public)
ops are *not* equivalent, need to disambiguate
Relating this back to the comment thread there, could these vm.rodata ops be marked private (Symbol Visibility docs)? I'm trying to decide how to resolve that conflict and it would be safer to only rename private symbols while merging modules.
I'll work on a fix to the linking pass. This is what I have sketched so far (to handle the general case):
// Destructively merges |sourceModuleOp| into |targetModuleOp|.// |targetSymbolMap| is updated with the new symbols.//// If a private symbol in |sourceModuleOp| conflicts with another symbol// (public or private) tracked in |targetSymbolMap|, it will be renamed and// |privateSymbolOccurrences| will be updated to reflect this.//// Fails if a public symbol in |sourceModuleOp| conflicts with another public// symbol tracked in |targetSymbolMap|.static LogicalResult mergeModuleInto(
Operation *sourceModuleOp, Operation *targetModuleOp,
DenseMap<StringRef, Operation *> &targetSymbolMap,
llvm::StringMap<unsigned> &privateSymbolOccurrences) {
Activity
ScottTodd commentedon May 19, 2021
This sounds similar to what was discussed here: #4897 (comment) , which points to an unresolved TODO here: https://github.com/google/iree/blob/b5f3dda010b4b3ed4982f11c3e3b72277ad84451/iree/compiler/Dialect/HAL/Target/TargetBackend.cpp#L113-L122
ScottTodd commentedon May 20, 2021
Here's some debug output from that linking code:
Relating this back to the comment thread there, could these
vm.rodataops be marked private (Symbol Visibility docs)? I'm trying to decide how to resolve that conflict and it would be safer to only rename private symbols while merging modules.ScottTodd commentedon May 20, 2021
We have other private
RodataOps, like https://github.com/google/iree/blob/53b850448b371d4d828091c7617d2b51bdb5d8f2/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertExecutableOps.cpp#L77-L84What code is producing those in this case?
benvanik commentedon May 20, 2021
RE visibility: rodata should all be private so it's worth setPrivate()ing everywhere.
ScottTodd commentedon May 20, 2021
public rodata ops are coming from https://github.com/google/iree/blob/b154cd99df25272e17bb4cbb29438b70f445028b/iree/compiler/Dialect/VM/Conversion/MemRefToVM/ConvertMemRefToVM.cpp#L107-L109
I can reproduce this bug compiling https://github.com/google/iree/blob/main/iree/test/e2e/models/edge_detection.mlir:
I'll work on a fix to the linking pass. This is what I have sketched so far (to handle the general case):
that's modeled after @MaheshRavishankar 's earlier attempt here: MaheshRavishankar@7d3baeb
Handle symbol name conflicts during executable linking. (#5978)
Disable tests related to LinkExecutables pass
Disable tests related to LinkExecutables pass (#6067)