Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion defaults/docs-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defaults:
tv:
- ctv-bvod
- app
default_consumer_device_request_size_bytes:
default_client_side_device_request_size_bytes:
app: 1000
audio: 1000
ctv-bvod: 0
Expand Down Expand Up @@ -269,6 +269,9 @@ defaults:
social: 0.049000000
streaming-video: 0.049000000
web: 0.049000000
default_server_side_request_size_bytes: 1500
default_server_to_server_embodied_emissions_gco2e_per_kb: 0.000000136
default_server_to_server_kwh_per_gb: 0.004010000
default_time_in_view_seconds: 6
default_usage_kwh_per_gb:
scope3:
Expand Down
72 changes: 54 additions & 18 deletions docs/calculations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -541,40 +541,76 @@ get_platform_emissions(ad_platform):
ad_platform.distribution_rate_by_bidder_by_country[country, bidder] ?? 1
return direct_emissions + rtdp_emissions + bidder_emissions

ad_selection_platform_emissions_gco2_per_imp = 0
data_transfer_bytes = 0

for platform in placement.ad_platforms:
ad_selection_platform_emissions_gco2_per_imp += get_platform_emissions(platform)
platform_bytes =
platform.average_bid_request_size ??
default_consumer_device_request_size_bytes[channel]
data_transfer_bytes += default_consumer_device_request_size_bytes[channel]
if platform.sends_client_side_requests:
get_platform_client_side_data_transfer(platform, is_client_side):
if !is_client_side
return 0
bytes_sent = 0
for bidder in platform.bidders:
bidder_bytes =
bidder.average_bid_request_size ??
default_consumer_device_request_size_bytes[channel]
data_transfer_bytes +=
bytes_sent +=
bidder_bytes x
platform.distribution_rate_by_bidder_by_country[country, bidder] ?? 1
return bytes_sent

get_platform_server_side_data_transfer(platform, is_client_side):
bytes_sent = 0
for bidder in platform.bidders:
bytes_sent += get_platform_server_side_data_transfer(bidder, false)
if is_client_side:
continue
bidder_bytes =
bidder.average_bid_request_size ??
default_server_side_request_size_bytes
bytes_sent +=
bidder_bytes x
platform.distribution_rate_by_bidder_by_country[country, bidder] ?? 1
return bytes_sent

ad_selection_platform_emissions_gco2_per_imp = 0
client_side_data_transfer_bytes = 0
server_side_data_transfer_bytes = 0

for platform in placement.ad_platforms:
ad_selection_platform_emissions_gco2_per_imp += get_platform_emissions(platform)
client_side_data_transfer_bytes +=
platform.average_bid_request_size ??
default_consumer_device_request_size_bytes[channel]
client_side_data_transfer_bytes += default_consumer_device_request_size_bytes[channel]
client_side_data_transfer_bytes +=
get_platform_client_side_data_transfer(platform, platform.sends_client_side_requests)
server_side_data_transfer_bytes +=
get_platform_server_side_data_transfer(platform, platform.sends_client_side_requests)

```

### Ad Selection - Data Transfer

```
ad_selection_data_transfer_usage_emissions_gco2_per_imp =
data_transfer_bytes / 1000 x
usage_kwh_per_gb / 1000000 x
ad_selection_client_side_data_transfer_usage_emissions_gco2_per_imp =
client_side_data_transfer_bytes / 1024 x
usage_kwh_per_gb / 1024 / 1024 x
lookup_carbon_intensity_gco2e_per_kwh(country, region, utc_datetime)

ad_selection_data_transfer_embodied_emissions_gco2_per_imp =
data_transfer_bytes / 1000 x
ad_selection_client_side_data_transfer_embodied_emissions_gco2_per_imp =
client_side_data_transfer_bytes / 1024 x
embodied_emissions_gco2e_per_kb

ad_selection_server_side_data_transfer_usage_emissions_gco2_per_imp =
server_side_data_transfer_bytes / 1024 x
default_server_to_server_kwh_per_gb / 1024 / 1024 x
lookup_carbon_intensity_gco2e_by_continent(country, region, utc_datetime)

ad_selection_server_side_data_transfer_embodied_emissions_gco2_per_imp =
server_side_data_transfer_bytes / 1024 x
default_server_to_server_embodied_emissions_gco2e_per_kb

ad_selection_data_transfer_emissions_gco2_per_imp =
ad_selection_data_transfer_usage_emissions_gco2_per_imp +
ad_selection_data_transfer_embodied_emissions_gco2_per_imp
ad_selection_server_side_data_transfer_usage_emissions_gco2_per_imp +
ad_selection_server_side_data_transfer_embodied_emissions_gco2_per_imp +
ad_selection_client_side_data_transfer_usage_emissions_gco2_per_imp +
ad_selection_client_side_data_transfer_embodied_emissions_gco2_per_imp
```

### Model Quality
Expand Down
5 changes: 5 additions & 0 deletions docs/data_transfer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ The [SRI methodology](https://www.sri-france.org/wp-content/uploads/2023/06/SRI_

## Handling unknown networks
The SRI methodology suggests a ratio of 90% fixed to 10% mobile. However, this ratio is not representative globally. The ITU publishes [research](https://datahub.itu.int) on fixed and mobile traffic by country. This indicates that for 2022 the weighted average of global traffic was 23.6% mobile. However, this research notably omits the US which is likely similar to other advanced economies in the 5% range, so we have added this to the dataset as an estimate (along with the 10% France number for SRI consistency).

## Server-to-server data transfer
[Marion Ficher, Françoise Berthoud, Anne-Laure Ligozat, Patrick Sigonneau, Maxime Wisslé, et al.. Assessing the carbon footprint of the data transmission on a backbone network. 24th Conference on Innovation in Clouds, Internet and Networks, Mar 2021, Paris, France. hal-03196527](https://hal.science/hal-03196527)

Per Table III, a local request (which is the likely case for RTB where the round trip time needs to be ~10ms or less), and assuming a peak day as the majority of requests will be at peak, use phase emissions are 0.433 gCO2e/GB and embodied emissions are .0143 gCO2e/GB. To reverse the use phase to kWh we remove the emissions factor used (0.108 kgCO2e/kWh) and get 0.00401 kWh/GB.
4 changes: 3 additions & 1 deletion docs/snippets/defaults_ad_platform.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```
default_consumer_device_request_size_bytes:
default_client_side_device_request_size_bytes:
Comment thread
bokelley marked this conversation as resolved.
Outdated
web: 1500
app: 1000
ctv-bvod: 0
Expand All @@ -8,6 +8,8 @@ default_consumer_device_request_size_bytes:
social: 1000
streaming-video: 0

default_server_side_request_size_bytes: 1500

default_emissions_per_creative_request_gco2_per_imp: 0.0003
default_emissions_per_bid_request_gco2_per_imp: 0.11442
default_emissions_per_rtdp_request_gco2_per_imp: 0.01
Expand Down
2 changes: 2 additions & 0 deletions docs/snippets/defaults_conventional_model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ default_network_embodied_emissions_gco2e_per_kb:
sri:
fixed: 0.00000443
mobile: 0.00000797
default_server_to_server_kwh_per_gb: 0.00401
default_server_to_server_embodied_emissions_gco2e_per_kb: 0.000000136
```
2 changes: 1 addition & 1 deletion scope3_methodology/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def test_startup(self):
)

docs_defs = docs_defaults
self.assertEqual(len(docs_defs), 33)
self.assertEqual(len(docs_defs), 36)

def test_get_all_con_networking_connection_device_fixed_defaults(self):
"""Test get_all_networking_connection_device_defaults returns expected output"""
Expand Down