How to Use Furiosa SDK from Start to Finish 예제 관련 오류

위 링크의 예제를 실행하던 중


위 영역에서 입출력 에러가 발생합니다.

에러내용은 아래와 같습니다.
uNpuDrv (E) [npu_pdma_to_device_sync:370] ioctl(PDMA_TO_DEVICE) failed[57224.196073668]
uNpuDrv (E) [__submit_bio:620] write failed, Input/output error
uNpuDrv (E) [npu_pdma_from_device_sync:388] ioctl(PDMA_FROM_DEVICE) failed[57274.424496334]
uNpuDrv (E) [dma_from_device_sync:690] read failed, Input/output error

그리고 예제 실행 결과 첫번째 실행에서 예제와 달리 지연이 12ms가 아닌 133ms로 차이가 납니다.
두번째 실행에서 정확도가 조금 떨어지고 지연이 1ms 증가합니다.

환경셋팅

혹시 제가 뭔가를 빠트린 걸까요?
예제를 다시 확인하고 두번째로 실행해도 같은 오류와 긴 지연시간이 발생합니다.

안녕하세요 FuriosaAI 정영범입니다.

카카오 클라우드에서 사용하시는 것으로 보이는데 맞을까요?
소속 회사를 알려주시면 카카오에 문의해서 해당 pod을 살펴보겠습니다.
Pod을 다시 생성해야 할 수도 있으니 중요한 파일이 있다면 백업을 부탁 드립니다.

카카오 클라우드에서 사용하는 것이 아닙니다.
개인용 우분투 20.04에서 설치해서 진행중입니다.
실리콘아츠입니다.

1 Like

답변 감사합니다.

정확한 원인 파악을 위해 아래와 같이 실행을 해주시겠어요?

git clone https://github.com/furiosa-ai/furiosa-sdk

cd ./furiosa-sdk/examples/inferences

./image_classify.py ../assets/images/car.jpg

스크린샷, 2023-10-05 16-42-25

위는 셋팅 환경입니다. gpu는 없고 2200g cpu에 그래픽카드가 내장되어 있는 걸로 알고 있습니다.

(furiosa) nobleteam@nobleteam-desktop:~/furiosa-sdk/examples/inferences$ ./image_classify.py …/assets/images/car.jpg
libfuriosa_hal.so — v0.11.0, built @ 43c901f
Loading and compiling the model /home/nobleteam/furiosa-sdk/examples/inferences/…/assets/quantized_models/imagenet_224x224_mobilenet_v1_uint8_quantization-aware-trained_dm_1.0_without_softmax.tflite
2023-10-05T06:37:20.503516Z INFO furiosa_rt_core::driver::event_driven::coord: FuriosaRT (v0.10.1, rev: e710d5f8c, built at: 2023-09-22T00:49:24Z) bootstrapping …
2023-10-05T06:37:20.508989Z INFO furiosa_rt_core::driver::event_driven::coord: Found furiosa-compiler (v0.10.0, rev: f8f05c8, built at: 2023-08-08T11:58:09Z)
2023-10-05T06:37:20.509012Z INFO furiosa_rt_core::driver::event_driven::coord: Found libhal (type: warboy, v0.11.0, rev: 43c901f built at: 2023-08-08T12:07:35Z)
2023-10-05T06:37:20.509020Z INFO furiosa_rt_core::driver::event_driven::coord: [Runtime-0] detected 1 NPU device(s):
2023-10-05T06:37:20.514607Z INFO furiosa_rt_core::driver::event_driven::coord: - [0] npu:0:0-1 (warboy-b0-2pe, 128dpes, firmware: 1.7.2, e1c4288)
2023-10-05T06:37:20.515227Z INFO furiosa_rt_core::driver::event_driven::coord: [Runtime-0] started
2023-10-05T06:37:20.520972Z INFO furiosa::runtime: Saving the compilation log into /home/nobleteam/.local/state/furiosa/logs/compiler-20231005153720-d1apag.log
2023-10-05T06:37:20.527292Z INFO furiosa_rt_core::driver::event_driven::coord: [Runtime-0] created Sess-148e3f60 using npu:0:0-1
2023-10-05T06:37:20.535108Z INFO furiosa_rt_core::driver::event_driven::coord: [Sess-148e3f60] compiling the model (target: warboy-b0-2pe, 128dpes, file: imagenet_224x224_mobilenet_v1_uint8_quantization-aware-trained_dm_1.0_without_softmax.tflite, size: 4.1 MiB)
[1/6] :mag: Compiling from tflite to dfg
Done in 0.13302933s
[2/6] :mag: Compiling from dfg to ldfg
:black_small_square::black_small_square::black_small_square::black_small_square::black_small_square: [1/3] Splitting graph(LAS)…Done in 45.51663s
:black_small_square::black_small_square::black_small_square::black_small_square::black_small_square: [2/3] Lowering graph(LAS)…Done in 19.62021s
:black_small_square::black_small_square::black_small_square::black_small_square::black_small_square: [3/3] Optimizing graph…Done in 1.7741942s
Done in 67.16383s
[3/6] :mag: Compiling from ldfg to cdfg
Done in 0.001475751s
[4/6] :mag: Compiling from cdfg to gir
Done in 0.012820173s
[5/6] :mag: Compiling from gir to lir
Done in 0.004127534s
[6/6] :mag: Compiling from lir to enf
Done in 0.0331447s
:sparkles: Finished in 67.34916s
2023-10-05T06:38:28.333163Z INFO furiosa_rt_core::driver::event_driven::coord: [Sess-148e3f60] the model compile is successful (took 67 secs)
2023-10-05T06:38:28.417020Z INFO furiosa_rt_core::driver::event_driven::coord: [Runtime-0] created 1 NPU threads on npu:0:0-1 (DRAM: 228.0 kiB/16.0 GiB, SRAM: 5.7 MiB/128.0 MiB)
Model has been compiled successfully
Model input and output:
./image_classify.py:32: FutureWarning: Session.print_summary is deprecated, use Session.model.print_summary instead.
print(sess.print_summary())
Inputs:
{0: TensorDesc(name=“input”, shape=(1, 224, 224, 3), dtype=UINT8, format=NHWC, size=150528, len=150528)}
Outputs:
{0: TensorDesc(name=“MobilenetV1/Logits/Conv2d_1c_1x1/BiasAdd”, shape=(1, 1, 1, 1001), dtype=UINT8, format=NHWC, size=1001, len=1001)}
None
./image_classify.py:34: FutureWarning: Session.input is deprecated, use Session.model.input instead.
_, height, width, channel = sess.input(0).shape
Prediction elapsed 0.01 secs
[Top 5 scores:]
sports car: 155
pickup: 152
car wheel: 148
convertible: 148
racer: 143
2023-10-05T06:38:28.461348Z INFO furiosa_rt_core::driver::event_driven::coord: [Sess-148e3f60] terminated
2023-10-05T06:38:28.465750Z INFO furiosa_rt_core::npu::raw: NPU (npu:0:0-1) has been closed
2023-10-05T06:38:28.468136Z INFO furiosa_rt_core::driver::event_driven::coord: [Runtime-0] stopped

1 Like

로그를 보면 잘 동작하는 것으로 보입니다.
재부팅하시고 첫 예제를 다시 실행해보시겠어요?

1 Like

아… 재부팅 생각을 못했네요
재부팅하고 다시 시도해보겠습니다.
감사합니다.

1 Like