Files
2nd/10_Wiki/Topic_Programming/AI_and_ML/Sustainability.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

5.7 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-sustainability Sustainability 10_Wiki/Topics verified self
Green Software
ESG
Carbon Footprint
none A 0.9 applied
sustainability
green-software
carbon-footprint
esg
ai-energy
2026-05-10 pending
language framework
python codecarbon

Sustainability

매 한 줄

"매 software / AI 의 carbon-aware design". ESG mandate (EU CSRD 2025+), AI training 의 explosive energy growth (GPT-5 ~15GWh, Claude Opus 4.7 estimates), green coding practice 의 mainstream화. 매 measure → reduce → report 의 cycle.

매 핵심

매 three pillars

  • E (Environmental): carbon, water, e-waste.
  • S (Social): labor, dataset bias, accessibility.
  • G (Governance): transparency, audit, compliance (CSRD, SEC climate rule).

매 software-specific

  • Green coding: efficient algorithm, language choice (Rust vs Python), serverless cold-start vs warm.
  • Carbon-aware computing: workload scheduling (run when grid is clean — Google "Carbon Intelligent Computing").
  • Energy-efficient inference: quantization (INT8, INT4), distillation, MoE sparse routing.
  • Hardware: ARM Graviton, Apple Silicon, NVIDIA Blackwell efficiency.

매 AI footprint (2026)

  • Training: 매 single Frontier model run ~10-50 GWh.
  • Inference: 매 GPT-5 query ~3-10 Wh (vs Google search ~0.3 Wh).
  • Aggregate: AI 의 datacenter 가 2030 의 global electricity 의 3-7% 예상.

매 응용

  1. CI/CD 의 carbon budget enforcement.
  2. Cloud region selection (Quebec hydro vs us-east-1 mixed).
  3. Model serving optimization (batch, KV cache reuse).
  4. CSRD reporting (EU large company mandate).

💻 패턴

codecarbon (Python tracking)

from codecarbon import EmissionsTracker

tracker = EmissionsTracker(project_name="train_run")
tracker.start()
try:
    train_model()
finally:
    emissions_kg = tracker.stop()
    print(f"Run emitted {emissions_kg:.4f} kg CO2eq")

Carbon-aware scheduler

import requests

def grid_intensity(region: str) -> float:
    # WattTime / Electricity Maps API
    r = requests.get(f"https://api.electricitymaps.com/v3/carbon-intensity/latest?zone={region}",
                     headers={"auth-token": KEY})
    return r.json()["carbonIntensity"]  # gCO2/kWh

def best_region(regions: list[str]) -> str:
    return min(regions, key=grid_intensity)

# usage
target_region = best_region(["us-west-2", "ca-central-1", "eu-north-1"])
schedule_job(region=target_region)

Quantization for inference

from transformers import AutoModelForCausalLM, BitsAndBytesConfig
import torch

bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype=torch.bfloat16)
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.3-70B", quantization_config=bnb)
# 4-bit quantization → ~75% memory + energy reduction vs fp16

Cloud Run min-instances=0 (cold start tradeoff)

# cloudrun.yaml — 매 idle 시 0 instance, 매 traffic 의 cold start 허용
spec:
  template:
    spec:
      containers:
        - image: gcr.io/proj/api
      containerConcurrency: 80
    metadata:
      annotations:
        autoscaling.knative.dev/minScale: "0"

Carbon budget CI gate

# .github/workflows/carbon.yml
- name: Run with codecarbon
  run: python train.py
- name: Check budget
  run: |
    EMISSIONS=$(jq -r .emissions_kg emissions.json)
    if (( $(echo "$EMISSIONS > 5.0" | bc -l) )); then
      echo "::error::Carbon budget exceeded: ${EMISSIONS}kg > 5kg"; exit 1
    fi

Green model selection

# 매 task 의 simplest sufficient model
from anthropic import Anthropic
client = Anthropic()

def route_query(complexity: int, query: str):
    model = "claude-haiku-4-5" if complexity < 3 else "claude-opus-4-7"
    return client.messages.create(model=model, max_tokens=1024,
                                  messages=[{"role": "user", "content": query}])
# Haiku 의 ~10-20x energy-cheaper than Opus

매 결정 기준

상황 Action
매 training large model clean-grid region + spot + checkpoint
매 inference at scale quantize + batch + KV cache
매 simple query smallest sufficient model (Haiku, Sonnet)
매 reporting mandate codecarbon + CSRD format
매 datacenter choice Iceland, Quebec, Norway > us-east-1

기본값: 매 measure first (codecarbon) + 매 model right-size + 매 carbon-aware region.

🔗 Graph

🤖 LLM 활용

언제: 매 model selection (right-size), 매 prompt caching aggressive use (cache hit ~90% energy reduction), 매 batch API. 언제 X: 매 user-facing latency-critical (단, model-route hybrid 가능).

안티패턴

  • 매 항상 Opus 사용: 매 simple task 도 frontier model — 10-20x energy waste.
  • Cache 미사용: 매 prompt caching 의 cache miss 가 every call → energy + cost.
  • Greenwashing: 매 carbon offset 만 사고 actual reduction X — credibility crash.
  • Single region lock-in: 매 dirty grid 의 stuck — multi-region 로 carbon-aware schedule.

🧪 검증 / 중복

  • Verified (Green Software Foundation principles 2021+; Patterson et al. 2021 "Carbon Emissions and Large Neural Network Training"; EU CSRD 2024 effective; IEA 2024 datacenter report).
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — ESG + AI footprint + green coding patterns