2b34125760
rkt_operands.{c,h}: faithful ports of Mesa's operand layout — rkt_pack_weights
(rkt_coefs.c tiling+sign), rkt_compute_biases (zero-point correction),
rkt_pack_input (feature tiling from rkt_ml_subgraph_invoke), rkt_unpack_output
(de-tile from read_outputs). hwtest.c v2 lays out a real 4x8x16 INT8 matmul,
submits our golden regcmd with real BO addresses, and checks vs a CPU ref.
State: SUBMIT accepted; job still does NOT complete. Root cause located in the
kernel driver (rocket_job.c): completion is a DPU interrupt (INTERRUPT_MASK
DPU_0|DPU_1) and JOB_TIMEOUT_MS=500 — our job runs but the DPU never raises
done within 500ms, so drm_sched resets the core and prep_bo returns -EBUSY.
Interface/regcmd/operands all match Mesa; the stall is at hardware execution.
Next: known-good Mesa/Teflon reference run on this NPU to disambiguate operand
tiling vs early-driver/DTB corner, or NPU status-register readback post-timeout.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1.2 KiB
C
31 lines
1.2 KiB
C
/* SPDX-License-Identifier: MIT
|
|
*
|
|
* rkt_operands.h — NPU operand layout ports (see rkt_operands.c).
|
|
* Non-depthwise. Row-major host tensors:
|
|
* weights_in [oc_real][ww][wh][ic_real], input_in [iw][ih][ic_real],
|
|
* output_out [oh][ow][oc_real].
|
|
*/
|
|
#ifndef RKT_OPERANDS_H
|
|
#define RKT_OPERANDS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
unsigned rkt_raw_input_size(unsigned iw, unsigned ih, unsigned ic_real);
|
|
unsigned rkt_raw_output_size(unsigned ow, unsigned oh, unsigned oc_real);
|
|
unsigned rkt_packed_weights_size(unsigned ww, unsigned wh, unsigned ic_real,
|
|
unsigned oc_real);
|
|
|
|
unsigned rkt_pack_weights(const uint8_t *weights_in, unsigned ww, unsigned wh,
|
|
unsigned ic_real, unsigned oc_real, uint8_t wzp,
|
|
uint8_t *out);
|
|
void rkt_compute_biases(const uint8_t *weights_in, const int32_t *biases_in,
|
|
unsigned ww, unsigned wh, unsigned ic_real,
|
|
unsigned oc_real, uint8_t wzp, uint8_t izp,
|
|
int32_t *biases_out);
|
|
unsigned rkt_pack_input(const uint8_t *input_in, unsigned iw, unsigned ih,
|
|
unsigned ic_real, uint8_t izp, uint8_t *out);
|
|
void rkt_unpack_output(const uint8_t *raw, unsigned ow, unsigned oh,
|
|
unsigned oc_real, uint8_t *out);
|
|
|
|
#endif /* RKT_OPERANDS_H */
|