Skip to content

Die size is ignored in /v1/component/cpu #396

@ValentinRegnault

Description

@ValentinRegnault

Bug description

die_size is ignored if core_units is not given.

To Reproduce

Route : POST v1/component/cpu
Input:
{ "die_size": 400, }

Expected behavior

I would expect the API to compute the footprint of a CPU with a die size of 400mm².

JSON OUTPUT

It computed the footprint of a CPU with a die size of 522mm². That is the average die size of all cpu in the database.

{
  "impacts": {
    "gwp": {
      "unit": "kgCO2eq",
      "description": "Total climate change",
      "embedded": {
        "value": 19,
        "min": 9.952,
        "max": 80.85,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 1800,
        "min": 110.1,
        "max": 5419
      }
    },
    "adp": {
      "unit": "kgSbeq",
      "description": "Use of minerals and fossil ressources",
      "embedded": {
        "value": 0.0204,
        "min": 0.0204,
        "max": 0.02042,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 0.0003,
        "min": 0.00006341,
        "max": 0.001272
      }
    },
    "pe": {
      "unit": "MJ",
      "description": "Consumption of primary energy",
      "embedded": {
        "value": 290,
        "min": 166.9,
        "max": 1121,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 100000,
        "min": 62.26,
        "max": 2242000
      }
    }
  },
  "verbose": {
    "impacts": {
      "gwp": {
        "unit": "kgCO2eq",
        "description": "Total climate change",
        "embedded": {
          "value": 19,
          "min": 9.952,
          "max": 80.85,
          "warnings": [
            "End of life is not included in the calculation"
          ]
        },
        "use": {
          "value": 1800,
          "min": 110.1,
          "max": 5419
        }
      },
      "adp": {
        "unit": "kgSbeq",
        "description": "Use of minerals and fossil ressources",
        "embedded": {
          "value": 0.0204,
          "min": 0.0204,
          "max": 0.02042,
          "warnings": [
            "End of life is not included in the calculation"
          ]
        },
        "use": {
          "value": 0.0003,
          "min": 0.00006341,
          "max": 0.001272
        }
      },
      "pe": {
        "unit": "MJ",
        "description": "Consumption of primary energy",
        "embedded": {
          "value": 290,
          "min": 166.9,
          "max": 1121,
          "warnings": [
            "End of life is not included in the calculation"
          ]
        },
        "use": {
          "value": 100000,
          "min": 62.26,
          "max": 2242000
        }
      }
    },
    "units": {
      "value": 1,
      "status": "ARCHETYPE",
      "min": 1,
      "max": 1
    },
    "die_size": {
      "value": 522, <--- HERE IT IGNORED THE DIE_SIZE I'VE PROVIDED
      "status": "COMPLETED",
      "unit": "mm2",
      "source": "Average value for all families",
      "min": 41.2,
      "max": 3640
    },
    "duration": {
      "value": 26280,
      "unit": "hours"
    },
    "avg_power": {
      "value": 182.23,
      "status": "COMPLETED",
      "unit": "W",
      "min": 182.23,
      "max": 182.23
    },
    "time_workload": {
      "value": 50,
      "status": "ARCHETYPE",
      "unit": "%",
      "min": 0,
      "max": 100
    },
    "usage_location": {
      "value": "EEE",
      "status": "DEFAULT",
      "unit": "CodSP3 - NCS Country Codes - NATO"
    },
    "use_time_ratio": {
      "value": 1,
      "status": "ARCHETYPE",
      "unit": "/1",
      "min": 1,
      "max": 1
    },
    "hours_life_time": {
      "value": 26280,
      "status": "ARCHETYPE",
      "unit": "hours",
      "min": 26280,
      "max": 26280
    },
    "params": {
      "value": {
        "a": 171.2,
        "b": 0.0354,
        "c": 36.89,
        "d": -10.13
      },
      "status": "ARCHETYPE"
    },
    "gwp_factor": {
      "value": 0.38,
      "status": "DEFAULT",
      "unit": "kg CO2eq/kWh",
      "source": "https://www.sciencedirect.com/science/article/pii/S0306261921012149",
      "min": 0.023,
      "max": 1.13161
    },
    "adp_factor": {
      "value": 6.42317e-8,
      "status": "DEFAULT",
      "unit": "kg Sbeq/kWh",
      "source": "ADEME Base IMPACTS ®",
      "min": 1.324e-8,
      "max": 2.65575e-7
    },
    "pe_factor": {
      "value": 12.873,
      "status": "DEFAULT",
      "unit": "MJ/kWh",
      "source": "ADPf / (1-%renewable_energy)",
      "min": 0.013,
      "max": 468.15
    }
  }
}

Additional context

With this input :

{
  "die_size": 500,
  "core_units": 32
}

It works as expected. This bug may be relative to the completion die_size = core_units * die_size_per_core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions