Conversation
lockshaw
left a comment
There was a problem hiding this comment.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @reyna-abhyankar)
lib/local-execution/include/tracked_allocator.h line 8 at r1 (raw file):
namespace FlexFlow { struct TrackedAllocator : public Allocator {
TrackedAllocator should inherit from IAllocator. The way you have it implemented I think you're not actually overriding allocate, deallocate, etc. because they're not virtual, and making them virtual creates more problems than it solves. If you inherit from IAllocator then you can have an Allocator that holds a pointer to a TrackedAllocator which has a member which is an Allocator which holds a pointer to whatever the underlying allocator type is, which should behave correctly I think
reyna-abhyankar
left a comment
There was a problem hiding this comment.
Reviewable status: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @lockshaw)
lib/local-execution/include/tracked_allocator.h line 8 at r1 (raw file):
Previously, lockshaw (Colin Unger) wrote…
TrackedAllocatorshould inherit fromIAllocator. The way you have it implemented I think you're not actually overridingallocate,deallocate, etc. because they're not virtual, and making them virtual creates more problems than it solves. If you inherit fromIAllocatorthen you can have anAllocatorthat holds a pointer to aTrackedAllocatorwhich has a member which is anAllocatorwhich holds a pointer to whatever the underlying allocator type is, which should behave correctly I think
Done.
lockshaw
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @reyna-abhyankar)
lib/local-execution/include/tracked_allocator.h line 8 at r1 (raw file):
Previously, reyna-abhyankar (Reyna Abhyankar) wrote…
Done.
TrackedAllocator should wrap another allocator, rather than hardcoding in its own allocation logic, i.e., TrackedAllocator should have a field of type Allocator
reyna-abhyankar
left a comment
There was a problem hiding this comment.
Reviewable status: 3 of 6 files reviewed, 1 unresolved discussion (waiting on @lockshaw)
lib/local-execution/include/tracked_allocator.h line 8 at r1 (raw file):
Previously, lockshaw (Colin Unger) wrote…
TrackedAllocatorshould wrap another allocator, rather than hardcoding in its own allocation logic, i.e.,TrackedAllocatorshould have a field of typeAllocator
Done.
lockshaw
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @reyna-abhyankar)
lib/local-execution/include/tracked_allocator.h line 25 at r3 (raw file):
CHECK_RC_COPY_VIRTUAL_COMPLIANT(TrackedAllocator); Allocator get_tracked_memory_allocator(Allocator base_allocator);
Suggestion:
Allocator get_tracked_memory_allocator(Allocator const &base_allocator);
reyna-abhyankar
left a comment
There was a problem hiding this comment.
Reviewable status: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @lockshaw)
lib/local-execution/include/tracked_allocator.h line 25 at r3 (raw file):
CHECK_RC_COPY_VIRTUAL_COMPLIANT(TrackedAllocator); Allocator get_tracked_memory_allocator(Allocator base_allocator);
Done.
lockshaw
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @reyna-abhyankar)
Description of changes:
Local and tracked allocator
Related Issues:
Linked Issues:
Issues closed by this PR:
This change is