Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiling allocator for mobile. #43951

Closed
wants to merge 7 commits into from

Commits on Sep 1, 2020

  1. Profiling allocator for mobile.

    Summary:
    AllocationPlan: Stores the sequence of allocations, their sizes
                    and liftime of the allocations. Along with this
                    it also stores the total size of a single memory
                    blob, total_size, required to satisfy all the allocations.
                    It also stores the offsets in the blob, of size
                    total_size, corresponding to each allocation.
                    Thus allocation plan contains:
                    - allocation sizes
                    - allocation lifetimes
                    - allocation offsets
                    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills
                      it ups with plan, i.e. sizes, lifetimes, offsets,
                      total size.
                      This is done via WithProfileAllocationsGuard which
                      takes in AllocationPlan* and constructs
                      AllocationPlanner* and set the thread local
                      allocation_planner to it.
                      MobileCPUAllocator profiles allocations via
                      allocation_planner.
                      In WithValidateAllocationsGuard, allocations profiled
                      in the allocation plan are validated.
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator
    Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator
    and AllocationPlan created earlier. Then CPUProfilingAllocator will
    manage allocations and frees according to the plan. Allocations that
    are not managed by CPUProfilingAllocator will be routed through
    c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    [ghstack-poisoned]
    kimishpatel committed Sep 1, 2020
    Configuration menu
    Copy the full SHA
    b316d9e View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Sep 14, 2020
    Configuration menu
    Copy the full SHA
    b6a0c72 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2020

  1. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    f3618db View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    022c756 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2020

  1. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    0bac4ba View commit details
    Browse the repository at this point in the history
  2. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    87e1d08 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2020

  1. Update on "Profiling allocator for mobile."

    Summary:
    AllocationPlan: 
    Stores the sequence of allocations, their sizes and liftime of the allocations. Along with this it also stores the total size of a single memory blob, total_size, required to satisfy all the allocations. It also stores the offsets in the blob, of size total_size, corresponding to each allocation.
    Thus allocation plan contains:
    - allocation sizes
    - allocation lifetimes
    - allocation offsets
    - total size
    AllocationPlaner: Takes a pointer to the allocation plan and fills it ups with plan, i.e. sizes, lifetimes, offsets, total size. This is done via WithProfileAllocationsGuard which takes in AllocationPlan* and constructs AllocationPlanner* and set the thread local allocation_planner to it. MobileCPUAllocator profiles allocations via allocation_planner. In WithValidateAllocationsGuard, allocations profiled in the allocation plan are validated.
    
    CPUProfilingAllocator:
    Application owns CPUProfilingAllocator Using WithProfilingAllocatorGuard, it passes both CPUProfilingAllocator and AllocationPlan created earlier. Then CPUProfilingAllocator will manage allocations and frees according to the plan. Allocations that are not managed by CPUProfilingAllocator will be routed through c10::alloc_cpu, c10::free_cpu.
    
    Test Plan:
    cpu_profiling_allocator_test on mobile.
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    Differential Revision: [D23451019](https://our.internmc.facebook.com/intern/diff/D23451019)
    
    [ghstack-poisoned]
    kimishpatel committed Oct 6, 2020
    Configuration menu
    Copy the full SHA
    1f0cb92 View commit details
    Browse the repository at this point in the history