[WIP][Core][GPU fraction][6/n] Migrate Node struct and callers from original class to base class pointer type#63508
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a polymorphic resource management architecture by establishing a NodeResourcesBase abstract class and a NodeResourcesV2 implementation. The V2 implementation enables per-instance resource tracking (specifically for GPU fractional scheduling) using NodeResourceInstanceSet. The Node structure and ClusterResourceManager have been refactored to manage these resources via unique pointers. The review feedback identifies several critical issues, including unsafe static_cast operations that will cause undefined behavior when V2 nodes are enabled, object slicing in GetNodeResources resulting in data loss, and malformed JSON generation in the DebugString method. There is also a recommendation to replace manual type checking with a virtual Clone pattern to improve the robustness of polymorphic copying.
36cd79f to
1a5bd77
Compare
… wrapper methods Signed-off-by: dancingactor <s990346@gmail.com>
…ass for branch-by-abstraction migration strategy Signed-off-by: dancingactor <s990346@gmail.com>
…d related methods from scalar to per-instance view version Signed-off-by: dancingactor <s990346@gmail.com>
…al class to base class pointer type Signed-off-by: dancingactor <s990346@gmail.com>
2. Change GetNodeResources parameter from NodeResourcesBase back to NodeResources to avoid Signed-off-by: dancingactor <s990346@gmail.com>
1a5bd77 to
c605a54
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit c605a54. Configure here.

Description
Related issues
Additional information