Repository navigation
feat(gap9): untiled baseline, and fix two defects in PR #21's approach - #75
Merged
Merged
Conversation
Adds DEEPLOY_L1_AS_L2, the compile-time switch that turns a tiled deployment into the untiled baseline the tiling ablation needs. On what "untiled" means here: PULP cluster cores cannot dereference HyperRAM addresses, so an untiled L3 deployment is not "no movement". It is a single tile whose L1-annotated buffers are physically allocated in FC L2, with the cluster computing over the L2 fabric. The switch therefore redirects pi_l1_malloc to pi_l2_malloc and replaces the mchan pushes with memcpy. PR #21 had the right idea and I was wrong to call its memcpy substitution lazy: the mchan hardware routes `loc` into L1 banks unconditionally, so with L1-as-L2 there is genuinely no DMA left to program. Two things were missing from it: - only mchan_transfer_push_1d was substituted, so any tile taking the 2-D path hung. push_2d is substituted too. - the define was set with target_compile_definitions(${ProjectId} PRIVATE), but ProjectId compiles only CycleCounter.c and deeploytraintest.c. Every L1 allocation and every mchan call lives in the GENERATED network code, which is a separate target (${NETWORK_LIB} / optimizer_network). The define never reached the code it was meant to switch, and the two arms produced the same binary -- DS-CNN measured 3,044,109 untiled against 3,044,050 tiled, a 59-cycle "difference". It is now a directory-scope add_compile_definitions in DeeployTest/CMakeLists.txt. deeploylib is an INTERFACE target, so it takes INTERFACE rather than PUBLIC. Measured once the define actually applied (GAP9, 8 cores, gvsoc, every run Errors: 0 out of 4): network tiled untiled slowdown Autoencoder 2,504,870 62,385,885 24.9x DS-CNN 3,044,050 45,917,437 15.1x CCT-2 256,721,885 2,093,477,099 8.2x MobileNetV1 177,150,391 2,171,487,469 12.3x ResNet-8 184,286,767 1,070,880,302 5.8x The optimizer step is 23-31x slower across all five, a near constant: SGD is elementwise and memory-bound, so that column reads out the TCDM-vs-L2 access cost with nothing to hide it. The training column varies with arithmetic intensity instead -- ResNet-8 lowest because convolutions over large feature maps reuse each fetched byte many times, the autoencoder highest because it is a pure MLP. (The Autoencoder and DS-CNN rows above predate PR #70's MLperf-compliant fixtures and are being re-measured.) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vb2GVs3qbiyLV1KkV2baN
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vb2GVs3qbiyLV1KkV2baN
runwangdl
added a commit
that referenced
this pull request
Sep 14, 2026
AllocateTemplate.py: take devel's version, which already carries this branch's NULL check on the L1 arena allocation (#75). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013w8xXNTjEDT261WWj3QnJC
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.
Adds
DEEPLOY_L1_AS_L2, the compile-time switch that turns a tiled deployment into the untiled baseline the tiling ablation needs.What "untiled" means here
PULP cluster cores cannot dereference HyperRAM addresses, so an untiled L3 deployment is not "no movement". It is a single tile whose L1-annotated buffers are physically allocated in FC L2, with the cluster computing over the L2 fabric. The switch redirects
pi_l1_malloctopi_l2_mallocand replaces the mchan pushes withmemcpy.On PR #21
Its memcpy substitution is correct and I was wrong to call it lazy: the mchan hardware routes
locinto L1 banks unconditionally, so with L1-as-L2 there is genuinely no DMA left to program. Two things were missing:mchan_transfer_push_1dwas substituted, so any tile taking the 2-D path hung.push_2dis substituted too.target_compile_definitions(${ProjectId} PRIVATE ...), butProjectIdcompiles onlyCycleCounter.canddeeploytraintest.c. Every L1 allocation and every mchan call lives in the generated network code, which is a separate target (${NETWORK_LIB}/optimizer_network). Both arms therefore produced the same binary — DS-CNN measured 3,044,109 cycles untiled against 3,044,050 tiled, a 59-cycle "difference". It is now a directory-scopeadd_compile_definitionsinDeeployTest/CMakeLists.txt;deeploylibis an INTERFACE target so it takesINTERFACE, notPUBLIC.Measured once the define actually applied
GAP9, 8 cores, gvsoc,
--l2 1024000, every runErrors: 0 out of 4:Two things worth reading off this:
The Autoencoder and DS-CNN rows predate PR #70's MLperf-compliant fixtures and are being re-measured; the three convolutional/transformer rows are unaffected (those fixtures are byte-identical).
🤖 Generated with Claude Code
https://claude.ai/code/session_012vb2GVs3qbiyLV1KkV2baN