tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[BugFix][MSC] split name_string with index by colon from the right

Open psunn opened this issue 1 year ago • 4 comments

Fixes a naming mismatch in MSCGraph where tensor_name could formatted as 'string:index:index',and the corresponding node.name is 'string:index'. Splitting tensor_name from the right aligns it correctly.

For example, the TFLite default input name 'serving_default_input:0' becomes 'serving_default_input:0:0' in MSCGraph, while node.name remains 'serving_default_input:0'.

psunn avatar May 15 '24 13:05 psunn

cc @Archermmt

Hzfengsy avatar May 16 '24 09:05 Hzfengsy

Thanks for the fix @psunn, would it be possible to add a test case?

@lhutton1 Thanks for the review. I've added a test case.

psunn avatar May 16 '24 14:05 psunn

Hi @Archermmt, could you help to review this PR? thanks in advance.

psunn avatar May 22 '24 15:05 psunn

Seem ok for me. The only change in this PR is the split direction, which has no influence on current test. I think the main reason is that: in some corner cases like TFLite model, the node name looks like "NODE:IDX", which is normally the tensor name format.

Archermmt avatar May 26 '24 01:05 Archermmt

@Archermmt thanks for review. Yes, the change in this PR has no effect on existing tests. An additional test case has been added to cover node name_string with an index by colon.

I force-pushed only to address linting issues.

@lhutton1 @Archermmt @Hzfengsy Would it be okay to merge it? thanks.

psunn avatar May 28 '24 12:05 psunn

Thanks @psunn @Archermmt @Hzfengsy!

lhutton1 avatar May 29 '24 08:05 lhutton1