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

[ARM CPU] New version of scheduler enabling #20488

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

allnes
Copy link
Contributor

@allnes allnes commented Oct 16, 2023

@allnes allnes added category: CPU OpenVINO CPU plugin platform: arm OpenVINO on ARM / ARM64 labels Oct 16, 2023
@allnes allnes added this to the 2023.2 milestone Oct 16, 2023
@allnes allnes requested review from a team as code owners October 16, 2023 11:10
Engine::Engine() :
deviceFullName(getDeviceFullName()),
specialSetup(new CPUSpecialSetup) {
_pluginName = "CPU";
extensionManager->AddExtension(std::make_shared<Extension>());
#if defined(OV_CPU_WITH_ACL)
scheduler_guard = SchedulerGuard::instance();
std::lock_guard<std::mutex> _lock {get_mtx_acl()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to wrap it into a function like setAclScheduler.
Also a question, why we are doing it in scope of an engine creation in case of ACL but doing it somewhere else in case of other arch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't like the fact we initialize it i scope of the engine, while for the x86 we are doing it in scope of creation of exec network before graph initialization.
@dmitry-gorokhov Up to you to approve (considering all the circumstances)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allnes allnes requested a review from EgorDuplensky October 24, 2023 10:15
Engine::Engine() :
deviceFullName(getDeviceFullName()),
specialSetup(new CPUSpecialSetup) {
_pluginName = "CPU";
extensionManager->AddExtension(std::make_shared<Extension>());
#if defined(OV_CPU_WITH_ACL)
scheduler_guard = SchedulerGuard::instance();
std::lock_guard<std::mutex> _lock {get_mtx_acl()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't like the fact we initialize it i scope of the engine, while for the x86 we are doing it in scope of creation of exec network before graph initialization.
@dmitry-gorokhov Up to you to approve (considering all the circumstances)

* @param config ComputeLibrary configuration function
*/
inline void lockACLConfiguration(std::function<void(void)> config) {
// We get a problem (seg. faults, data race etc) for eltwise operations when we use several configure(...) functions in parallel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put it into the doxygen part above instead.
"ACL 28.08 does not officially support thread-safe configure() calls.
For example, calling configure for Eltwise operations from multiple streams leads to a data race and seg fault."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorDuplensky corrected it

Comment on lines 129 to 130
// We created issue about this problem here: https://github.com/ARM-software/ComputeLibrary/issues/1073
// TODO: change it when we will get an answer to our question in issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This better to be mentioned in the ticket, not in the source code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorDuplensky corrected it

* @brief Return static mutex for lock ComputeLibrary configuration
* @return static std::mutex
*/
static arm_compute::Mutex & getMutexConfig() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abbreviation Config in this case is misleading.
Let's have just getConfigurationMutex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorDuplensky corrected it

* @brief run thread-safe configure for ComputeLibrary configuration function
* @param config ComputeLibrary configuration function
*/
inline void lockACLConfiguration(std::function<void(void)> config) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe configureThreadSafe()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorDuplensky corrected it

@EgorDuplensky
Copy link
Contributor

@allnes Could you please rebase on latest master fetch api 2.0 changes

Copy link
Contributor

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Nov 29, 2023
@allnes allnes removed the Stale label Nov 29, 2023
Copy link
Contributor

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Dec 14, 2023
@allnes allnes removed the Stale label Dec 14, 2023
@dmitry-gorokhov dmitry-gorokhov modified the milestones: 2023.3, 2024.0 Dec 20, 2023
Copy link
Contributor

github-actions bot commented Jan 4, 2024

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Jan 4, 2024
Copy link
Contributor

@EgorDuplensky EgorDuplensky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allnes Could you please include the validation runs into some ticket

@github-actions github-actions bot removed the Stale label Jan 6, 2024
Copy link
Contributor

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Jan 21, 2024
Copy link
Contributor

This PR was closed because it has been stalled for 2 week with no activity.

@allnes allnes force-pushed the an/acl_scheduler_fix branch 2 times, most recently from 5aedae7 to 9a8e9c3 Compare February 14, 2024 15:43
@allnes allnes modified the milestones: 2024.0, 2024.1 Feb 16, 2024
@allnes allnes force-pushed the an/acl_scheduler_fix branch 2 times, most recently from c976610 to 93bc5cb Compare February 19, 2024 16:05
@maxnick maxnick requested a review from EgorDuplensky March 4, 2024 19:32
@maxnick maxnick added the pr: needs tests PR needs tests updating label Mar 12, 2024
@allnes allnes removed this from the 2024.1 milestone Mar 18, 2024
Copy link
Contributor

@maxnick maxnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxnick maxnick added do_not_merge and removed pr: needs tests PR needs tests updating labels Mar 21, 2024
@maxnick
Copy link
Contributor

maxnick commented Mar 21, 2024

PR needs internal performance validation

@allnes allnes force-pushed the an/acl_scheduler_fix branch 2 times, most recently from 02406f4 to b03eb48 Compare March 26, 2024 14:21
@allnes allnes force-pushed the an/acl_scheduler_fix branch from b03eb48 to dbad1b9 Compare March 26, 2024 14:25
@maxnick
Copy link
Contributor

maxnick commented Mar 27, 2024

Internal performance validation passed successfully

@maxnick maxnick added this pull request to the merge queue Mar 27, 2024
Merged via the queue into openvinotoolkit:master with commit dc2416c Mar 27, 2024
103 checks passed
bbielawx pushed a commit to bbielawx/openvino that referenced this pull request Apr 12, 2024
### Tickets:
 - CVS-132497
 - CVS-129036
 - CVS-134932
alvoron pushed a commit to alvoron/openvino that referenced this pull request Apr 29, 2024
### Tickets:
 - CVS-132497
 - CVS-129036
 - CVS-134932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin platform: arm OpenVINO on ARM / ARM64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants