Skip to content

Close arbitrary rectangular TileKernels on v0.57 - #156

Merged
zhoubot merged 1 commit into
mainfrom
codex/deepseek-arbitrary-tile-dims
Jul 21, 2026
Merged

Close arbitrary rectangular TileKernels on v0.57#156
zhoubot merged 1 commit into
mainfrom
codex/deepseek-arbitrary-tile-dims

Conversation

@zhoubot

@zhoubot zhoubot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Pins the merged runtime-shape implementations in LLVM, QEMU, and PTO-Kernel and adds QEMU AVS coverage for 35x37 multi-tile transpose plus 3x5 MOE, quantization, and MHC tails. pyCircuit and LinxCore are explicitly excluded and remain unpinned.\n\nVerified on the exact merged submodule SHAs: LLVM focused lit 4/4; PTO host CTest 4/4; DeepSeek cross assembly contracts; QEMU TileKernels 5/5; strict TSVC compile floor and all eight QEMU batches without timeout.\n\nKnown baseline outside this closure: umbrella PTO FlashAttention target has an existing CUDA-launch syntax parse failure; broad LLVM LinxISA CodeGen has 12 existing failures and one unresolved test.

The v0.57 closure now pins the merged LLVM, QEMU, and PTO-Kernel implementations and adds standard plus rectangular-tail AVS oracles for transpose, MOE normalization, quantization, and MHC normalization.

Constraint: pyCircuit and LinxCore are intentionally excluded from this closure and their gitlinks are unchanged.

Constraint: v0.57 rectangular validity uses LB0 ValidCol, LB1 ValidRow, and LB2 physical Col.

Confidence: high

Scope-risk: broad

Directive: Do not add pyCircuit or LinxCore to this closure until explicitly requested.

Tested: merged LLVM focused lit 4/4; PTO host CTest 4/4; DeepSeek cross assembly contracts; QEMU TileKernels 5/5; strict TSVC compile floor and eight QEMU batches.

Not-tested: full OS boot; umbrella PTO FlashAttention target retains its pre-existing CUDA-launch parsing failure.
@zhoubot
zhoubot requested review from a team as code owners July 21, 2026 02:31

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

Copy link
Copy Markdown

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 increases the test storage array sizes to kStorageElements (2048) in avs/qemu/tests/17_deepseek_tilekernels.cpp and adds new test cases for tail-processing scenarios across transpose, MoE weight normalization, quantization, and MHC normalization. It also fixes an indexing bug in the quantization test and updates several subproject commits. The review feedback suggests adding compile-time static_assert checks in the new tail-processing test blocks to ensure that the calculated tail elements do not exceed kStorageElements, preventing potential out-of-bounds memory access if dimensions are modified in the future.

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 on lines +77 to +79
constexpr int tail_rows = 35;
constexpr int tail_cols = 37;
constexpr int tail_elements = tail_rows * tail_cols;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To ensure defensive programming and prevent potential out-of-bounds memory access if the tail dimensions are modified in the future, it is highly recommended to add a compile-time static_assert verifying that the total number of tail elements does not exceed the allocated storage size (kStorageElements).

  constexpr int tail_rows = 35;
  constexpr int tail_cols = 37;
  constexpr int tail_elements = tail_rows * tail_cols;
  static_assert(tail_elements <= kStorageElements, "tail_elements exceeds kStorageElements");

Comment on lines +125 to +126
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Add a compile-time static_assert to ensure that the tail elements do not exceed kStorageElements to prevent potential out-of-bounds memory access if the dimensions are modified in the future.

Suggested change
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
static_assert(tail_rows * tail_cols <= kStorageElements, "Tail elements exceed kStorageElements");

Comment on lines +188 to +189
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Add a compile-time static_assert to ensure that the tail elements do not exceed kStorageElements to prevent potential out-of-bounds memory access if the dimensions are modified in the future.

Suggested change
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
static_assert(tail_rows * tail_cols <= kStorageElements, "Tail elements exceed kStorageElements");

Comment on lines +262 to +263
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Add a compile-time static_assert to ensure that the tail elements do not exceed kStorageElements to prevent potential out-of-bounds memory access if the dimensions are modified in the future.

Suggested change
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
constexpr int tail_rows = 3;
constexpr int tail_cols = 5;
static_assert(tail_rows * tail_cols <= kStorageElements, "Tail elements exceed kStorageElements");

@zhoubot
zhoubot merged commit 857785e into main Jul 21, 2026
5 checks passed
@zhoubot
zhoubot deleted the codex/deepseek-arbitrary-tile-dims branch July 21, 2026 02:35
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