Fix infer_auto_device_map when tied weights share the same prefix name (#2324)
* fix auto device map with tied weights sharing a prefix name
Co-authored-by: Giuseppe Franco <giuseppefranco4@gmail.com>
Co-authored-by: Nick Fraser <icanlosh@gmail.com>
* precise comment
---------
Co-authored-by: Giuseppe Franco <giuseppefranco4@gmail.com>
Co-authored-by: Nick Fraser <icanlosh@gmail.com>