명령줄 인터페이스

Qualcomm® AI Hub 는 다음을 수행하는 데 사용할 수 있는 명령줄 도구가 설치되어 있습니다.

  • 장치 정보 나열

  • 모델 컴파일

  • 모델 프로파일링

  • 클라이언트 구성

명령의 전체 목록과 모든 옵션은 다음을 사용하여 얻을 수 있습니다.

qai-hub --help

각 명령에 대해 확장된 전체 도움말은 다음을 사용하여 얻을 수 있습니다.

qai-hub submit-profile-job --help

예시

가장 인기 있는 워크플로에 CLI를 사용하는 몇 가지 예는 다음과 같습니다.

장치 선택

# List all devices
qai-hub list-devices

# List all devices with Snapdragon 8 Gen 2
qai-hub list-devices --device-attr chipset:qualcomm-snapdragon-8gen2

프레임워크 선택

# List all frameworks
qai-hub list-frameworks

모델 업로드

# Upload PyTorch model
qai-hub upload-model --model ./SqueezeNet10.pt

모델 컴파일

# Compile a PyTorch model for TFLite
qai-hub submit-compile-job --model ./SqueezeNet10.pt --input_specs "{'image': (1, 3, 224, 224)}" --device "Samsung Galaxy S23"

# Compile a previous uploaded PyTorch model for QNN
qai-hub submit-compile-job --model m6wn0xn8j --input_specs "{'image': (1, 3, 224, 224)}" --device "Samsung Galaxy S23" --compile_options "--target_runtime qnn_lib_aarch64_android"

# Clone a previous profile job and block until job completes
qai-hub submit-compile-job --clone j1glw6y8p --wait

모델 프로파일링

# Profile a TensorFlow lite model from disk
qai-hub submit-profile-job --model ./SqueezeNet10.tflite --device "Samsung Galaxy S23"

# Profile a model compiled by a previous job using the model ID and block until job completes
qai-hub submit-profile-job --model mejqyvqry --device "Samsung Galaxy S23" --wait

# Profile a model with profiling options
qai-hub submit-profile-job --model mejqyvqry --device "Samsung Galaxy S23" --profile_options " --compute_unit gpu"

# Clone a previous profile job
qai-hub submit-profile-job --clone jogkwr02g

인기 있는 결합 워크플로

# Compile and profile a PyTorch model
qai-hub submit-compile-and-profile-jobs --model ./SqueezeNet10.pt --input_specs "{'image': (1, 3, 224, 224)}" --device "Samsung Galaxy S23"