Fix PREFETCH_M_AMOUNT assertion when MLEN > 64#59
Closed
booth-algo wants to merge 1 commit into
Closed
Conversation
When MLEN=128 or 256, the TOML default HBM_M_Prefetch_Amount (64) is smaller than MLEN, causing `load_amount % write_amount == 0` to fail in transfer_mx_from_hbm. Each matrix SRAM tile write requires exactly MLEN rows, so PREFETCH_M_AMOUNT must be >= MLEN and a multiple of it. Fix: clamp PREFETCH_M_AMOUNT to the nearest multiple of MLEN at startup, with a warning when adjustment is needed. Fixes the dev console crash at MLEN=128 reported by the GUI backend. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
Collaborator
Author
|
Merged into PR #60 (fix/aten-test-configurable-mlen already includes this commit as its parent). |
booth-algo
added a commit
that referenced
this pull request
Jun 3, 2026
booth-algo
added a commit
that referenced
this pull request
Jun 3, 2026
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.
Summary
Fixes the emulator panic
assertion failed: load_amount % write_amount == 0when running with MLEN=128 or MLEN=256.Root cause:
HBM_M_Prefetch_Amountin plena_settings.toml defaults to 64. When MLEN > 64, the matrix SRAM tile write requires MLEN rows per tile, but only 64 rows are prefetched —64 % 128 != 0triggers the assertion intransfer_mx_from_hbm.Fix: Clamp
PREFETCH_M_AMOUNTto the nearest multiple of MLEN at startup, with a tracing warning when adjustment is needed.Test plan
MLEN=64: no change (64 % 64 == 0, no warning)MLEN=128: clamped to 128 with warning, linear test passesMLEN=256: clamped to 256 with warning, linear test passesMLEN=32: no change (64 % 32 == 0, no warning)Reported via the dev console GUI at MLEN=128.
🤖 Generated with Claude Code