-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop exposing internal contiguous TV storage (#3827)
Remove from TensorVector the AsTensorList method and constructor from external shared_ptr<TensorList> Both allowed to observe the internal state of TensorVector from the outside, breaking the encapsulation. Adjust few places that relied on the changes of internal state to be externally visible: * Initializing the data graph in workspaces. The TV -> TL conversion is done vie Mixed stage. * ArgumentInputs that are produced as TensorList need to be resynced by ShareData instead. This reverts some changes from #2165: - CPU stage cannot be used as direct outputs due to the TensorList/TensorVector mismatch, we can only share data downwards, but we cannot share and preemptivelly expect the allocation to be mirrored. - CPU-only stage still uses Mixed stage, but just with MakeContigous constrained to CPU outputs. Workspace initialization now takes the CPU_ONLY_DEVICE_ID into consideration and does not set the stream (resulting in has_stream() being false, which in turn keeps the AccessOrder in Mixed ops as HostOrder only). Memory is set to non pinned when CPU_ONLY_DEVICE_ID is detected. Eager mode optimizations with contiguous TensorVector -> TensorList was disabled - it waits for the rework of TensorVector replacing TensorList. An escape hatch to access the shared_ptr of the allocation was ported to TensorVector from TensorList, to allow for ExternalSource to pass data without copy. Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
- Loading branch information
Showing
14 changed files
with
257 additions
and
203 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.