서버리스 컴퓨팅이 확장성, 비용 효율성 및 빠른 배포를 통해 AI/ML에 혁명을 일으키는 방법을 알아보세요. 오늘 더 스마트하고 빠르게 구축하세요!
Serverless computing is a cloud execution model that enables developers to build and run applications without the complexity of managing infrastructure. In this paradigm, the cloud provider dynamically manages the allocation and provisioning of servers, abstracting the underlying hardware and operating systems away from the user. Code is executed in stateless containers triggered by specific events, such as an HTTP request, a database modification, or a file upload. This approach is highly relevant to modern cloud computing strategies, as it allows organizations to pay only for the compute time consumed, automatically adhering to scalability requirements by expanding from zero to thousands of instances based on traffic demand.
서버리스 컴퓨팅의 핵심에는 FaaS(Function-as-a-Service) 개념이 자리 잡고 있습니다. 이는 애플리케이션을 개별적인 작업을 수행하는 독립적인 함수들로 분해하는 방식입니다. 머신 러닝(ML) 실무자에게 이는 모델 배포를 위한 간소화된 경로를 제공합니다. 트래픽이 적은 시간대에 유휴 상태인 전용 서버를 유지 관리하는 대신, 서버리스 함수는 데이터 처리를 위해 필요에 따라 즉시 가동되고 작업 완료 후 즉시 종료될 수 있습니다.
However, a key consideration in this architecture is the "cold start"—the latency incurred when a function is invoked for the first time or after a period of inactivity. To mitigate this, developers often use lightweight architectures like YOLO26 or techniques like model quantization to ensure rapid loading times, which is essential for maintaining low inference latency.
서버리스 아키텍처는 이벤트 기반 컴퓨터 비전(CV) 워크플로우 및 데이터 파이프라인에 특히 효과적입니다.
다음 코드는 개념적인 서버리스 핸들러를 보여줍니다. 이 핸들러는 "웜 스타트"(요청 사이에도 컨테이너가 활성 상태를 유지하는 것)의 이점을 활용하기 위해 전역 모델 인스턴스를 초기화하고, 들어오는 이미지 경로를 처리합니다.
from ultralytics import YOLO
# Initialize the model outside the handler to cache it for subsequent requests
# YOLO26n is ideal for serverless due to its compact size and speed
model = YOLO("yolo26n.pt")
def lambda_handler(event, context):
"""Simulates a serverless function handler triggered by an event. 'event' represents the input payload containing
the image source.
"""
image_source = event.get("url", "https://ultralytics.com/images/bus.jpg")
# Perform inference
results = model(image_source)
# Return prediction summary
return {
"statusCode": 200,
"body": {
"objects_detected": len(results[0].boxes),
"top_class": results[0].names[int(results[0].boxes.cls[0])] if len(results[0].boxes) > 0 else "None",
},
}
서버리스 컴퓨팅을 이해하려면 MLOps에서 흔히 사용되는 다른 인프라 모델과 이를 구분해야 합니다.
By leveraging serverless architectures, developers can deploy robust AI solutions that are cost-effective and capable of handling unpredictable workloads, utilizing tools like the Ultralytics Platform to streamline the model training and management process before deployment.