Refactor: refine tensor dependency tracking#415
Open
jvjhfhg wants to merge 1 commit intohw-native-sys:mainfrom
Open
Refactor: refine tensor dependency tracking#415jvjhfhg wants to merge 1 commit intohw-native-sys:mainfrom
jvjhfhg wants to merge 1 commit intohw-native-sys:mainfrom
Conversation
Collaborator
jvjhfhg
commented
Mar 31, 2026
- Add OUTPUT_EXISTING and NO_DEP handling for existing tensors, and split creator retention from overlap-based writer lookup.
- Store owner_task_id in Tensor, remove the CreatorMap path, and update affected orchestration examples to use the refined dependency semantics.
c4a6952 to
19d6c42
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the dependency tracking system by introducing creator-based tracking via a new owner_task_id field in the Tensor structure, complementing the existing OverlapMap lookups. It adds new TensorArgType variants, OUTPUT_EXISTING and NO_DEP, to better handle different buffer lifecycles and reduces complexity in the TensorMap by removing the with_alloc flag. Feedback focuses on critical safety issues where the fanin_count limit is silently enforced, which could lead to dropped dependencies and data races. Additionally, it is recommended that OUTPUT_EXISTING perform full OverlapMap lookups to maintain correctness and prevent stale entries in the TensorMap.
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
Outdated
Show resolved
Hide resolved
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
Outdated
Show resolved
Hide resolved
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
Outdated
Show resolved
Hide resolved
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
Outdated
Show resolved
Hide resolved
19d6c42 to
1dbc46e
Compare
poursoul
reviewed
Mar 31, 2026
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
Outdated
Show resolved
Hide resolved
src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_task_id.h
Outdated
Show resolved
Hide resolved
a37a79f to
f11a30c
Compare
Add OUTPUT_EXISTING and NO_DEP handling for existing tensors, and split creator retention from overlap-based writer lookup. Store owner_task_id in Tensor, remove the CreatorMap path, and update affected orchestration examples to use the refined dependency semantics.
f11a30c to
61a5e0a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.