«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Link
관리 메뉴

영만이네

[Kserve + TensorRT + Triton Inference Server] Error Code 1: Serialization & Error Code 4: Internal Error (Engine deserialization failed.) 에러 본문

개발/Forgettable

[Kserve + TensorRT + Triton Inference Server] Error Code 1: Serialization & Error Code 4: Internal Error (Engine deserialization failed.) 에러

YoungMaan 2022. 10. 17. 22:48

TensorRT 모델을 Triton Interface Server를 k8s Kserve를 이용하여 배포할 일이 생겼다.

 

테스트를 위해서 BERT 기반 간단한 감성분석 모델을 만들었고 torch-tensorrt plan 파일 생성까지 마친 후...

yaml 파일을 통해 실행시켰으나 다음과 같은 오류를 만났다.

 

Error Code 1: Serialization & Error Code 4: Internal Error

 ============================= 
 == Triton Inference Server == 
 ============================= 
 NVIDIA Release 22.09 (build 44909143) 
 Triton Server Version 2.26.0 
 Copyright (c) 2018-2022, NVIDIA CORPORATION & AFFILIATES.  All rights reserved. 
 Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES.  All rights reserved. 
 This container image and its contents are governed by the NVIDIA Deep Learning Container License. 
 By pulling and using the container, you accept the terms and conditions of this license: 
 https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license 
 NOTE: CUDA Forward Compatibility mode ENABLED. 
   Using CUDA 11.8 driver version 520.61.03 with kernel driver version 450.80.02. 
   See https://docs.nvidia.com/deploy/cuda-compatibility/ for details. 
 I1017 11:02:04.611305 1 pinned_memory_manager.cc:240] Pinned memory pool is created at '0x7f474e000000' with size 268435456 
 I1017 11:02:04.613498 1 cuda_memory_manager.cc:105] CUDA memory pool is created on device 0 with size 67108864 
 I1017 11:02:04.691001 1 model_lifecycle.cc:459] loading: sentiment:1 
 I1017 11:02:04.740565 1 tensorrt.cc:5442] TRITONBACKEND_Initialize: tensorrt 
 I1017 11:02:04.740611 1 tensorrt.cc:5452] Triton TRITONBACKEND API version: 1.10 
 I1017 11:02:04.740617 1 tensorrt.cc:5458] 'tensorrt' TRITONBACKEND API version: 1.10 
 I1017 11:02:04.740622 1 tensorrt.cc:5486] backend configuration: 
 {"cmdline":{"auto-complete-config":"true","min-compute-capability":"6.000000","backend-directory":"/opt/tritonserver/backends","default-max-batch-size":"4"}} 
 I1017 11:02:04.794741 1 tensorrt.cc:5591] TRITONBACKEND_ModelInitialize: sentiment (version 1) 
 I1017 11:02:06.109300 1 logging.cc:49] Loaded engine size: 426 MiB 
 E1017 11:02:06.685361 1 logging.cc:43] 1: [stdArchiveReader.cpp::StdArchiveReader::32] Error Code 1: Serialization (Serialization assertion magicTagRead == kMAGIC_TAG failed.Magic tag does not match) 
 E1017 11:02:06.692797 1 logging.cc:43] 4: [runtime.cpp::deserializeCudaEngine::66] Error Code 4: Internal Error (Engine deserialization failed.)

 

구글링해보니 TRT  building과 deserializing에 사용된 버전이 달라서라는데

관련해서 많은 삽질을 해봐도 동일한 오류가 났다.

 

다시 처음부터 하자는 마음으로 진행한 결과.

바보 같은 실수를 하고 있었으니

model_repository < have to be here
|
+-- sentiment < but here...
    |
    +-- config.pbtxt
    +-- 1
        |
        +-- model.pt

 

저장소 지정을 model_repository가 아닌 sentiment 모델 자체에 하고 있던 것이였다.

model_repository로 변경해서 적용하니 모델은 바로 ready 상태로 돌아갔다.

구글에는 이런 바보짓으로 올리는 사람이 없어서 글을 적어본다.

나 같은 사람이 더 이상 없길 바라며...

Comments