prism-v6: dspark Path A, converge on upstream dflash with log-SNR conditioning and drafter-own embeddings - #114
Open
bri-prism wants to merge 1 commit into
Open
prism-v6: dspark Path A, converge on upstream dflash with log-SNR conditioning and drafter-own embeddings#114bri-prism wants to merge 1 commit into
bri-prism wants to merge 1 commit into
Conversation
khosravipasha
force-pushed
the
prism-v6-dspark-dflash
branch
from
August 11, 2026 01:39
0d0265c to
ab81cb6
Compare
bri-prism
marked this pull request as ready for review
August 11, 2026 03:35
Two drafter-side deltas our fork's standalone dspark arch carried, re-applied
on the upstream dflash implementation (Path A of the dspark re-port):
1. GIDD log-SNR conditioning (LogSnrEmbed): some GIDD-trained drafters ship a
log_snr_embed module, a sinusoidal featurization of a per-position log-SNR
value through a 2-layer SiLU MLP, added to the draft noise embedding before
the backbone. Anchor position of each block at max_log_snr, masked
positions at min_log_snr; the feature matrix is a pure function of
quantities known at graph-build time, so it is precomputed host-side and
staged through a new llm_graph_input_dspark_logsnr input.
New optional metadata: dflash.log_snr_conditioning (bool) plus
dflash.min_log_snr/max_log_snr (required, validated finite and max > min
once the flag is set); new tensors log_snr_fc1/fc2.{weight,bias}, REQUIRED
when the flag is set so a broken conversion fails loudly instead of
silently running unconditioned.
2. Optional drafter-own token_embd/output: loaded as TENSOR_NOT_REQUIRED; the
decoder graph already prefers model-own tensors and only borrows the
target's via ctx_other when absent. Carrying the drafter's own full-precision
embeddings/head protects accept rate when the target is heavily quantized,
and makes the drafter loadable without ctx_other during memory fitting.
Drafters without either feature convert and load exactly as before.
bri-prism
force-pushed
the
prism-v6-dspark-dflash
branch
from
August 11, 2026 04:06
ab81cb6 to
2746240
Compare
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.
What
Path A of the dspark re-port: instead of re-porting our standalone
dsparkarch, converge on upstream's merged dflash implementation and re-apply the two drafter-side deltas it lacks.max_log_snr, masked positions atmin_log_snr). The feature matrix is a pure function of quantities known at graph-build time, so it is precomputed host-side and staged through a newllm_graph_input_dspark_logsnrinput. New optional metadatadflash.log_snr_conditioningplusdflash.min_log_snr/max_log_snr(required and validated once the flag is set); new tensorslog_snr_fc1/fc2.{weight,bias}, required when the flag is set so a broken conversion fails loudly instead of silently running unconditioned.token_embd/output. Loaded asTENSOR_NOT_REQUIRED; the decoder graph already prefers model-own tensors and only borrows the target's viactx_otherwhen absent. Carrying the drafter's own full-precision embeddings and head protects accept rate when the target is heavily quantized, and lets such drafters initialize withoutctx_otherduring memory fitting.Drafters without either feature convert and load exactly as before.
Why
Keeping a standalone arch means carrying a parallel implementation of the same math forever. Upstream's dflash is in-graph, multi-seq, and block-size-sweepable; measured head-to-heads showed our accept advantage came from these two drafter-side deltas, not the algorithm, so this re-applies just the deltas.
How verified
llama-speculative-simple --spec-type draft-dsparkrun on Metal: graph builds, spec loop executes, coherent outputllama-speculative-simple: it never sets ctx_other on the draft context, so embd-less drafters segfault and embd-carrying drafters silently draft without target features (2-6% accept). Use llama-server or the framework path. Details on the fork status board.Rebased onto prism-v6 tip. Remaining follow-ups tracked on the status board: gguf-py/HF-converter mapping for fresh checkpoints, window-fix fold-in, CUDA speedup numbers.