[Dy2St] Add place hash to scope cache key to avoid conflict with executor cache #71505
+76
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
我们现在执行器 cache key 同时包含了输入 place 信息和 program id,但是 scope 的 cache key 却只有 program id,这就导致了在 place 发生改变时,program 一样,scope 能复用,但执行器不是同一个,不同的执行器上下文对同一个 scope 进行了修改,最终导致出了奇怪的问题(tensor 突然就没了)
本 PR 只是发版前的临时解决方案,python 端和 C++ 端的 hash 计算不能保证完全一致,后续可能会考虑将 scope cache 移到 C++ 以使两者完全匹配