Repository navigation
Description
Title: Agree the gate for Drama 3 model-maximum native speech context on Metal and CUDA
Requested outcome
Support Drama 3's actual model-maximum native speech window where the existing backend architecture and available resources permit it. Report admitted limits accurately and refuse unsupported requests before execution. A smaller context profile, a raised flag, successful allocation, or successful startup is not evidence of full-window execution.
Public baseline and coordination
The release baseline is TensorFold v1.2.1. Investigation uses upstream main at 6194b8c in ashhart/TensorFold. The published fishaudio/drama-3 configuration declares text_config.max_position_embeddings = 262144. Both native adapters and drama_budget.zig currently admit context only from 1025 through 8192.
The existing issue #914 is closed. The full ATC board currently reports incomplete file coverage; ownership has not been established and no implementation or claim has started. This issue proposes a new context-specific gate. A complete focused ownership check and a successful permitted claim are required before implementation. Preparation will use --local reporting without --github-name.
Checkpoint scope
Metal: plotarmordev/drama-3-NVFP4-Pruned at revision 494db08481db952f834b2241bce63fb3dfa72554 is the pinned public candidate. Its stored weights and precision must be preserved. A declared context in its config does not qualify native execution at that context.
CUDA: fishaudio/drama-3 at revision 78e5ab79e49aa9a25abe8799eff2c4d73a1c3216 is a separate public candidate. Bounded reads of all 15 safetensors JSON headers match all 62245 native loader tensor names, dtypes and shapes: 805 BF16, 30720 F8_E4M3 and 30720 F32 inverse scales, with no missing, mismatched or unused tensors. This establishes header compatibility only. Codec bytes, device loading, runtime arithmetic and model execution remain untested. CUDA qualification is independent. The Metal pruned NVFP4 layout and Metal-only semantic CFG are not assumed to work on CUDA. Unsupported layouts or options must continue to refuse explicitly.
Units and existing failure
Keep these quantities separate in admission, discovery, documentation, fixtures, and receipts:
- Input UTF-8 bytes and Unicode code points.
- Tokenized request text and structural/wrapper tokens.
- Reference transcript tokens and acoustic reference frames.
- The assembled prompt rows consumed by the backbone, including reference code rows.
- Generated acoustic frames, each containing the semantic and residual codebooks.
- The combined native positional window and its reserved row.
Current public code has independent limits: speech.zig accepts at most 4096 input code points; the shared reference-capable prompt builder accepts at most 16384 request-text bytes; drama_budget.zig additionally caps assembled prompt rows at 4096; the serve CLI and budget cap explicit generated frames at 8190. Reference catalogs separately accept at most four passages, transcripts of at most 4096 bytes each, and at most 646 code frames per passage, plus file/catalog bounds. Those reference safety limits must be assessed separately from the backbone window rather than silently relabeled as text-context limits.
model.validate currently requires at least two assembled prompt rows and enforces P + F + 1 <= C, where P is assembled prompt rows, F is the generated-frame budget, and C is the configured context. At C = 262144, default F = 1024 leaves P <= 261119. A synthetic two-row prompt permits F <= 262141 under this conservative contract. Real rendered HTTP prompts have their own overhead and must be counted exactly.
There is also an existing explicit-admission discrepancy: budget(8192, 8190) accepts the option but returns 8189 frames because its default clamp applies to explicit values too. An explicit request should be honored exactly when valid or refused clearly. Raising context alone leaves the HTTP and assembled-prompt restrictions in place.
Existing ownership and intended change
The intended contribution extends the current native adapters, shared budget/validation mechanisms, family allocation owners, shared frame rounds, per-lane model/codec state, and existing HTTP lowering/discovery. It does not introduce a scheduler or downstream integration. The intended change preserves stored weights, activation/cache precision, reduction order, and GPU kernel arithmetic. If investigation establishes that a kernel, attention architecture, reduction, or state-layout change is necessary, stop treating this as an admission-only change and agree the additional contract before proceeding.
Proposed review stages:
- Establish and reproduce the existing refusals with public or synthetic fixtures. Verify each checkpoint's actual model geometry and backend layout support. Trace every context-derived allocation, integer conversion, launch bound, and prompt/frame position before selecting the implementation.
- Extend the existing owners to model-maximum capacity with checked arithmetic and truthful resource admission. Remove arbitrary prompt/window restrictions only where the complete execution path supports the resulting range. Preserve defaults where appropriate; explicit budgets must not silently shrink. Determine the HTTP byte/code-point policy separately and allow genuinely long native/HTTP requests where supported.
- Report the loaded speech window, assembled prompt-row budget, generated-frame budget, sample geometry, and HTTP input policy distinctly through existing discovery paths. /v1/models currently reports the combined context but omits speech-specific budgets. Static capabilities --json reports compiled family formats and flags; it is not a checkpoint qualification receipt.
- Run the agreed host, device, kernel, fidelity, lifecycle, and performance gates. Publish support claims only to the extent established by those results. Keep any unqualified candidate explicitly draft until its required gates pass.
Memory, arithmetic, and lifetime contract
All products, sums, alignment, element-to-byte conversions, signed/unsigned casts, and device/API extent limits must be checked before allocation or launch. Account separately for weights, per-lane backbone KV/recurrent/scratch state, codec state and workspace, output frames, caller-owned PCM, pinned/device transfers, reference snapshots/cache entries, optional Metal guidance state, and whole-reply redraw buffers. Include partial-open failure cleanup and allocation-limit restoration.
For scale, F = 262141 with frame_length = 2048 requires 536864768 f32 PCM samples, or 2147459072 bytes per active HTTP request before any model state. A whole-reply redraw can require a second buffer of that size. This is arithmetic, not a measured fit or successful synthesis. A GPU budget alone does not admit those host allocations. Do not rely on an allocation eventually failing as the only capacity policy.
Retain existing device ordering and ownership until completion is proved. Cancellation must settle all relevant model/codec work before reusing or releasing caller storage, caches, lanes, or shared weights. Failed waits must close admission and retain unsafe storage as the current completion mechanism requires. Reopening after shutdown, failed/partial startup, cancellation, and ordinary completion must restore valid state and resource limits. Reference reuse must preserve cache identity, tower lookahead, chunk cuts, and uncached equivalence; a restart must not depend on in-memory reference state.
Gate decisions requested from maintainers
Please agree the exact checkpoint/backend matrix, full-window workloads, comparison method, performance metrics, and acceptance thresholds before implementation is represented as ready. No speed or error threshold is proposed by assumption.
- Full-window execution: specify exact public token/frame-row fixtures for text-heavy, reference-conditioned, and acoustic-generation-heavy windows. Cover 8k baseline, 32k, 64k, 128k, and 262144 where admitted. Include actual prompt/decode work near the last permitted position, with final KV/recurrent state and logits or frame/code output checks. Agree how teacher-forced late-position checks supplement, but do not replace, complete native speech execution. Do not count startup, reservation, early EOS, or a shorter run as a full-window pass.
- Boundaries: test exact accepted maxima and one-row/frame excess for P + F + 1; invalid minimums and zero frames; context 8192/8193 and 262144/262145; exact rendered HTTP prompt limits with and without references; byte/code-point/token distinctions; malformed frame/codebook geometry; and explicit resource refusal without silent clamping or corrupting the next request.
- Overflow and resources: use synthetic boundary and failure-injection fixtures for every context-derived allocation/launch extent, checked arithmetic, lane count, optional state multiplier, partial startup, and cleanup. On actual devices record allocation limits, peak physical footprint, device/pinned allocations, RAM class, load/cleanup boundaries, and refusal on insufficient resources. A configured budget on a larger host does not prove fit on a smaller one.
- Lifecycle and concurrency: compare fixed-setting solo and admitted concurrent requests, fresh and reused lanes, cancellation during prompt and generation, the next request after cancellation/refusal/failure, shutdown/reopen, and fresh processes after restart. Exercise reference cache off, miss, hit, invalidation, and changed reference/lookahead cases. Use existing frame rounds and owners throughout.
- Deterministic replay: pin seed, sampler, checkpoint/tokenizer/codec revision, backend/runtime, precision, prompt chunk geometry, and output budget. Disable timing-dependent redraws for the deterministic cells. Retain complete frame/code arrays or hashes and state/logit checks, not plausible text or listening alone. Equality is within the same backend and checkpoint; matching seeds do not promise cross-backend audio equality.
- Independent fidelity: agree a public independent reference and teacher-forced histories for early and late positions on each claimed backend/checkpoint. Record top-token differences and margins, per-column and aggregate error, semantic/residual frame outputs, and codec comparisons as applicable. If arithmetic changes become necessary, require the contributor skill's independent FP64 comparisons for affected operators and the complete backend kernel-contract SUMMARY, including planted controls and launch-limit records. Do not widen tolerances to manufacture a pass.
- Performance: agree the baseline/candidate native speech workload and minimum acceptable result for decode/frame rate, cold prefill and time to first audio, whole-response latency, aggregate concurrency, and peak physical/device/pinned memory. Match checkpoint, runtime, exact public prompt IDs, frame budget, seed, settings, warmups/repetitions, cache state, and hardware. Compare v1.2.1 and the candidate at shared admitted windows; report newly admitted longer windows separately because the release refuses them. Alternate before/after runs when changes are small. Identify an applicable independent server comparison without substituting different weights or precision.
- Host/build checks: use the repository-pinned Zig version; run applicable Drama host/owner/prefill tests and compile checks, the required no-GPU suite and plain build, golden checks, diff checks, and lean comparison with zero new findings. Host or fake-engine passes do not qualify real-model execution.
Available evidence and remaining physical gates
No test accelerator, checkpoint installation, remote machine, or running service is supplied by this proposal. Only explicitly authorized resources may be inventoried or used. No machine identity or access is inferred from repository examples or historical receipts. Physical Metal and CUDA model execution, full-window/late-position checks, device kernel gates, memory-fit measurements, concurrency/restart replay, independent checkpoint fidelity, and before/after performance are unrun. There is no full-window support or readiness claim.
Publication boundary
This proposal and future fixtures/receipts use only public model sources and synthetic/public text or non-identifying voice fixtures. Review the complete outgoing tree, generated assets, archives/debug metadata if shipped, Git configuration effects, and all outgoing commits/messages before upload. Use an approved public Git identity with a GitHub noreply address for required attribution; obtain it before publication if unavailable. No merge, release, or deployment is requested.
Activity
akol1 commentedon Nov 3, 2026
/atc claim
akol1 commentedon Nov 3, 2026
/atc release
ashhart commentedon Nov 4, 2026
Thanks for setting this out so carefully. The gate is agreed, with these specifics:
config.jsonqualifies nothing on its own, as you say.drama-3revision. A raise on one never raises the other.It's unclaimed again since 3 Nov, so whoever opens the first PR, please link it here. Metal at the current limit is the natural first one.
akol1 commentedon Nov 4, 2026
/atc claim
akol1 commentedon Nov 4, 2026
Draft #2143 implements current-limit admission and discovery groundwork. It preserves context 1025..8192, refuses oversized explicit frame budgets rather than clamping, and separates assembled rows, request-text tokens and acoustic reference frames. Shared admission/discovery also affects CUDA; device checks are Metal-only on the pinned NVFP4-Pruned checkpoint. Full-length fidelity, chunk-bit equality and prompt/decode seam qualification remain outstanding. Synthetic boundary runs ended at EOS and are not passes. No clustered Drama inference or cap raise is claimed; this does not close #2002.
akol1 commentedon Nov 4, 2026
Is the generator and pinned source revision for the Drama teacher-forced vectors.safetensors oracle available publicly, including a fixture compatible with the pinned Metal NVFP4-Pruned weights? The native check tool consumes prompt/decode layer tensors and forced frames, but I have not found their writer in this repository. The upstream drama3_ref_test.py is an HTTP synthesis client, not that oracle. I will keep the existing cap and leave full-length fidelity unqualified until the independent reference can be reproduced; native self-comparison will not substitute. Draft #2143 remains limited to admission/discovery groundwork.
akol1 commentedon Nov 5, 2026
@plotarmordev, could you point us to the independent PyTorch generator and pinned source commit for Drama
vectors.safetensors, or a reproducible fixture compatible withplotarmordev/drama-3-NVFP4-Prunedrevision494db08481db952f834b2241bce63fb3dfa72554? We need teacher-forced prompt/decode reference tensors and forced frames at the full 8192-position baseline, plus generation instructions and numerical comparison criteria. We found the native consumer but not the writer; the HTTP synthesis client is not that oracle. If no compatible fixture exists, could you advise which independent implementation and precision/dequantization settings should generate it? This is for the agreed Metal gate on #2002; existing limits remain unchanged, and native self-comparisons are not being counted as independent fidelity.ashhart commentedon Nov 5, 2026
Thanks @akol1, and thanks for refusing to count native self-comparisons: that's the right line. You're right that only the reader is in the repository:
drama3/check.zigopensvectors.safetensors, anddocs/drama3-prefill.mdcalls it an upstream PyTorch oracle, but no generator or source revision is checked in. Your question to @plotarmordev is the right one. If no compatible fixture turns up, an oracle written against the publisher's own released PyTorch code, run on the pruned checkpoint's weights dequantized to float, would meet the gate. Please commit its generator undertools/with the source revision pinned, and add a THIRD_PARTY_NOTICES entry if any of the release's code is copied into it. The limit stays 1,025 to 8,192 until then, as you have it.akol1 commentedon Nov 6, 2026
@plotarmordev, two checkpoint-format clarifications for the independent fallback: does
drama_expertsmean masking removed router logits before top-k (then renormalizing kept selections), or selecting from all original experts and dropping removed outputs afterward? Also, can you confirm that packed weights use low-nibble-first E2M1, ordinary row-major block-16 E4M3 scales, andweight_scale_2as a direct multiplier? A pinned exporter or conversion test vector would resolve both. We have a bounded CPU decoder and publisher-derived tower prototype with synthetic tests, but neither constitutes checkpoint fidelity. The portable backbone preserves original router IDs; we will not silently choose pruning semantics or treat native behavior as independent ground truth.akol1 commentedon Nov 6, 2026
For #2002, which precision defines independent fidelity: publisher eager FP32 on the pruned weights independently dequantized to FP32, or a BF16/W4A16 reference with the documented pair-weighting/combine contract? Eager MoE casts route weights to BF16 and rounds down output before weighting; the documented NVFP4 path retains FP32 down/route values until BF16(weight×down). CPU and CUDA fused GDN/activation boundaries also differ. Our genuine publisher-built “Hi.” FP32-reference check fails 15/1,253 rows at unchanged cosine 0.999; all 966 isolated backbone rows pass. We retain the failure and have not changed kernels or tolerances. Please confirm the pinned reference backend, activation/accumulation boundaries, and full-history hidden/logit or pick-margin criteria. Experimental BF16 shadows are diagnostics only, not qualification.