continual_learning: PPCA state accepts BFP, but ppcaReplaySample/ppcaReplayMean reject a BFP output tensor

Open
#477 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Read src/continual_learning/PpcaReplay.c:110-113 and :152-155, then trace executeConvert and the output sizing in src/userApi/continual_learning/ReplayDataLoader.c:62-67. Check both REPLAY_MODE_PPCA_SAMPLE and REPLAY_MODE_CLASS_MEAN with a BFP dataset output. Done when the supported behavior is covered by tests, or the restriction is documented in docs/CONTINUAL_LEARNING.md and the header comments.

Written by the indexing model from the issue text.

Description

enhancement

Problem

The PPCA state storage whitelist and the replay output whitelist disagree:

  • ppcaReplayCreate accepts per-tensor BFP for meanQ/basisQ/eigvalsQ (src/userApi/continual_learning/PpcaReplayApi.c:17-23, BFP epic PR3).
  • ppcaReplaySample and ppcaReplayMean still require their out tensor to be FLOAT32/SYM/ASYM (src/continual_learning/PpcaReplay.c:110-113 and :152-155). A BFP out hits PRINT_ERROR + exit(1).

Reachability (narrower than it first looks)

The replay wrapper sizes its item pool from the base dataset's first sample, using getQLike(first->item->quantization) (src/userApi/continual_learning/ReplayDataLoader.c:62-67). So the output dtype is the dataset's dtype, not the state's:

  • BFP state with a FLOAT32 dataset works. This is the normal setup and the one the docs describe.
  • The failure needs a dataset that delivers BFP-stored samples, plus REPLAY_MODE_PPCA_SAMPLE or REPLAY_MODE_CLASS_MEAN.

Options

  1. Add BFP to the two output whitelists. The writes already go through executeConvert, which has the FLOAT32→BFP cell. Add tests for both modes with a BFP out.
  2. Or document the restriction in docs/CONTINUAL_LEARNING.md and the header comments, and keep the fail-fast.

Found by the Codex adversarial review on PR #474 and verified against the code.

Dominant language
C
Stars
2
Forks
3
Avg merge
13h 6m
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from es-ude/OnDeviceTraining

All issues in es-ude/OnDeviceTraining

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.