Per-tensor ASYM -> SYM_INT32 staging declares qBits+1, wasting one bit in downstream declared widths
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 40/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Read the per-tensor ASYM to SYM_INT32 staging route in src/tensor/TensorConversion.c around lines 761–764, then trace symInt32QConfig_t, the guard site, and symAccumResultBits. Compare the staged range with the grouped-weight design referenced in #520. Done means the int12 × ASYM-8, N = 8 case declares 23 bits, with a regression test pinning that result.
Written by the indexing model from the issue text.
Description
Summary
The per-tensor ASYM -> SYM_INT32 staging route (src/tensor/TensorConversion.c ~:761-764) declares the staged mantissas (code - zp) with qMaxBits = qBits + 1. The SYM kernels read a width w as the two's-complement range [-2^(w-1), 2^(w-1)-1], i.e. [-2^q, 2^q-1]. The true range of code - zp is ±(2^q - 1). The declared output width of a downstream SYM kernel therefore carries one wasted bit. Example: int12 x ASYM-8, N = 8, declares 24 bits where 23 is exact.
This violates the "no wasted bit in declared widths" rule (the memory planner sizes wires from declared widths).
Context
The grouped-weight path gets the exact range through a kernel-owned code-domain tag (symGroupedWeight_t, follow-up to #520). The per-tensor path has no such channel: the information would have to travel on the SYM_INT32 scratch config (symInt32QConfig_t), the most widely used wire struct.
Suggested fix
A code-domain tag (two's complement vs ASYM image) on the staged SYM_INT32 operand, read by the guard site and the result-width helper (symAccumResultBits), mirroring the grouped design. Pin it with: int12 x ASYM-8, N = 8 -> declared 23.
Found during the #520 follow-ups (Fable review).
- Dominant language
- C
- Stars
- 2
- Forks
- 3
- Avg merge
- 13h 6m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from es-ude/OnDeviceTraining
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
es-ude/OnDeviceTraining#549 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
es-ude/OnDeviceTraining#547 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
es-ude/OnDeviceTraining#536 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
es-ude/OnDeviceTraining#478 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
Maintainers usually reply within 1 day
All issues in es-ude/OnDeviceTraining
Similar issues
-
issue: bug report
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
BasedHardware/omi#26486 ·
Maintainers usually reply within 1 day
-
The LLVM object can build before collection_config.h is generatedPossibly taken @Vonng claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
aws/pgcollection#51 ·
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yugabyte/yugabyte-db#39462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libreswan/libreswan#3185 · 1 comment ·
Maintainers usually reply within 1 day