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

Added ControlRecommender interface #2799

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

lhlawson
Copy link
Contributor

Signed-off-by: Lowren Lawson lowren.h.lawson@intel.com

Updated recommender class interface #2792 based upon review #2793

Signed-off-by: Lowren Lawson <lowren.h.lawson@intel.com>
@lhlawson lhlawson force-pushed the public-lhlawson-recommender-interface branch from 962abca to b135e3e Compare January 12, 2023 17:51
Copy link
Contributor

@cmcantalupo cmcantalupo left a comment

Choose a reason for hiding this comment

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

why not just?

/*                                                                                                                                                                                 
 * Copyright (c) 2015 - 2022, Intel Corporation                                                                                                                                    
 * SPDX-License-Identifier: BSD-3-Clause                                                                                                                                           
 */

#ifndef CONTROLRECOMMENDER_HPP_INCLUDE
#define CONTROLRECOMMENDER_HPP_INCLUDE

#include <memory>
#include <vector>
#include <string>

struct geopm_request_s;

namespace geopm
{
    class ControlRecommender
    {
        public:
            ControlRecommender() = default;
            virtual ~ControlRecommender() = default;
            static std::unique_ptr<ControlRecommender> make_unique(std::string algorithm, std::vector<geopm_request_s> control_requests);
            virtual void update(void) = 0;
            virtual std::vector<double> settings(void) = 0;
            virtual void performance_bias(double bias) = 0;
    };
}

#endif

Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
@cmcantalupo cmcantalupo force-pushed the public-lhlawson-recommender-interface branch from 57ae0b9 to 5eeb7c8 Compare January 12, 2023 19:54
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
lhlawson and others added 2 commits January 12, 2023 12:50
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
@cmcantalupo cmcantalupo force-pushed the public-lhlawson-recommender-interface branch from f21c3dd to dcac6d8 Compare January 12, 2023 23:56
src/ControlRecommender.hpp Outdated Show resolved Hide resolved
/// supported. The order of these requests
/// reflects ordering of the returned values from
/// the settings method.
virtual std::vector<geopm_request_s> supported_requests(const std::vector<geopm_request_t> &attempted_requests) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

supported_requests -> set_configured_requests()
supported_requests const -> get_configured_requests() const

/// @param [in] bias Abstract number between 0 and 1: a
/// value of 1 is most biased toward performance,
/// and 0 is most biased towards energy efficiency.
virtual void performance_bias(double bias) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This API is insufficient to enable an agent to express information that is gathered from the TreeComm. There is no way to have the ControlRecommender send data to other nodes via the TreeComm. This makes it difficult for distributed agent algorithms to fit into this API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Some additional context from that discussion:

In the meeting we discussed one solution may be for control recommenders to describe things that they'd send over TreeComm. We noted that TreeComm needs to know information about what it will communicate early in launch (i.e., how much space to allocate for samples and policies). If we go that direction, it might be worth evaluating whether there are any communication overhead aspects to consider (e.g., whether we also need to independently enable/disable communicators associated with different recommenders)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants