cec7d6b648
New byte-level GBNF-subset engine (c/grammar.h: parser + set-of-stacks PDA
walker) wired into spec_decode as a third draft source ("metodo F"), tried
before MTP/n-gram. Wherever the grammar admits exactly one legal byte, the
forced span is tokenized and injected as drafts; the existing batch-union
verification confirms them, so a wrong or out-of-sync grammar can never
change the output. Lazy arming skips preambles; adaptive guard (same
pattern as MTP) disables the source below 50% acceptance; grammar-accepted
tokens no longer pollute the MTP acceptance counter.
GRAMMAR=file.gbnf enables it in run and serve modes (also with DRAFT=0 and
with the int4 MTP head from #8); GRAMMAR_DRAFT=n caps the span (default 24).
Measured on M3 Max / int8-MTP container, greedy, MTP=0 DRAFT=0, NDJSON
classification: 0.37 -> 0.50 tok/s (1.60 tok/forward, 81 fw per 130 tok),
100% acceptance (48/48), output byte-identical to baseline.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
45 lines
751 B
Plaintext
45 lines
751 B
Plaintext
# ambienti python / cache
|
|
c/mio_env/
|
|
__pycache__/
|
|
**/__pycache__/
|
|
*.pyc
|
|
web/node_modules/
|
|
web/dist/
|
|
web/*.tsbuildinfo
|
|
|
|
# binari compilati (si rigenerano con make / coli build)
|
|
c/glm
|
|
c/olmoe
|
|
c/iobench
|
|
c/tok_test
|
|
c/backend_cuda.o
|
|
c/backend_cuda_test
|
|
c/tests/test_json
|
|
c/tests/test_st
|
|
c/tests/test_tier
|
|
c/tests/test_grammar
|
|
|
|
# oracoli tiny generati (make_glm_oracle.py) e dati benchmark scaricati
|
|
c/glm_tiny/
|
|
c/glm_tiny_i2/
|
|
c/glm_tiny_i4/
|
|
c/glm_tiny_mix/
|
|
c/glm_bench_medium/
|
|
c/bench/
|
|
|
|
# pesi modello / artefatti di run
|
|
*.safetensors
|
|
stats*.txt
|
|
*.log
|
|
|
|
# script di ricerca stadio-0 (esperimenti locali, non parte del motore)
|
|
/engine.py
|
|
/run.py
|
|
/validate_ref.py
|
|
/s0_costmodel.py
|
|
/s1_trace_hitrate.py
|
|
/s2_research.py
|
|
/quant_test.py
|
|
/profile_run.py
|
|
/sweep.py
|