feat(glm-5.3-flash): add day-0 serving support - #1259
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af1b7fef74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
628253a to
af1b7fe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 628253a894
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@Max191 ^ |
|
@FlamingoPg I rebased this branch to resolve the conflicts. One of the conflicts was with my changes, and the other is on nvidia side. I pushed up the rebase to a separate branch in case you wanted to take a look first: https://github.com/lightseekorg/tokenspeed/tree/Max191/glm-5.3-flash-rebase I can force push to the shared/glm-5.3-flash branch if it looks good to you. The conflict was pretty simple, but I uploaded the conflict report my agent gave me in case you wanted to take a look at the Deep GEMM changes: https://gist.github.com/Max191/9b84d95713450faf85537dc96dff566c |
|
Hi @Max191 It’s okay to just force-push; LGTM. |
e322269 to
59ef15a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59ef15a8c6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
b9505e2 to
0c44a48
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5f63be06d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adc15ebff2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # target-only topology that plane aliases otherwise-unused KDA | ||
| # slab space; a merged target+draft plan adds it explicitly. | ||
| index_plane_id, | ||
| (pooled_rows, index_head_dim + 4), |
There was a problem hiding this comment.
Allocate scale bytes for every KPool FP8 group
When a GLM configuration uses a supported index_head_dim above 128, such as 256, dsa_index_k_row_bytes and index_k_block_views require one four-byte scale per 128-value group, but this field reserves only four scale bytes total. The resulting scale view extends beyond the planned index page or aliases other packed storage, causing KPool initialization failures or corrupted index reads/writes; size the field using the full group count.
AGENTS.md reference: AGENTS.md:L23-L35
Useful? React with 👍 / 👎.
adc15eb to
7a52782
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a52782bf1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| kpool = require_positive_int("index_kpool", text_config.index_kpool) | ||
| index_head_dim = require_positive_int("index_head_dim", text_config.index_head_dim) | ||
| pooled_rows = GLM53_FLASH_LOGICAL_BLOCK_TOKENS // kpool |
There was a problem hiding this comment.
Require KPool size to divide the logical block
Reject configurations where index_kpool does not evenly divide 64 before deriving pooled_rows. For example, index_kpool=3 assigns 21 compressed rows to a 64-token cache block, so the pool containing tokens 63–65 is written into the next block; after a 64-token prefix-cache hit, token 63 is neither part of that block nor restored in the request-local tail, causing continuation indexing to use incomplete history. This must preserve the documented separation between logical block boundaries and physical row geometry.
AGENTS.md reference: AGENTS.md:L25-L35
Useful? React with 👍 / 👎.
|
Hi @FlamingoPg @Max191 please fix the conflicts and ci failures, thanks |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
49283be to
76b6295
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76b6295962
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raise ValueError(f"layer {layer_id} has no DSA index cache") from exc | ||
| if buffer is None: | ||
| raise ValueError(f"layer {layer_id} has no DSA index cache") | ||
| return buffer |
There was a problem hiding this comment.
Fence the KPool index before first access
When Host L2 loading restores a GLM-5.3-Flash request, this accessor exposes _index_k without first calling layerwise_load_tracker.wait_for_layer(layer_id), unlike the existing DSA and hybrid-state accessors. KPool reads or writes this side cache before the later MLA-buffer access can establish the fence, so it can race the asynchronous H2D restore and produce stale or corrupted sparse selections; wait on the tracker here before returning the buffer.
AGENTS.md reference: AGENTS.md:L25-L35
Useful? React with 👍 / 👎.
Squash the GLM-5.3-Flash runtime, kernels, tests, and CI integration from the shared development branch. Co-authored-by: Max Dawkins <max.dawkins@gmail.com> Co-authored-by: Stanley Winata <stanley.winata@amd.com> Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
Signed-off-by: FlamingoPg <1106310035@qq.com>
76b6295 to
de9f442
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de9f442bf8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pool_size=self.pool_size, | ||
| page_size=index_cache.shape[1], | ||
| kv_page_size=ctx.token_to_kv_pool.arena.kv_page_size, | ||
| topk_pools=self.index_topk // self.pool_size, |
There was a problem hiding this comment.
Validate KPool top-k divisibility
When a checkpoint sets index_topk to a positive value that is not divisible by index_kpool (for example, 2049 and 4), this truncates the requested count to 512 pools, while Glm53FlashAttention allocates its decode output with index_topk + index_kpool - 1 columns. The expansion kernel instead requires 512 * 4 + 3 = 2051 columns, not the allocated 2052, so the first decode raises an out must be int32 ... error. Reject non-divisible configurations or derive the workspace width from the same pool count.
Useful? React with 👍 / 👎.
Summary
Test Plan
git diff --check origin/main...shared/glm-5.3-flashts serveon 4x NVIDIA B200 with TP4/EP4 and FlashInfer 0.6.18rc4disable_l2_cache=False)