Yolo 비전 선전
선전
지금 참여하기
용어집

서버리스 컴퓨팅

서버리스 컴퓨팅이 확장성, 비용 효율성 및 빠른 배포를 통해 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.

AI를 위한 서버리스의 메커니즘

서버리스 컴퓨팅의 핵심에는 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) 워크플로우 및 데이터 파이프라인에 특히 효과적입니다.

  • 자동화된 데이터 전처리: 사용자가 Amazon S3와 같은 저장 서비스에 원시 데이터셋을 업로드하면, 서버리스 함수가 즉시 데이터 전처리를 수행하도록 트리거될 수 있습니다. 이 함수는 데이터가 훈련 데이터 파이프라인에 진입하기 전에 이미지 크기 조정, 픽셀 값 정규화 또는 파일 형식 검증을 수행하여 수동 개입 없이 일관성을 보장합니다.
  • 주문형 스마트 감시: 보안 분야의 인공지능에서 동작 감지기가 카메라를 작동시켜 프레임을 캡처할 수 있습니다. 이 이벤트는 객체 탐지 모델을 호스팅하는 클라우드 함수를 호출합니다. 모델은 이미지를 분석하여 무해한 동물과 잠재적 침입자를 구분하며, 필요한 경우에만 경보를 발령합니다. 이는 지속적인 스트리밍에 비해 대역폭 및 저장 비용을 획기적으로 절감합니다.

Python 예제: 서버리스 추론 핸들러

다음 코드는 개념적인 서버리스 핸들러를 보여줍니다. 이 핸들러는 "웜 스타트"(요청 사이에도 컨테이너가 활성 상태를 유지하는 것)의 이점을 활용하기 위해 전역 모델 인스턴스를 초기화하고, 들어오는 이미지 경로를 처리합니다.

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에서 흔히 사용되는 다른 인프라 모델과 이를 구분해야 합니다.

  • 서버리스 대 엣지 컴퓨팅: 둘 다 효율성 최적화를 목표로 하지만 서로 다른 위치에서 작동합니다. 엣지 컴퓨팅은 네트워크 이동 시간을 최소화하기 위해 장치(예: 스마트 카메라 또는 IoT 기기)에서 데이터를 로컬로 처리합니다. 서버리스 컴퓨팅은 중앙 집중식 퍼블릭 클라우드에서 발생합니다. 하이브리드 솔루션은 종종 초기 데이터를 엣지에서 처리하고 복잡한 이상 현상을 서버리스 클라우드 함수로 전송하여 심층적인 의료 영상 분석이나 법의학적 검토를 수행합니다.
  • 서버리스 vs. 쿠버네티스: 쿠버네티스는 컨테이너화를 위한 오케스트레이션 플랫폼으로, 개발자가 클러스터 환경, 네트워킹 및 포드에 대한 세밀한 제어를 가능하게 합니다. 강력하지만 상당한 관리 오버헤드가 필요합니다. Google Functions나 Azure Functions 같은 서버리스 플랫폼은 이러한 오케스트레이션을 완전히 추상화하여 팀이 노드의 상태보다는 코드 로직에만 집중할 수 있게 합니다.
  • Serverless vs. IaaS: Infrastructure-as-a-Service (IaaS) provides virtualized computing resources over the internet, like Amazon EC2. With IaaS, the user is responsible for patching the operating system and managing middleware. In contrast, serverless computing removes these operational responsibilities, allowing developers to focus on higher-level tasks like improving image classification accuracy.

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.

Ultralytics 커뮤니티 가입

AI의 미래에 동참하세요. 글로벌 혁신가들과 연결하고, 협력하고, 성장하세요.

지금 참여하기