bfp: the rdet arm (deterministic rounding) does not learn on HAR — below-chance accuracy after 1 epoch

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

Start with the HAR BFP trainer entry point, train_c_har_classifier_bfp, and compare the deterministic rounding arm with the rsr arm on the same seed. Run the three diagnostics in the issue: enable LOG_CODE_MOVEMENT for two epochs, try FLOAT32 wires with deterministic rounding, and compare rsr. Done means identifying the cause and fixing it or documenting the expected behavior, including README and run_matrix updates if it is expected.

Written by the indexing model from the issue text.

Description

bug

Found during the #410 PR7 (#444) campaign smoke run. The PR recorded it but did not resolve it.

Observation

With BFP_ROUNDING=det (anchor config otherwise: BFP_WEIGHT_BLOCK=32 BFP_WIRE_BLOCK=16 BFP_MANTISSA_BITS=6 BFP_EXPONENT_BITS=8), the HAR BFP trainer (train_c_har_classifier_bfp) does not learn after 1 epoch:

  • train_loss 1.789 ≈ ln 6 (uniform over 6 classes)
  • test_acc 0.014: below the test set's 14 % minimum class frequency, and below the same seed's untrained initial_val_acc ≈ 0.128

Hypothesis (unverified)

The #279 dead zone at m=6: deterministic HALF_AWAY write-back rounds every small update to zero. That would explain a model that doesn't learn, but not the below-chance accuracy. Below-chance accuracy points to something actively wrong, such as a sign, a scale, or an argmax over a degenerate output.

Diagnostics to run first

  • LOG_CODE_MOVEMENT=1 EPOCHS=2 BFP_ROUNDING=det …: do any parameter codes move at all?
  • BFP_ROUNDING=det BFP_WIRE_BLOCK=float EPOCHS=1: does it still fail with FLOAT32 wires (BFP params only)?
  • Compare with the rsr arm on the same seed.

Done when

The cause is identified and either fixed or documented as an expected property of det rounding at small mantissa widths. If it's the latter, the README states it and the rdet configs are flagged in run_matrix. Until then, treat the det-arm numbers as unreliable.

Parent: #410

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.