Apple Core AI 통합#
coreai-core은 macosx_26_0_arm64 wheels만 게시하므로 내보내기는 Apple silicon Mac에서 실행됩니다. 내보낸 .aimodel는 iOS 27 및 macOS 27에서 실행됩니다. Ultralytics iOS 및 Flutter SDK는 아직 .aimodel assets를 로드하지 못하므로 해당 환경에서는 Core ML을 사용합니다.
Core AI는 neural network를 Apple silicon에서 직접 실행하기 위한 Apple의 새로운 framework입니다. .aimodel model format, 최신 Swift inference API, PyTorch 기반 conversion tools, ahead-of-time compilation, model specialization, 전용 debugging 및 profiling tools를 도입합니다.
Apple은 Core AI를 on-device AI 실행의 다음 단계이자 on-device Apple Intelligence를 지원하는 inference framework로 설명합니다. compact vision models부터 large generative models까지 현재 neural network architectures를 대상으로 설계되었으며, CPU, GPU 및 Apple Neural Engine (ANE) 간에 작업을 예약할 수 있습니다.
Core AI는 Core ML의 새로운 이름이 아니라 새로운 deployment path입니다. 두 framework는 서로 다른 model formats, conversion tools, runtime APIs 및 application-integration patterns를 사용합니다.
Core AI와 Core ML 비교#
| 기능 | Core AI | Core ML |
|---|---|---|
| Model artifact | .aimodel | .mlpackage 또는 .mlmodel |
| Ultralytics export | format=coreai에서 사용 가능 | format=coreml에서 사용 가능 |
| Apple runtime API | AIModel, InferenceFunction 및 NDArray | MLModel, 일반적으로 VNCoreMLModel 및 VNCoreMLRequest를 통해 사용 |
| Conversion workflow | PyTorch torch.export에서 coreai-torch까지 | coremltools을 통한 TorchScript conversion |
| Primary focus | Modern neural networks 및 generative AI | neural 및 non-neural models를 포함한 광범위한 machine learning deployment |
| Image integration | Applications는 tensors를 준비하거나 Core AI image descriptors 및 buffers를 사용합니다 | image scaling, orientation 및 requests를 위한 Vision framework와의 직접 통합 |
| Hardware | CPU, GPU 및 Apple Neural Engine | CPU, GPU 및 Apple Neural Engine |
| Model preparation | 설치 또는 최초 사용 시 specialization을 수행하며, 선택적으로 ahead-of-time compilation을 사용할 수 있습니다 | Xcode 또는 on-device model compilation |
| Custom operations | Custom Core AI lowerings 및 Metal kernels | Core ML custom layers 및 지원되는 MIL operations |
| Deployment availability | 새로운 Apple operating-system generation, 현재 beta | 기존 Apple operating systems 전반에서 폭넓게 지원 |
| Ultralytics iOS 및 Flutter SDKs | 아직 지원되지 않음 | 완전히 지원됨 |
애플리케이션에 광범위한 device coverage, Vision framework integration 또는 decision trees와 tabular pipelines 같은 model types가 필요한 경우에는 Core ML이 여전히 적절한 선택입니다. Apple은 Core ML을 계속 지원하며 non-neural model types를 사용하는 개발자에게 Core ML을 안내합니다.
Core AI Format 작동 방식#
Core AI authoring workflow는 PyTorch model에서 시작합니다.
PyTorch model
↓ torch.export
ExportedProgram
↓ coreai-torch
Core AI program
↓ optimize and save
.aimodel
↓ specialize or compile ahead of time
Apple silicon executableApple의 coreai-torch package는 PyTorch ATen operations를 Core AI operations로 lowering하여 torch.export.ExportedProgram를 변환합니다. 지원되지 않는 operations는 custom lowering 또는 custom Metal kernel로 구현할 수 있습니다.
결과로 생성되는 .aimodel은 specialization되지 않은 model asset입니다. 애플리케이션이 model을 준비하면 Core AI가 target device에 맞게 specialization을 수행합니다. 애플리케이션은 최초 사용 시 이 작업을 수행하도록 하거나, specialization을 더 일찍 요청하거나, 초기 loading time을 줄이기 위해 ahead-of-time compiled model을 포함할 수 있습니다.
Swift에서 애플리케이션은 Core AI framework로 asset을 로드하고, inference function을 선택하며, typed NDArray inputs를 제공하고, 이름이 지정된 outputs를 받습니다. 이는 Core ML model을 Vision request로 감싸는 방식과 다르므로, Core AI를 도입하려면 .aimodel assets용으로 설계된 application runtime이 필요합니다.
구현 세부 정보는 Apple의 AIModel, model specialization and caching 및 ahead-of-time compilation 문서를 참조하십시오.
YOLO26 Models를 Core AI로 내보내기#
from ultralytics import YOLO
model = YOLO("yolo26n.pt")
model.export(format="coreai") # creates 'yolo26n.aimodel'
model.export(format="coreai", quantize=16) # FP16 asset
# Run the exported model
coreai_model = YOLO("yolo26n.aimodel")
results = coreai_model("https://ultralytics.com/images/bus.jpg")전체 argument list는 Export mode를 참조하십시오. graph는 static입니다. export에 전달된 imgsz에서 trace되므로 동일한 size로 predict해야 합니다. Ultralytics metadata는 asset 자체의 metadata.json 내부에 포함되므로 class names, stride 및 task가 round trip 후에도 유지됩니다.
Head 선택#
nms=False을 사용하면 YOLO26은 그래프 내에서 검출을 선택하는 엔드투엔드 헤드를 내보냅니다. Core AI에는 상위 k 프리미티브가 없으므로 해당 선택은 전체 정렬로 낮아지며 Apple Neural Engine 파티션 경계에서 max_det에 관계없이 약 1.7 ms의 고정 비용이 부과됩니다. nms=None로 내보내면 대신 원시 (1, 84, 8400) 예측을 출력하고 비최대 억제는 예측기에 맡깁니다.
yolo export model=yolo26n.pt format=coreai nms=None quantize=16iOS 27.0을 실행하는 iPhone 17 Pro에서 640 크기의 YOLO26n은 헤드가 그래프에 포함된 경우 3.01 ms, 포함되지 않은 경우 1.28 ms를 기록합니다(FP16, 사전 컴파일됨, 50회 반복의 3개 인터리브 블록). 둘 다 추론을 위해 YOLO(...)을 통해 왕복합니다. 단일 그래프 호출이 완료된 검출 결과를 반환해야 하는 경우 nms=False을 사용하고, 외부 NMS의 경우 기본값인 nms=None를 유지하십시오.
iOS 27 또는 macOS 27에서는 애플리케이션이 Apple의 Core AI Swift API를 통해 내보낸 asset을 로드하고 실행하게 됩니다. 내보낸 assets는 entrypoint main을 사용하고, shape이 [batch, 3, imgsz, imgsz]인 단일 images input을 받으며, output0을 반환합니다.
import CoreAI
let modelURL = Bundle.main.url(forResource: "yolo26n", withExtension: "aimodel")!
let model = try await AIModel(contentsOf: modelURL)
guard let function = try model.loadFunction(named: "main") else {
throw AppError.missingInferenceFunction
}
let outputs = try await function.run(inputs: ["images": imageTensor])현재의 Core ML and Vision workflow와 달리, 향후 Core AI path에서는 Ultralytics iOS SDK에서 image preprocessing, NDArray construction, model metadata 및 output decoding을 정의해야 합니다. Apple은 Core AI framework documentation에서 현재 API 세부 정보를 제공하며, Core AI models repository에서 working model examples를 제공합니다.
Core AI의 장점#
Core AI는 향후 Ultralytics deployment에 몇 가지 유망한 장점을 제공합니다.
- Modern PyTorch export path: Conversion은
torch.export에서 시작하므로, 기존 exporter 다수가 사용하는 tracing workflow보다 표현력이 높은 PyTorch graph를 보존합니다. - Fine-grained runtime control: 애플리케이션은 specialization, compiled-model caches, inference functions, memory 및 compute placement를 관리할 수 있습니다.
- Advanced model support: Stateful execution, dynamic shapes, 하나의 artifact에 여러 functions를 포함하는 기능 및 custom Metal kernels는 modern vision 및 generative architectures를 위해 설계되었습니다.
- Dedicated developer tools: Core AI Debugger는 graphs와 tensor values를 검사하고 이를 원래의 Python code까지 추적할 수 있습니다. Xcode 및 Instruments는 runtime profiling을 제공합니다.
- Zero-copy opportunities: Core AI는 camera, graphics 및 inference workloads 간의 copy를 줄이기 위한 storage 및 buffer controls를 제공합니다.
- Apple-silicon optimization: Device specialization을 통해 Apple은 특정 device에서 사용 가능한 CPU, GPU 및 Neural Engine에 맞게 model을 최적화할 수 있습니다.
- Flexible compression: Apple의 Core AI Optimization tools는 low-bit weight formats를 포함하여 quantization, palettization 및 pruning을 지원합니다.
이러한 capabilities는 dynamic execution, larger multimodal components 또는 기존 Core ML operations에 깔끔하게 매핑되지 않는 custom operations를 사용하는 향후 YOLO models에 특히 유용할 수 있습니다.
현재의 단점 및 제한 사항#
Core AI는 현재 production Core ML path를 대체하지 않습니다.
- New operating systems required: Public framework는 iOS 27 및 macOS 27 generation을 대상으로 하는 반면, Core ML은 훨씬 더 큰 installed base를 지원합니다.
- Beta software: Apple의 Core AI framework와 Python toolchain의 일부는 아직 preliminary 상태이며 stable releases 전에 변경될 수 있습니다.
- Narrower export environment:
coreai-torch은 현재 Python 3.11 이상 및 3.14 미만과 최신 PyTorch versions를 요구하므로, Ultralytics가 지원하는 Python 및 PyTorch range보다 훨씬 좁습니다. - Export runs on macOS only:
coreai-core은macosx_26_0_arm64wheels만 게시하므로format=coreai에는 macOS 26 이상을 실행하는 Apple silicon Mac이 필요합니다. - No Ultralytics application runtime yet: 공식 YOLO iOS app 및 Flutter plugin은 현재
MLModel및 Vision을 통해 Core ML artifacts를 로드합니다. - Application migration required:
.aimodel은.mlpackage을 대신할 수 없습니다. Model loading, preprocessing, inference calls, metadata handling 및 output decoding을 Core AI implementation으로 작성해야 합니다. - Limited production evidence: 지원되는 YOLO task 및 device matrix 전반에서 performance, power use, first-run specialization time, accuracy 및 compression을 검증해야 합니다.
- NMS 파이프라인 없음: Core ML은 이전 YOLO 검출 모델을 위해 NMS 단계를 패키징할 수 있습니다. Core AI는 기본적으로 원시 일대다 예측을 내보내며, YOLO26의 NMS 없는 헤드에는
nms=False을 사용하십시오. 포함된 NMS(nms=True)와dynamic=True는 지원되지 않습니다.coreai-torch에는torchvision::nms에 대한 로어가 없으므로 NMS는 호스트에 유지됩니다. - Fixed input size: 내보낸 graph는 하나의
imgsz에서 trace되며 dynamic shapes가 없으므로 내보낼 때 사용한 size로 predict해야 합니다. - FP16 assets can abort on load: 일부 FP16
.aimodelassets는 Apple Neural Engine program을 로드하지 못하고 MPSGraph가 failed assertion을 발생시켜 fallback하지 않고 process를 종료합니다. 이는 Ultralytics code가 실행되기 전에 Apple runtime 내부에서 발생하며, 동일한 asset은 CPU-only specialization으로 로드됩니다. upstream에서 수정될 때까지 FP32를 사용하십시오.
어떤 Apple Format을 사용해야 합니까?#
다음이 필요하다면 Core ML today를 사용하십시오.
- 현재 및 이전 Apple operating systems 전반에 배포
- Ultralytics iOS 또는 Flutter SDK와의 통합
- Vision framework image handling
- 테스트된 FP16 및 INT8 YOLO deployment
- 호환되는 legacy detection models를 위한 embedded NMS
iOS 27 또는 macOS 27을 요구할 수 있고 다음이 필요하다면 Core AI를 평가하십시오.
- 최신 Apple on-device neural network runtime
- 명시적인 specialization 및 cache management
- Advanced dynamic 또는 stateful model execution
- Custom Core AI operations 또는 Metal kernels
- 상세한 Core AI graph debugging 및 runtime profiling
애플리케이션이 전환하는 동안 Core ML과 Core AI는 함께 사용될 것으로 예상됩니다. 두 framework의 deployment targets 및 application contracts가 서로 다르므로 Core AI를 지원하더라도 Core ML이 즉시 필요 없어지는 것은 아닙니다.
Ultralytics Roadmap#
전용 coreai export target이 구현되었습니다. Export 및 numerical validation은 지원되는 YOLO26 task models를 대상으로 하며 macOS 26의 Ultralytics CI에서 지속적으로 실행되고, FP16 latency는 device에서 측정됩니다. Core AI가 Core ML path와 동등한 수준에 도달하기 전에 남은 roadmap은 다음과 같습니다.
- Ultralytics iOS SDK에서 Core AI model loading 및 preprocessing.
- Flutter integration 및 iOS 27 미만 devices를 위한 compatibility strategy.
- Stable Apple framework 및 conversion-tool releases(iOS 27 및 macOS 27 generation은 현재 beta입니다).
- 지원되는 device matrix 전반의 memory, power 및 specialization benchmarks.
Ultralytics iOS 또는 Flutter SDK가 필요하거나 iOS 27 미만의 coverage가 필요한 애플리케이션에는 Core ML이 계속 권장 target입니다. 나머지 항목은 Ultralytics roadmap 및 release notes를 따르십시오.
추가 리소스#
- Apple Core AI overview
- Core AI framework documentation
- Core AI PyTorch Extensions
- Core AI Optimization
- Apple Core AI models repository
- Ultralytics Core ML 통합
FAQ#
예. macOS 26 이상을 실행하는 Apple silicon Mac에서
model.export(format="coreai")또는yolo export format=coreai을 사용하여 export할 수 있으며, export된.aimodel는 iOS 27 및 macOS 27에서 실행됩니다. Ultralytics iOS 및 Flutter SDK와 해당 세대보다 이전 버전의 운영체제에서는format="coreml"를 사용하여 Core ML.mlpackage파일을 export합니다.즉시 대체하지는 않습니다. Core AI는 최신 신경망을 위한 Apple의 새로운 경로인 반면, Core ML은 계속 지원되며 더 폭넓은 운영체제 지원, Vision 통합 및 비신경망 모델 지원을 제공합니다.
아니요. 두 형식은 서로 다른 모델 표현을 포함하며 서로 다른 프레임워크에서 로드됩니다. 변환은 적절한 Apple 툴체인을 통해 소스 모델에서 시작해야 합니다.
초기 통합은 Core ML과 함께 사용될 것으로 예상됩니다. 향후 대체 여부는 운영체제 도입, 안정적인 툴링, 성능, 그리고 이후의 iOS 및 Flutter 지원에 따라 결정됩니다.