Repository navigation
Fix word alignment of generated testbench weights - #41
Closed
BerkmKuzu1 wants to merge 1 commit into
Closed
BerkmKuzu1 wants to merge 1 commit into
BerkmKuzu1 wants to merge 1 commit into
Conversation
Guarantee at least four-byte alignment for PI_L1 vectors in the standalone testbench stub. Add declaration and runtime address regression checks using the pinned HeaderWriter. Closes pulp-platform#16
Member
|
I do not see any need for this change or for new tests on this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated weights use
PI_L1, but the standalone testbench'spmsis.honly assigns a section and does not guarantee word alignment. Addaligned(4)toPI_L1so the generated weights satisfy the aligned-access requirement in #16.The generated C already uses
PI_L1; its alignment is defined by this local stub, so the fix can stay within NEureka without modifying the generator submodule. This also gives the other generated L1 vectors a minimum four-byte alignment, including in 1x1 mode. Tensor contents, layout and the pinnedpulp-nnxrevision are unchanged;PI_L2is unchanged.Add a small regression using the actual
HeaderWriter: an odd-sized weight vector following a one-byte object must have a declared alignment of at least four bytes and a word-aligned address when compiled and run.Validation:
git submodule update --initpython -B -m unittest discover -s model -p test_weight_alignment.py -v: both tests fail before the fix and pass afterward with native GCC 6.3. The tests need a native compiler selected byCCorgccon PATH, and skip if none is found.weight.cfiles, the minimum-alignment assertion fails with the original stub and passes with this change; native address checks also pass.RISC-V software linking and RTL simulation were not run. The existing GitLab-backed simulation workflow skips fork PRs, so a green GitHub workflow alone would not establish simulation coverage.
Closes #16.