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

Multiple aggregation not working as intended. #1047

Closed
mouhamadalmounayar opened this issue Oct 10, 2024 · 4 comments · Fixed by #1066
Closed

Multiple aggregation not working as intended. #1047

mouhamadalmounayar opened this issue Oct 10, 2024 · 4 comments · Fixed by #1066
Assignees
Labels
bug Error, flaw or fault

Comments

@mouhamadalmounayar
Copy link
Contributor

mouhamadalmounayar commented Oct 10, 2024

Description of the Error

Aggregation feature is not working as intended when multiple metrics are provided even though no error is being thrown. (I opened this issue since I found that it is not working as intended even on the main branch.)

Expected Behaviour

We should get an aggregated field with all metrics values properly computed.

Actual Behaviour

Only the first metric is being computed. And its value is being copied from the last output only.

Steps to Reproduce

Run the following manifest file with the main branch version.

Manifest File That Generated the Error

name: carbon_pipeline
aggregation:
  metrics:
  - carbon
  - energy
  type: time
initialize:
  plugins:
    teads-curve:
      method: TeadsCurve
      path: '@grnsft/if-unofficial-plugins'
    multiply:
      method: Multiply
      path: builtin
      config:
        input-parameters:
        - resources-reserved
        - cpu/energy
        output-parameter: cpu/energy-total
    e-mem:
      method: EMem
      path: '@grnsft/if-plugins'
    sci-e:
      method: SciE
      path: '@grnsft/if-plugins'
    sci-m:
      method: SciM
      path: '@grnsft/if-plugins'
    sci-o:
      method: SciO
      path: '@grnsft/if-plugins'
    sci:
      method: Sci
      path: '@grnsft/if-plugins'
      config: 
        functional-unit: R
  outputs:
  - yaml
tree:
  defaults:
    memory/utilization: 100
    device/emissions-embodied: 1887000
    cpu/thermal-design-power: 3.76
    device/expected-lifespan: 126230400
    duration: 1800
  pipeline:
    compute:
    - teads-curve
    - multiply
    - e-mem
    - sci-e
    - sci-m
    - sci-o
    - sci
  children:
    0:
      children:
        child_1
          inputs:
          - timestamp: 1727958600
            cpu/utilization: 35.32553725926037
            grid/carbon-intensity: 251.0
            resources-reserved: 1.0
            resources-total: 90
            memory/capacity: 2.576980378
          - timestamp: 1727960400
            cpu/utilization: 33.50961455555754
            grid/carbon-intensity: 251.0
            resources-reserved: 1.0
            resources-total: 90
            memory/capacity: 2.576980378
          - timestamp: 1727962200
            cpu/utilization: 34.02016962963023
            grid/carbon-intensity: 251.0
            resources-reserved: 1.0
            resources-total: 90
            memory/capacity: 2.576980378

The output that has been generated :

name: carbon_pipeline
aggregation:
  metrics:
    - carbon
    - energy
  type: time
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
    multiply:
      path: builtin
      method: Multiply
      config:
        input-parameters:
          - resources-reserved
          - cpu/energy
        output-parameter: cpu/energy-total
    e-mem:
      path: '@grnsft/if-plugins'
      method: EMem
    sci-e:
      path: '@grnsft/if-plugins'
      method: SciE
    sci-m:
      path: '@grnsft/if-plugins'
      method: SciM
    sci-o:
      path: '@grnsft/if-plugins'
      method: SciO
    sci:
      path: '@grnsft/if-plugins'
      method: Sci
      config:
        functional-unit: R
execution:
  command: >-
    C:\Users\malmounayar\programs\node-v20.17.0-win-x64\node.exe
    C:\Users\malmounayar\if\build\if-run\index.js --manifest
    ..\GreenIt\test-manifest\inputs\multiple-aggregation.yaml --output
    ..\GreenIt\test-manifest\outputs\multiple-aggregation.yaml
  environment:
    if-version: 0.7.0
    os: "Microsoft Windows 11 Enterprise\r"
    os-version: 10.0.22631 N/A Build 22631
    node-version: 20.17.0
    date-time: 2024-10-10T16:07:10.065Z (UTC)
    dependencies:
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@azure/[email protected] extraneous -> undefined'
      - '@babel/[email protected]'
      - '@babel/[email protected]'
      - '@cloud-carbon-footprint/[email protected] extraneous -> undefined'
      - '@cloud-carbon-footprint/[email protected] extraneous -> undefined'
      - '@cloud-carbon-footprint/[email protected] extraneous -> undefined'
      - '@commitlint/[email protected]'
      - '@commitlint/[email protected]'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@google-cloud/[email protected] extraneous -> undefined'
      - '@grnsft/[email protected]'
      - '@grnsft/[email protected] extraneous -> undefined'
      - '@grnsft/[email protected] extraneous -> undefined'
      - '@grpc/[email protected] extraneous -> undefined'
      - '@grpc/[email protected] extraneous -> undefined'
      - '@jest/[email protected]'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@protobufjs/[email protected] extraneous -> undefined'
      - '@sinonjs/[email protected] extraneous -> undefined'
      - '@sinonjs/[email protected] extraneous -> undefined'
      - '@tgwf/[email protected] extraneous -> undefined'
      - '@tootallnate/[email protected] extraneous -> undefined'
      - '@types/[email protected]'
      - '@types/[email protected]'
      - '@types/[email protected] extraneous -> undefined'
      - '@types/[email protected]'
      - '@types/[email protected]'
      - '@types/[email protected] extraneous -> undefined'
      - '@types/[email protected] extraneous -> undefined'
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected]
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected] extraneous -> undefined
      - [email protected]
  status: success
tree:
  defaults:
    memory/utilization: 100
    device/emissions-embodied: 1887000
    cpu/thermal-design-power: 3.76
    device/expected-lifespan: 126230400
    duration: 1800
  pipeline:
    compute:
      - teads-curve
      - multiply
      - e-mem
      - sci-e
      - sci-m
      - sci-o
      - sci
  children:
    '0':
      children:
        child_1:
          inputs:
            - timestamp: 1727958600
              cpu/utilization: 35.32553725926037
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
            - timestamp: 1727960400
              cpu/utilization: 33.50961455555754
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
            - timestamp: 1727962200
              cpu/utilization: 34.02016962963023
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
          outputs:
            - timestamp: 1727958600
              cpu/utilization: 35.32553725926037
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
              memory/utilization: 100
              device/emissions-embodied: 1887000
              cpu/thermal-design-power: 3.76
              device/expected-lifespan: 126230400
              duration: 1800
              cpu/energy: 0.0012094032917143286
              cpu/energy-total: 0.0012094032917143286
              memory/energy: 0.001010176308176
              energy: 0.0022195795998903286
              carbon-embodied: 0.2989771085253632
              carbon-operational: 0.5571144795724725
              carbon: 0.00047560643783213096
              sci: 0.00047560643783213096
            - timestamp: 1727960400
              cpu/utilization: 33.50961455555754
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
              memory/utilization: 100
              device/emissions-embodied: 1887000
              cpu/thermal-design-power: 3.76
              device/expected-lifespan: 126230400
              duration: 1800
              cpu/energy: 0.001179441369467165
              cpu/energy-total: 0.001179441369467165
              memory/energy: 0.001010176308176
              energy: 0.002189617677643165
              carbon-embodied: 0.2989771085253632
              carbon-operational: 0.5495940370884345
              carbon: 0.00047142841422988756
              sci: 0.00047142841422988756
            - timestamp: 1727962200
              cpu/utilization: 34.02016962963023
              grid/carbon-intensity: 251
              resources-reserved: 1
              resources-total: 90
              memory/capacity: 2.576980378
              memory/utilization: 100
              device/emissions-embodied: 1887000
              cpu/thermal-design-power: 3.76
              device/expected-lifespan: 126230400
              duration: 1800
              cpu/energy: 0.0011880189188019983
              cpu/energy-total: 0.0011880189188019983
              memory/energy: 0.001010176308176
              energy: 0.002198195226977998
              carbon-embodied: 0.2989771085253632
              carbon-operational: 0.5517470019714775
              carbon: 0.00047262450583157817
              sci: 0.00047262450583157817
          aggregated:
            carbon: 0.00047262450583157817
@mouhamadalmounayar mouhamadalmounayar added the bug Error, flaw or fault label Oct 10, 2024
@zanete zanete moved this to In Refinement in IF Oct 21, 2024
@zanete
Copy link

zanete commented Oct 21, 2024

@narekhovhannisyan please could you verify that this should no longer be an issue? 🙏

@zanete zanete moved this from In Refinement to In Progress in IF Oct 29, 2024
@zanete
Copy link

zanete commented Oct 29, 2024

status update: working on debugging the issue

@mouhamadalmounayar
Copy link
Contributor Author

It looks like the issue stems from the plugins we’re using, as they don’t include a parameter-metadata attribute. This attribute (which is deprecated, so adding it might not be feasible) is what initialize.ts relies on via storeAggregationMetrics() for aggregation. It may be worth highlighting where the aggregation method should be specified—likely in parameter-metadata—since this isn’t explicitly mentioned in the documentation.

@narekhovhannisyan narekhovhannisyan linked a pull request Oct 30, 2024 that will close this issue
6 tasks
@github-project-automation github-project-automation bot moved this from Pending Review to Done in IF Oct 31, 2024
@narekhovhannisyan
Copy link
Member

HI @mouhamadalmounayar, thanks for reporting. It's fixed by our latest release v0.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error, flaw or fault
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants