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

optimize bf allocator #869

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dipu/tests/python/individual_scripts/test_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_allocator(
(
{"args": (MAX_ALLOCATE, 1, "TORCH", 0)},
{"args": (MAX_ALLOCATE, 1, "BF", 0)},
{"args": (MAX_ALLOCATE, 1, "BF2", 0)},
{"args": (MAX_ALLOCATE, 1, "BS", 0)},
{"args": (MAX_ALLOCATE, 1, "RAW", 0)},
{"args": (MAX_ALLOCATE, 17919, "BF", 3, False)},
Expand Down
1 change: 1 addition & 0 deletions dipu/torch_dipu/csrc_dipu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ set(TORCH_DIPU_SOURCE
runtime/core/allocator/DIPURawAllocator.cpp
runtime/core/allocator/DIPUCachingAllocator.cpp
runtime/core/allocator/DIPUBFCachingAllocator.cpp
runtime/core/allocator/DIPUBFCachingAllocator2.cpp
runtime/core/allocator/DIPUBSCachingAllocator.cpp
runtime/core/allocator/DIPUCachingHostAllocator.cpp
runtime/core/allocator/DIPUCachingDeviceAllocator.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ class BFCachingAllocator : public CacheAllocator {
allocator_->set_memory_allocated(allocator_->memory_allocated() -
nbytes_);
}
allocator_->restore();
} else {
DIPU_DEBUG_ALLOCATOR(8,
"BFCachingAllocator:~Context: destory tensor "
Expand Down
Loading
Loading