|
SDK สำหรับ TESAIoT Dev Kit
คู่มืออ้างอิง API และ Tutorial (MTB & µPython)
|
Functions | |
| uint32_t | ai_engine_feeds (void) |
| จำนวนตัวอย่างที่โมเดลรับเข้าไป; ให้อ่านเป็นผลต่างในช่วงอย่างน้อย 1 s | |
| uint32_t | ai_engine_dq_ok (void) |
| จำนวนการดึงคิวที่สำเร็จ; ค้างนิ่งขณะที่ dq_calls ไต่ขึ้น = NPU หยุดนิ่ง | |
| uint32_t | ai_engine_dq_calls (void) |
| จำนวนครั้งที่พยายามดึงคิว; ให้จับคู่กับ ai_engine_dq_ok() เพื่อตรวจการหยุดนิ่ง | |
| uint32_t | ai_engine_inits (void) |
| จำนวนการเริ่มต้นโมเดลที่สำเร็จ; เป็น nibble ที่อัดไว้ในเวิร์ดของสัญญาณชีพ | |
| uint32_t | ai_engine_init_calls (void) |
| จำนวนครั้งที่เข้าไปเรียก init() ของโมเดล; ให้อ่านคู่กับ ai_engine_init_returns() | |
| uint32_t | ai_engine_init_returns (void) |
| จำนวนครั้งที่ init() ของโมเดล RETURNED ออกมา; ให้อ่านเป็นคู่เสมอ | |
| int32_t | ai_engine_last_init_rc (void) |
| รหัสที่คืนจาก init() ของโมเดลครั้งล่าสุด: 0x7FFFFFFF = ไม่เคยถูกเรียก; 0 = ปกติ | |
| uint32_t | ai_engine_stale_drops (void) |
| ผลตัดสินที่ถูกทิ้งเพราะเลยขอบเวลารอของ Ethos-U; ต้องนิ่งอยู่กับที่ขณะที่ npu_cycles เดินหน้า | |
| uint64_t | ai_engine_npu_cycles (void) |
| จำนวน cycle ของ NPU ที่สะสมมาถึงตอนนี้; ไม่ใช่หลักฐานว่ามีการอนุมานใดเสร็จสิ้น | |
การอ่านตัวนับธรรมดา 9 ตัว ทุกตัวสะสมค่าตลอดรอบการบูตเว้นแต่จะระบุไว้เป็นอย่างอื่น; ผลต่างในช่วงเวลาหนึ่งคือสัญญาณที่ต้องดู ไม่ใช่ยอดรวม ทุกตัวไม่มีความหมายตราบใดที่ ai_engine_stack_words() ยังเป็น 0 เมื่ออยู่บนคอร์เดียวกัน ตัวนับเหล่านี้ป้อนบรรทัดสถิติที่ออกวินาทีละครั้งของหน้านี้ (page_edge_ai.c:1455-1479: push/s feed/s flush/s … init N/M rc R stale S); เมื่ออยู่นอกคอร์ ตัวนับเหล่านี้เดินทางไปกับเวิร์ดของสัญญาณชีพ (nibble ที่อัดไว้, deepcraft_task.c:913-919, ตารางตัดสินใจ :886-912) และไปกับการดึงค่า Q_DIAG ที่กลายเป็น edge_ai.diag() เงื่อนไขผ่านของ engine ที่แข็งแรงตามที่ระบุไว้ (modedgeai.c:432-437): ai_engine_npu_cycles() ต้องเดินหน้า ขณะที่ ai_engine_stale_drops() นิ่งอยู่กับที่ — ml_state เพียงอย่างเดียวเชื่อถือไม่ได้ มีเพียงฟิลด์ "feed" ใน diag เท่านั้นที่รายงานปริมาณที่โมเดลรับเข้าไป
| uint32_t ai_engine_feeds | ( | void | ) |
จำนวนตัวอย่างที่โมเดลรับเข้าไป; ให้อ่านเป็นผลต่างในช่วงอย่างน้อย 1 s
Samples accepted by the model, and successful model initialisations. Shown on the page while no verdict exists yet, so a stall is legible.
| uint32_t ai_engine_dq_ok | ( | void | ) |
จำนวนการดึงคิวที่สำเร็จ; ค้างนิ่งขณะที่ dq_calls ไต่ขึ้น = NPU หยุดนิ่ง
| uint32_t ai_engine_dq_calls | ( | void | ) |
จำนวนครั้งที่พยายามดึงคิว; ให้จับคู่กับ ai_engine_dq_ok() เพื่อตรวจการหยุดนิ่ง
| uint32_t ai_engine_inits | ( | void | ) |
จำนวนการเริ่มต้นโมเดลที่สำเร็จ; เป็น nibble ที่อัดไว้ในเวิร์ดของสัญญาณชีพ
| uint32_t ai_engine_init_calls | ( | void | ) |
จำนวนครั้งที่เข้าไปเรียก init() ของโมเดล; ให้อ่านคู่กับ ai_engine_init_returns()
MODEL_INIT_RECOVERY diagnostics. init_calls == 0 means the inference task never reached the cold-load (task absent, or no select/start landed); init_calls > 0 with last_init_rc != 0 means the model's own init() failed with that code; last_init_rc == 0x7FFFFFFF means init() was never called.
| uint32_t ai_engine_init_returns | ( | void | ) |
จำนวนครั้งที่ init() ของโมเดล RETURNED ออกมา; ให้อ่านเป็นคู่เสมอ
How many model init() calls RETURNED. Less than ai_engine_init_calls() means the inference task went into one and did not come out.
| int32_t ai_engine_last_init_rc | ( | void | ) |
รหัสที่คืนจาก init() ของโมเดลครั้งล่าสุด: 0x7FFFFFFF = ไม่เคยถูกเรียก; 0 = ปกติ
| uint32_t ai_engine_stale_drops | ( | void | ) |
ผลตัดสินที่ถูกทิ้งเพราะเลยขอบเวลารอของ Ethos-U; ต้องนิ่งอยู่กับที่ขณะที่ npu_cycles เดินหน้า
Verdicts discarded because their dequeue ran past the Ethos-U wait bound and so could only be carrying the previous frame's output tensor.
Read it as "how often a verdict was withheld", not as an NPU health meter. The measurement is wall clock, which cannot separate "the NPU did not answer" from "this task did not run": ai_task sits below the GFX task, and a long render frame or an XIP stall on the shared SMIF can push a perfectly good dequeue past the threshold. It also stops counting once a stall wedges the driver, because dequeue then fails outright and never reaches the check.
The signature of a stalling NPU remains ai_engine_dq_ok() frozen while ai_engine_dq_calls() climbs. Cumulative for the boot — deliberately not cleared on a model switch, unlike the pipeline counters.
| uint64_t ai_engine_npu_cycles | ( | void | ) |
จำนวน cycle ของ NPU ที่สะสมมาถึงตอนนี้; ไม่ใช่หลักฐานว่ามีการอนุมานใดเสร็จสิ้น
NPU cycles accumulated so far. A coarse "is the NPU working" reading only — the middleware adds to it on the timeout path as well, so it does NOT prove any particular inference completed. Use ai_engine_stale_drops() for that.