REPO STORY / 레포 이야기
pytorch/executorch
PyTorch 모델을 스마트폰·마이크로컨트롤러 등 엣지 기기에 직접 배포하는 온디바이스 AI 런타임
01 / 뭐 하는 레포인가요?
어떤 일을
도와주나요?
ExecuTorch는 PyTorch 모델을 가벼운 실행 파일로 변환해 휴대폰이나 임베디드 기기에서 AI를 실행하도록 도와주는 도구예요. ONNX나 TFLite처럼 형식을 바꾸지 않고 PyTorch 그대로 내보낼 수 있어서, 연구에서 배포까지 간편하게 넘어갈 수 있습니다. 인스타그램·WhatsApp·Meta 스마트글래스처럼 Meta의 앱들이 실제로 사용 중이고, 50KB 정도의 작은 런타임으로 어떤 기기에서나 빠르게 실행됩니다.
- Native PyTorch export(형식 변환 없음)
- 12+ 하드웨어 백엔드(XNNPACK, CoreML, Qualcomm, Vulkan 등)
- 50KB 초경량 런타임으로 마이크로컨트롤러~스마트폰 지원
- 일괄 양자화·메모리 계획·선택적 빌드로 엣지 최적화
PyTorch 생태계와 완전 통합되어 .onnx나 .tflite 같은 중간 형식 변환 없이 직접 내보낼 수 있고, Meta의 수십억 사용자 제품에서 검증된 프로덕션 기술입니다.
02 / 내 상황에 맞을까?
이럴 때 써요,
선택 전에 확인해요.
이럴 때 써요
- 스마트폰 앱에 LLM(Llama) 통합하여 오프라인 텍스트 생성 실행
- IoT 기기나 마이크로컨트롤러에서 이미지 분류(MobileNetV2) 또는 객체 인식(YOLO) 추론
- Meta 스마트글래스처럼 VR/AR 기기에서 실시간 음성·비전 멀티모달 모델 구동
이럴 땐 다시 확인해요
아래 준비 조건이 맞지 않으면 먼저 환경을 준비해 주세요.
- Python 3.9+
- PyTorch 설치
깃밥 한국어 요약의 활용 예와 준비 조건을 옮겼어요.
03 / 시작하려면
첫 걸음,
차근차근.
준비할 것
- Python 3.9+
- PyTorch 설치
- ExecuTorch 설치하기
pip install executorch
- PyTorch 모델 내보내기
# Python 코드로 모델 export
python3 << 'EOF'
import torch
from executorch.exir import to_edge_transform_and_lower
from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
model = torch.nn.Linear(10, 5).eval()
example_inputs = (torch.randn(1, 10),)
exported_program = torch.export.export(model, example_inputs)
program = to_edge_transform_and_lower(
exported_program,
partitioner=[XnnpackPartitioner()]
).to_executorch()
with open("model.pte", "wb") as f:
f.write(program.buffer)
print("Model exported to model.pte")
EOF
- 로컬에서 실행 테스트하기
python3 << 'EOF'
from executorch.runtime import Runtime
import torch
runtime = Runtime.get()
method = runtime.load_program("model.pte").load_method("forward")
outputs = method.execute([torch.randn(1, 10)])
print("Output shape:", outputs[0].shape)
EOF
- Llama 모델 내보내기 (선택사항)
python -m executorch.extension.llm.export.export_llm --model llama3_2 --output llama.pte
명령은 기존 요약에 적힌 그대로예요. 실행하거나 설치 성공을 검증하지 않았어요. 공식 소요시간 미제시.
04 / 이웃 레포
어떤 레포와 연결될까요?
비교 연결망의 정적 스냅샷 · 관계 종류와 기록된 근거예요. 현재 공개된 레포만 표시해요.
현재 표시할 공개 이웃 레포가 없어요.
비교함에서 연결망 보기 ↗