Skip to content

[docs] Document target-specific tmp buffer sizing#943

Draft
HecreReed wants to merge 2 commits into
hw-native-sys:mainfrom
HecreReed:codex/document-tmp-buffer-requirements
Draft

[docs] Document target-specific tmp buffer sizing#943
HecreReed wants to merge 2 commits into
hw-native-sys:mainfrom
HecreReed:codex/document-tmp-buffer-requirements

Conversation

@HecreReed

@HecreReed HecreReed commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • document A2/A3 versus A5 tmp buffer sizing directly in the existing pto.tile_buf section of docs/PTO_IR_manual.md
  • cover fixed sizes, shape formulas, compatibility-only operands, and PTO-ISA interfaces not yet exposed by PTO IR
  • keep A5 TSORT32 as an active tail workspace, matching current PTO-ISA master rather than the older compatibility-only description
  • clarify the current A2/A3 TPRELU runtime valid-row requirement

Source baseline

  • hw-native-sys/PTOAS@a1371bc7
  • cann/pto-isa@7af803bc4056af8b39a55751ac2f4b75cdb47fbd (2026-07-15)

Validation

  • git diff --check
  • confirmed the final PR file list contains only docs/PTO_IR_manual.md
  • verified all requested interface names are covered
  • verified all 35 linked PTO-ISA source files exist in the baseline snapshot
  • checked Markdown table column counts and balanced code fences

Docs-only change; no compiler build was required.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new documentation file docs/pto_isa_tmp_buffer_requirements.md detailing target-specific tmp buffer sizing requirements for A2/A3 and A5 targets. It also updates docs/PTO_IR_manual.md to reference this new document and clarifies the TPRELU runtime check behavior. A review comment identifies a potential discontinuity or typo in the formula for the row-expand family's temporary buffer size.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/pto_isa_tmp_buffer_requirements.md Outdated
Comment on lines +153 to +154
tmpBytes = ceil(R / 8) * 256 when R < 256
tmpBytes = 7680 when R >= 256

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There seems to be a discontinuity in the tmpBytes formula for the row-expand family.

  • For R = 255 (which is < 256), the formula ceil(R / 8) * 256 yields ceil(255 / 8) * 256 = 32 * 256 = 8192 bytes.
  • For R = 256, the formula gives a fixed size of 7680 bytes.

This decrease in buffer size as R increases from 255 to 256 is counter-intuitive. If this is the correct behavior, it might be helpful to add a note explaining this discontinuity. Otherwise, this could be a typo in the formula or the condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant