-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[ARM CPU] ACL TBB scheduler #17445
Merged
dmitry-gorokhov
merged 25 commits into
openvinotoolkit:master
from
allnes:an/tbb_scheduler_exp
Jul 19, 2023
Merged
[ARM CPU] ACL TBB scheduler #17445
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8e81a38
tbb experiment - old version
allnes 5a81547
enable throughput mode
allnes 04eb077
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes a25f2cc
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes b527a92
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes 4a585b5
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes e9316b5
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes 69efd08
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes 607f56c
Merge branch 'master' into an/tbb_scheduler_exp
allnes 871dd8d
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes c48bd28
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes 7f20bf8
acl scheduler trnasform
allnes fa19a46
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes 17926b5
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
allnes f455b09
new version tbb scheduler
allnes 8280284
Merge remote-tracking branch 'origin/an/tbb_scheduler_exp' into an/tb…
allnes 1dd7dac
Merge branch 'master' into an/tbb_scheduler_exp
allnes d10234b
update scheduling
allnes 50b3bc8
Merge branch 'master' into an/tbb_scheduler_exp
allnes d60b8f0
enable multi-streaming
allnes 4f03280
Merge branch 'master' into an/tbb_scheduler_exp
allnes 44d2b16
Merge branch 'master' into an/tbb_scheduler_exp
allnes 9d6eee7
change
allnes 1f3a64d
Merge branch 'master' into an/tbb_scheduler_exp
allnes 369ebc0
Merge branch 'master' into an/tbb_scheduler_exp
allnes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
43 changes: 43 additions & 0 deletions
43
src/plugins/intel_cpu/src/nodes/executors/acl/acl_ie_scheduler.cpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "acl_ie_scheduler.hpp" | ||
|
||
#include "arm_compute/core/CPP/ICPPKernel.h" | ||
#include "arm_compute/core/Error.h" | ||
#include "arm_compute/core/Helpers.h" | ||
#include <ie_parallel.hpp> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
using namespace arm_compute; | ||
|
||
ACLScheduler::ACLScheduler() = default; | ||
|
||
unsigned int ACLScheduler::num_threads() const { return parallel_get_num_threads(); } | ||
|
||
void ACLScheduler::set_num_threads(unsigned int num_threads) {} | ||
|
||
void ACLScheduler::schedule(ICPPKernel *kernel, const Hints &hints) { | ||
ITensorPack tensors; | ||
schedule_common(kernel, hints, kernel->window(), tensors); | ||
} | ||
|
||
void ACLScheduler::schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) { | ||
schedule_common(kernel, hints, kernel->window(), tensors); | ||
dmitry-gorokhov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
void ACLScheduler::run_workloads(std::vector<arm_compute::IScheduler::Workload> &workloads) { | ||
InferenceEngine::parallel_for(workloads.size(), [&] (int wid) { | ||
ThreadInfo info; | ||
info.cpu_info = &cpu_info(); | ||
info.num_threads = parallel_get_num_threads(); | ||
info.thread_id = wid; | ||
workloads[wid](info); | ||
}); | ||
} | ||
|
||
} // namespace intel_cpu | ||
} // namespace ov |
28 changes: 28 additions & 0 deletions
28
src/plugins/intel_cpu/src/nodes/executors/acl/acl_ie_scheduler.hpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <arm_compute/runtime/Scheduler.h> | ||
#include <arm_compute/core/CPP/ICPPKernel.h> | ||
#include <arm_compute/core/ITensorPack.h> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
using namespace arm_compute; | ||
|
||
class ACLScheduler final : public IScheduler { | ||
public: | ||
ACLScheduler(); | ||
~ACLScheduler() override = default; | ||
std::uint32_t num_threads() const override; | ||
void set_num_threads(unsigned int num_threads) override; | ||
void schedule(ICPPKernel *kernel, const Hints &hints) override; | ||
void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override; | ||
protected: | ||
void run_workloads(std::vector<Workload> &workloads) override; | ||
}; | ||
} // namespace intel_cpu | ||
} // namespace ov |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method has to be implemented in proper way. You can have
num_threads
internal field initialized withparallel_get_num_threads();
as default value.Then
run_workloads
can be implemented usingInferenceEngine::parallel_nt
which takes number of threads as parameter.Anyway this need to aligned with streams support activity to provide proper behavior inside TBB arena. This might be not trivial given ACL has only global scheduler instance.
Lets follow-up later