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

[WIP] Support local xgboost regressor #1007

Closed
wants to merge 41 commits into from

Conversation

rootfs
Copy link
Contributor

@rootfs rootfs commented Oct 16, 2023

the xgboost library PR #1041 needs to be merged first

@rootfs rootfs added this to the keple-releae-0.7 milestone Oct 16, 2023
@@ -243,7 +244,7 @@ var _ = Describe("Test LR Weight Unit", func() {
// Estimate Container Components Power using Linear Regression
modelWeightFilepath := config.GetDefaultPowerModelURL(types.DynPower.String(), types.ComponentEnergySource)
initModelURL := "https://raw.githubusercontent.com/sustainable-computing-io/kepler-model-db/main/models/v0.6/nx12/std_v0.6/rapl/DynPower/BPFOnly/SGDRegressorTrainer_1.json"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably need to update the model here, this model is SGD, not sure it it if compatible with XGBoost.
Did you try to locally?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be also good to change the name of the files and other references from lr to xgb.

Copy link
Collaborator

@marceloamaral marceloamaral left a comment

Choose a reason for hiding this comment

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

Looks very promising!

@sunya-ch
Copy link
Collaborator

sunya-ch commented Nov 1, 2023

@rootfs I updated the xgboost to the main pipeline and upload the trained model on my local repo. Please use it first for testing the WIP code by the follow config.

apiVersion: v1
kind: ConfigMap
metadata:
  name: kepler-cfm
  namespace: kepler
data:
  MODEL_CONFIG: |
    NODE_TOTAL_INIT_URL =https://raw.githubusercontent.com/sunya-ch/kepler-model-db/trl-nx12/models/v0.7/nx12/std_v0.7/acpi/AbsPower/BPFOnly/XgboostFitTrainer_1.json
    NODE_COMPONENTS_INIT_URL=https://raw.githubusercontent.com/sunya-ch/kepler-model-db/trl-nx12/models/v0.7/nx12/std_v0.7/rapl/AbsPower/BPFOnly/XgboostFitTrainer_1.json

The json of xgboost is in NormalizedNumericalFeature.Weight
You may redefine NormalizedNumericalFeature.Weight to interface{} instead of float and handle it separately for each type.
Not sure but you may need to temporarily save the extracted Weight in json format can read it from the function C.LoadModelFromJSON.

@rootfs
Copy link
Contributor Author

rootfs commented Nov 1, 2023

@rootfs I updated the xgboost to the main pipeline and upload the trained model on my local repo. Please use it first for testing the WIP code by the follow config.

apiVersion: v1
kind: ConfigMap
metadata:
  name: kepler-cfm
  namespace: kepler
data:
  MODEL_CONFIG: |
    NODE_TOTAL_INIT_URL =https://raw.githubusercontent.com/sunya-ch/kepler-model-db/trl-nx12/models/v0.7/nx12/std_v0.7/acpi/AbsPower/BPFOnly/XgboostFitTrainer_1.json
    NODE_COMPONENTS_INIT_URL=https://raw.githubusercontent.com/sunya-ch/kepler-model-db/trl-nx12/models/v0.7/nx12/std_v0.7/rapl/AbsPower/BPFOnly/XgboostFitTrainer_1.json

The json of xgboost is in NormalizedNumericalFeature.Weight You may redefine NormalizedNumericalFeature.Weight to interface{} instead of float and handle it separately for each type. Not sure but you may need to temporarily save the extracted Weight in json format can read it from the function C.LoadModelFromJSON.

thank you @sunya-ch

@rootfs rootfs force-pushed the xgboost-lib branch 4 times, most recently from 0727389 to 29de583 Compare November 8, 2023 20:12
@rootfs rootfs mentioned this pull request Nov 8, 2023
rootfs and others added 17 commits November 8, 2023 15:54
Signed-off-by: Huamin Chen <[email protected]>
Bumps [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files) from 11.1 to 13.1.
- [Release notes](https://github.com/tj-actions/verify-changed-files/releases)
- [Changelog](https://github.com/tj-actions/verify-changed-files/blob/main/HISTORY.md)
- [Commits](tj-actions/verify-changed-files@v11.1...v13.1)

---
updated-dependencies:
- dependency-name: tj-actions/verify-changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
…-io#1006)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…omputing-io#1004)

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tainable-computing-io#1001)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.4.0 to 2.13.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.4.0...v2.13.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…mputing-io#1002)

Bumps [peterjgrainger/action-create-branch](https://github.com/peterjgrainger/action-create-branch) from 2.2.0 to 2.4.0.
- [Release notes](https://github.com/peterjgrainger/action-create-branch/releases)
- [Commits](peterjgrainger/action-create-branch@v2.2.0...v2.4.0)

---
updated-dependencies:
- dependency-name: peterjgrainger/action-create-branch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: sustainable-computing-bot <[email protected]>
…-computing-io#1003)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…inable-computing-io#999)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.22.1 to 1.28.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.22.1...v1.28.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…mputing-io#1000)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.1 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.13.1...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: sustainable-computing-bot <[email protected]>
…omputing-io#1015)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](actions/checkout@v3.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ble-computing-io#1014)

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.3.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](ossf/scorecard-action@e38b190...483ef80)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ainable-computing-io#1012)

Bumps [github.com/jszwec/csvutil](https://github.com/jszwec/csvutil) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/jszwec/csvutil/releases)
- [Commits](jszwec/csvutil@v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/jszwec/csvutil
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…puting-io#1011)

Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/commits/v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: sustainable-computing-bot <[email protected]>
sthaha and others added 23 commits November 13, 2023 11:28
Previously, cluster-up.sh and cluster-down.sh both had similar code to
clone the local-dev-cluster repo. This is now moved to a single script.

The scripts also `cd` in local-dev-cluster dir which meant that a .env
file at the root of kepler project will not be honored by the
local-dev-cluster/main.sh. This has been fixed by invoking the
main.sh from the root of kepler project itself

This commit modifies the cluster-up and down targets to
  * clone local-dev-cluster to tmp dir (which is ignored by git)
  * sources .env in project root where settings that needs to
    passed down to local-dev-cluster can be kept. E.g.
    ```sh
     PROMETHEUS_ENABLE=true
     GRAFANA_ENABLE=true
    ```
Signed-off-by: Sunil Thaha <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
…computing-io#1020)

Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.80.0 to 2.100.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](kubernetes/klog@v2.80.0...v2.100.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1. mount hostpath /var/run for manifests deployment.
2. fix path join error.

Signed-off-by: LeiZhou-97 <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
kubectl version --short has been deprecated since 1.23. In the latest
kubectl, the flag is removed and causes `build-manifest` to fail when
checking for the version.

This fixes the version check by using --client -o json options and using
jq to validate if the version is higher than expected - 1.21.

A new make target `tools` is added that installs all required project
tool to tmp/bin directory.

Signed-off-by: Sunil Thaha <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
This commit enables local build of kepler with libbpf.

Additional packages required to build: libbpf-devel libbpf-static

Signed-off-by: Vimal Kumar <[email protected]>
Signed-off-by: Vimal Kumar <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
…-io#926)

* feat: reduce privileges granted through SCC for OpenShift

Signed-off-by: Bastien Grasnick <[email protected]>

* feat: set mounted volumes as read only as much as possible

Signed-off-by: Bastien Grasnick <[email protected]>

* feat: set pod hostPID to true to avoid collisions/unwanted behavior in host PID namespace

Signed-off-by: Bastien Grasnick <[email protected]>

* feat: remove unnecessary mount of /sys/kernel/debug

Signed-off-by: Bastien Grasnick <[email protected]>

---------

Signed-off-by: Bastien Grasnick <[email protected]>
…inable-computing-io#1035)

This commit adds Prometheus Rules for both (low and high resolution) to
pre-compute the queries used in grafana dashboards. This reduces the time
and load on Prometheus when running dashboards improving the
responsiveness.

Signed-off-by: Sunil Thaha <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
…ble-computing-io#1026)

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](ossf/scorecard-action@483ef80...0864cf1)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: sustainable-computing-bot <[email protected]>
…sustainable-computing-io#1034)

Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.8 to 1.1.10.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.10/CHANGELOG.md)
- [Commits](opencontainers/runc@v1.1.8...v1.1.10)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: sustainable-computing-bot <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
Signed-off-by: sustainable-computing-bot <[email protected]>
Signed-off-by: Huamin Chen <[email protected]>
@rootfs
Copy link
Contributor Author

rootfs commented Nov 14, 2023

the git history messed up. Close this PR and reopen in another clean branch

@rootfs
Copy link
Contributor Author

rootfs commented Nov 14, 2023

replaced by #1052

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.

7 participants