Repository navigation
Merge upstream main - #164
Merged
Merged
Conversation
partRows sized the pass scratch's part for two consumers: an out projection's slice plus the zero slice at cap rows, and a legacy lane tile's out_sk slices below 64 rows. The MTP head's fc_h lane is a third one. It runs over streams * rows rows (four streams by a pass's rows), and the lane writes one fp32 slice of them and zeroes a second, so it needs 2 * streams * rows rows of part. cuda_tiles.matmul zeroes at part + m rows and cuda_batch_ops.sumSlices then reads that slice back, so a head pass over more than cap / 4 rows leaves part: at four streams and a 256-row piece the lane needs 2,048 rows, against 2 * cap below a 1,024-row scratch, and 4 * cap while the piece is half the scratch. A head pass takes at most piece_rows rows (cuda_mtp_ops.zig's forwardHead and headGroup), so any pass over 63 rows can ask for more than part below a 1,024-row scratch. The single-stream path, whose piece is half the scratch, first overruns at 128 rows, a prompt chunk of about 128 tokens, and runs short to 1,023. partRows now takes the maximum over every consumer, the head's term being 2 * streams * min(cap, piece_rows). The term changes nothing from a 1,024-row scratch up, where the out projection's two cap-stride slices already dominate, so a long cache's part keeps its 671,088,640 bytes at 32,768 rows. Below that it costs at most 15,728,640 bytes, at 256 rows. The host test sweeps every cap against each consumer's write range, with the head's lane under both a reachable pass and the widest pass the lane admits.
Follow main 7948cc4, which routes the vision launch helper through cuda_pdl.launch. The new glm_vis_qk entry must open with glm_pdl::enter() before reading its predecessor outputs, like every existing GLM vision entry. Keep the incoming arithmetic and both current serving pins unchanged.
…ernelEx Follows main's 7948cc4 (GLM's CUDA kernels as dependent launches), which sends every GLM launch through cuLaunchKernelEx; the test hands those to its recording cuLaunchKernel with cuda_pdl.forwardEx, as main's GLM tests do.
Reference the new vision_attn module from the GLM CUDA test block so the default GLM host test root discovers its launch-geometry coverage.
Combine the PR glm_vision image entry with main’s expanded image list, including idol_decoder and all four Inkling2 images, so every registered CUDA launch resolves its own image.
…' disk states A retain count above zero chose disk states with the resume predicate, which accepts any state whose tokens are a proper prefix of a retained entry's: a shorter state on the retained conversation's own path survived, while the retained entry's own state was deleted with no lookahead (its position equals its token count) and under planned chunk starts (empty starts never match a recorded schedule). A disk state now stays only when it is a retained entry's own: the same position, tokens and decoded spans. A dropped entry's write already staged on the I/O worker owns no entry, and the flush fenced the writer only when it removed a published state, so such a write could publish afterwards. The flush now fences whenever a staged write is not a retained entry's own. A retain count of zero still takes the full flush unchanged.
…n's full flush Main read the flush route's body and dropped it, whatever its framing, and then flushed every state with a 200 reply. The retention change answered a refused body (one past the 32 MiB limit, an invalid or short length, or a length beside a transfer coding) with a 400 and flushed nothing, and a failed read with a 500. Such a body now means no retention, as on main: the full flush with its usual reply, and the connection still closes after a refused body as before. When a readable body's JSON cannot be parsed for lack of memory, a body that cannot name retain is the full flush too. Only a body that names retain takes the new path; a retain value that is present but not a nonnegative 32-bit integer is still refused with a 400.
…s, not with a panic The dispatcher helper read every reply body as JSON and took its ok field, so a plain 500 (as the parse-failure path answered before its fix) ended the test run with an inactive-union panic. A body that is not JSON now reads as null, and the test reports the status it expected and found.
TF_MINIMAX_GRAPHS=1 (default off) runs a one-stream decode verify window's launches through cuda.graph_cache, keyed by rows, sparse attention and taps. MiniMax's attention takes each round's positions and block counts as launch arguments, so a held graph cannot be replayed as captured: graph_cache gains a refresh mode in which a hit records the body again with this round's arguments and updates the executable in place (a new one when the launches changed), every rank voting each step, so a failed record sends all ranks to eager together. The same kernels with the same arguments in the same order; the ids upload and the draw stay outside the graph.
…robs ahead of an unchanged reply echo: true puts the prompt's decoded ids in front of text and, with logprobs, each prompt token's entry (null for the first) ahead of the reply's, whose entries stay as without echo. max_tokens 0 with echo returns the prompt alone. Engines without prompt_logprobs, streams, messages bodies and non-boolean values are refused by name; prompt_logprobs keeps its own count.
GLM_ROUND_PROF=1 logs verify window GPU time, idle gap, ahead span, host phases, and partial accepts when streams end. Unset, blank, or 0 stays off; invalid values fail startup by name via environment.read. Refs ashhart#3152.
A reply that would end well before a long prompt goes first, as for Qwen3.8-27B. A decode share, a prompt share below 1, the two-Mac pair or a TENSORFOLD_PREFILL_ORDER other than srpt keeps the old order. Refs ashhart#3152.
…eply options, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with ashhart#3719, and the voices holder and parseFrom with ashhart#4609.
… longer than the budget --max-frames below 32 gave the codec its usual 32-frame pass, longer than the budget, and the codec refused the load; budgets above the codec's 8192 frames were admitted too. The load's plan now sizes the codec's pass to the budget and refuses what the codec would; a host test opens the plan at 12, 16, 31 and 32 frames.
Conflicts resolved keeping both sides: upstream's H3 gemm source split (gemm_source after gemm_nax's fragments) with our int8 products and fused norm/quant kernels, upstream's Windows-gated CUDA image steps beside our h3_image_cuda wiring, and both sides' contract records and tests.
…ream-main # Conflicts: # zig/src/core/contract/registry_joins.zig # zig/src/families/inkling2/metal/forward.zig # zig/src/native/cuda_families.zig # zig/src/native/cuda_open.zig # zig/src/server/main.zig # zig/src/server/server.zig # zig/src/server/speech.zig # zig/src/server/speech_voices.zig # zig/tests/fixtures/gradient-serving.tsv
The glm vision records joined from both sides name the glm_vision fatbin; the merged resolver dropped it with inkling2_loop_math, whose image ours replaced with inkling2_loop.
The merge's files combine both sides (cublaslt keeps our int8 and FP4 matmul types); the pins upstream measured on its own copies no longer match, so they pin the merged bytes as the ratchet rules require.
…sm_110 fused labels - benchmark_server_log_test: stretch the pipe-holding descendant's sleep to 8s and the bound to 7s so a loaded full-suite run can't race it - inkling2_experts_records: move inkling2_modelopt's five launches into cuda with upstream's measured usage (its kernel, kept by the merge, has static shared tiles); pending keeps only the fork's unmeasured loop kernels - contract_limits_fatbins: restore upstream's two sm_110 fused-BF16 raised-limit labels
The net change of ashhart#3859 at c07419f over its merge base 6858510, carried as one commit because four of the branch's merge commits hold changes of their own.
Main 881e224 added the prompt-tail slices retained by the rebase. Move the unchanged round fingerprint into its own module so the combined runner remains below 600 lines.
Main moved keysForward to prompt_tail.zig. This PR's copy passed the shifted norm and YaRN rope, so the moved one must too. Both default to the plain path, so other Qwen models are unchanged.
The net change of ashhart#3859 at c07419f over its merge base 6858510, carried as one commit because four of the branch's merge commits hold changes of their own.
… each with its own host field and tap slots Main's 4f8b193/090c9c4a9 line serves Qwen3.8-27B's MTP head under --mtp-drafts (Host.mtp: qwen27_mtp.zig's Mtp, its taps through qwen27_features.zig's prepare and rows in the lane backend's table). This PR's head for SenseNova-Loop came with a Host.mtp of its own type and the same two table slots, plus prefill_features. - qwen27_served: the PR's head is Host.sn_mtp; it loads only when --mtp-drafts is off (so at most one head drafts), sets the backend's sn_features before its wrapper takes the backend's table, and frees as the PR placed it. - qwen27_lanes: Metal.sn_features picks the table. With it, the PR's slots (sensenova_features.zig's prefill_features, prepare_features and features); without it, main's table unchanged, so a Qwen3.8-27B prompt under --mtp-drafts keeps main's prompt pass (Drafted streams prompts through prefill_features whenever one is set). - residency: the PR's three resident-set lines name sn_mtp, the type whose buffers they add. Main's Qwen3.8-27B MTP, DFlash2 and plain paths keep main's code; SenseNova-Loop's keeps the PR's.
…main Main's growth beside this series' SenseNova-Loop lane changes put the file at 605 lines. The tail encoder's choice becomes one if/else line and the argmax tail's body one call; no behaviour changes.
…s solo prompt rows attention.zig, attention_plan.zig, decode_round.zig and qwen27_slots.zig now carry main's solo prompt rows with this stack's SenseNova-Loop changes; their pins are regenerated from the merged files, main's notes kept.
…am-main # Conflicts: # CHANGELOG.md
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.
I merged upstream main into the fork's main branch.
This pull request brings the fork up to date with upstream
ashhart/TensorFoldmain: the native engine families, kernel contract coverage, serving features and fixes that landed there since my main diverged. I resolved the one merge conflict inCHANGELOG.mdby keeping both sides' unreleased entries in place; entries themselves are unchanged.Verification:
zig build test test-goldenpasses on the merged head, andswarm scanover the change range is clean.