Datasets:
Release in rtl-qwen-sft format: data/ (train 96,525 / val 1,078 / test 1,037, messages), bench/ held-out golden-trace benchmark, manifest, new card
Browse filesFiles changed (8)
- .gitattributes+3
- README.md+94-70
- bench/python_bench.test.jsonlAdded+3
- bench/python_bench.validation.jsonlAdded+3
- data/python.test.jsonlAdded
- data/python.train.jsonlAdded+3
- data/python.validation.jsonlAdded
- release_manifest.jsonAdded+88
59 unmodified lines60616263646559 unmodified lines*.webm filter=lfs diff=lfs merge=lfs -textpython_sft.train.jsonl filter=lfs diff=lfs merge=lfs -textlegacy/codev_r1_sft_skeleton_v12_with_think.jsonl filter=lfs diff=lfs merge=lfs -textdata/python.train.jsonl filter=lfs diff=lfs merge=lfs -textbench/python_bench.validation.jsonl filter=lfs diff=lfs merge=lfs -textbench/python_bench.test.jsonl filter=lfs diff=lfs merge=lfs -text7 unmodified lines89101111121314151617181920212223242526272813141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808129303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041057 unmodified lines- verilog- python- rtl- hardwarepretty_name: RTL Verilog -> Python reference-model SFT (interim)pretty_name: RTL Verilog -> Python reference-model SFTconfigs:- config_name: default data_files: - split: train path: data/python.train.jsonl - split: validation path: data/python.validation.jsonl - split: test path: data/python.test.jsonl- config_name: bench data_files: - split: validation path: bench/python_bench.validation.jsonl - split: test path: bench/python_bench.test.jsonl---# RTL Verilog -> Python reference-model SFT (interim, 8,995 rows)
Format identical to `codev-r1-sft-v32`: ShareGPT `conversations` [system, user, assistant]; the user turn is the spec plus`Complete this skeleton:` plus a Python skeleton plus `Answer:`; the assistant turn is `<think>` then `<answer>```python```</answer>`.Each row also has a `provenance` field.
**Source.** Prompts come from the v062 code view of `yil384/rtl-verilog-sft` (Verilog wording rewritten to Python). Answers are existing answers for thesame prompt: 4,699 from the V32 set and 4,296 from the older `v12` skeleton set (IR-transpiler-style and LLM-written code). Every answer is re-verified against **our** Verilog: iverilog simulates 300 random cycles, one `eval()` = one posedge, resets pulsed, X bits ignored,exact match on every output at every cycle. Rows that fail are dropped.
**This is a partial slice.** 8,995 of the ~100k Verilog rows. The remaining 92,825 rows have a golden trace but no Python answer yet; they will be added after generation and the same verification.Sources: {'codev_r1': 4699}. Combinational rows: 1948, sequential rows: 2751.
Tools: `recovery/python_sft/` in https://github.com/yil384/rtl-qwen-sft.Prompts inherit the licenses of their sources (see the Verilog dataset card).
## Update 2026-12-02: `python_sft.ir.jsonl` (59,453 + 2,801 rows)
`python_sft.ir.jsonl` has 62,254 rows: Verilog -> Python by the AST-level IR transpiler (`verilog_to_python.py`, PyVerilog), kept only if it passes the sameiverilog golden-trace check (300 cycles, exact match, X ignored). Following ChipMATE sec. 2.3 an LLM (Qwen3-Coder-30B-A3B-Instruct) then appended a **post-hoc rationale** to the verified code:it is a plausible explanation written after the fact, not a record of how the converter derived the code. Rationales that mention Verilog or the converter, or call the code redundant/odd, were dropped and regenerated once; rows still without a clean rationale were left out.2,801 of these ids also exist in `python_sft.train.jsonl` (V32 / v12 answers); use the main file's answer for those.
**Known differences from the V32 style (not yet normalized):**- 20,403 of 21,275 sequential skeletons read the clock (`clk = inputs.get('clk', 0)`); V32 never reads clk. Verified rows still pass because the harness does not pass clk.- 50,930 answers contain the converter's `for _iter in range(N)` repeat loop and `_nba_*` temporaries.- 549 rationales say "continuous assignment" (Verilog wording).- `python_sft.train.jsonl` (8,995 rows) is unchanged.
## Update 2026-12-02 (final local build): 95,230 verified rows
`python_sft.train.jsonl` replaced by the merged set (unique ids, V32 skeleton format, every answer passes the iverilog golden trace: 300 cycles,one eval() = one posedge, resets pulsed, X bits ignored, exact match):
| answer origin | rows || --- | ---: || ir_transpile_normalized+posthoc_rationale | 65491 || llm_verilog_hint+posthoc_rationale | 20744 || v32_reuse | 4699 || v12_reuse | 4296 |
Sources: {'codev_r1': 39738, 'vericoder': 32278, 'verimm': 11356, 'verithoughts': 6427, 'verireason_luna': 5431}. Combinational 55995, sequential 39235.
- `ir_transpile_normalized`: AST-level IR transpiler output, normalized to the V32 convention (clock inputs not read, the transpiler's `for _iter in range(2)` settle loop unrolled to one pass, skeleton re-extracted), re-verified after normalization (98.2% of the first batch survived; the rest were dropped).- `llm_verilog_hint`: Qwen3-Coder-30B-A3B-Instruct, shown the reference Verilog, 2 samples, first verified sample kept. Pass rate on the rows the transpiler could not handle: 64.2% (main pool), 44.6% (extra pool).- Rationales (`<think>`) of the IR and LLM rows are **post-hoc**, written by Qwen3-Coder-30B after the code was verified (ChipMATE sec. 2.3); they are not records of how the code was derived. `v32_reuse` / `v12_reuse` rows keep their original rationale.- Rows without a clean rationale after two passes were left out. Rows whose Verilog has inout ports, no outputs, or mostly X outputs (about 1.3k) cannot be checked and are not included.- "Verified" = finite differential simulation against the Verilog, not formal equivalence.
## Update 2026-12-03 (final): 96,543 verified rows
`python_sft.train.jsonl` now has **96,543** rows (previous section said 95,230): a repair round added 1,313.
| answer origin | rows || --- | ---: || ir_transpile_normalized+posthoc_rationale | 65491 || llm_verilog_hint+posthoc_rationale | 20744 || v32_reuse | 4699 || v12_reuse | 4296 || llm_verilog_hint_repair+posthoc_rationale | 1313 |
Combinational 56432, sequential 40111.
- `llm_verilog_hint_repair`: rows the first LLM round (Qwen3-Coder-30B-A3B-Instruct, Verilog shown) failed. The model got its closest previous attempt plus the harness feedback (first mismatching cycle with expected/got bits, off-by-k-cycles diagnosis, or the runtime error), 2 repair samples per row. Repair success rate was only 9.2% (1,321 of 14,576 verified), so the remaining rows are mostly complex sequential designs. Not reaching 100k is a property of this pool and this generator, not a filter.- Everything else is as described in the previous section. The `<think>` of IR / LLM / repair rows is post-hoc.- `legacy/` holds the original 47,205-row v12 file, unverified, as is.# RTL Verilog → Python reference-model SFT
Task: given a hardware problem description and an interface skeleton, write a **cycle-accurate Python model** `class TopModule` with`eval(inputs: dict) -> dict` (one call = one rising edge of every clock; clock inputs are not passed; reset is an ordinary input;outputs are read after the edge). This is the Python agent of ChipMATE-style Verilog/Python cross-verification.
Training and evaluation code, recipe and documentation: [github.com/yil384/rtl-qwen-sft](https://github.com/yil384/rtl-qwen-sft),`docs/PYTHON_SFT.md` (configs `configs/qwen38-27b-python.example.yaml`, `configs/b200-multinode-qwen38-27b-python.example.yaml`).
## Layout
| File | Rows | Use || --- | ---: | --- || `data/python.train.jsonl` | 96,525 | SFT train || `data/python.validation.jsonl` | 1,078 | frozen; `eval_loss` only || `data/python.test.jsonl` | 1,037 | frozen; never trained on || `bench/python_bench.validation.jsonl` | 1,155 problems | benchmark `python-heldout-val` (checkpoint selection) || `bench/python_bench.test.jsonl` | 1,096 problems | benchmark `python-heldout` (report) || `release_manifest.json` | | rows, sha256, sources and answer origins per file |
SFT rows: `{"messages": [system, user, assistant], "provenance": {...}}`. The user turn is the spec, then `Complete this skeleton:`,a Python skeleton and `Answer:`. The assistant turn is `<think>...</think>` followed by `<answer>` with one fenced `python` block.Benchmark rows: `{"problem_id", "messages": [system, user], "golden", "reference_python", "provenance"}`. `golden` is the referenceVerilog's trace: ports, stored stimulus and expected outputs per cycle. `reference_python` is the verified pipeline answer, usedonly for the harness self-check, or null.
## How the answers were made and checked
Every problem's reference Verilog (from `yil384/rtl-verilog-sft` v062 code view) is simulated with yosys + Icarus Verilog for 300cycles of fixed random stimulus. The seed is 0. Each input is all-zeros 10% of the time, all-ones 10%, uniform otherwise. Reset isasserted for the first 3 cycles and then with probability 0.03. Outputs are sampled after each rising edge, and X/Z bits aredon't-care. Problems with less than 50% known output bits are not used. **An answer is kept only if every output matches on everycycle.**
| `provenance.answer_origin` | train rows | how || --- | ---: | --- || `ir_transpile_normalized+posthoc_rationale` | 65,477 | PyVerilog AST transpiler output, normalized to the skeleton convention (clock not read, settle loop unrolled), re-verified || `llm_verilog_hint+posthoc_rationale` | 20,744 | Qwen3-Coder-30B-A3B-Instruct, shown the reference Verilog; first verified sample || `llm_verilog_hint_repair+posthoc_rationale` | 1,313 | one repair round with the harness feedback (first mismatching cycle, expected/got bits, off-by-k-cycles diagnosis) || `v32_reuse` / `v12_reuse` | 4,698 / 4,293 | existing V32 / v12 skeleton-format answers for the same prompt that pass our trace, kept with their original rationale |
Sources (license of each row follows its upstream Verilog source; see the Verilog dataset card): CodeV-R1 40,702, VeriCoder 32,465,VeriMM 11,391, VeriThoughts 6,467, VeriReason-Luna 5,500. Combinational 56,422, sequential 40,103.
## Splits and leakage
- Train, validation and test come from the Verilog v062 `code.train`, `code.validation` and `code.test` splits. 11,304 train rows are CodeV-R1 problems outside the Verilog 100k. They were compared with the held-out problems by id, spec text and reference-Verilog hash.- Removed from train: 5 rows whose spec equals a held-out spec, and 13 rows over 16,384 tokens (Qwen3.8 tokenizer, `qwen3_5` template with thinking). Long rows are dropped, never truncated.- Removed from the held-out side: rows whose answer code is identical to a train answer (validation 158, test 115). Trivial circuits translate to identical Python for different problems. The same problems are also removed from the benchmark files, so no held-out problem has its verified answer verbatim in training. One test row over 16,384 tokens was also dropped.- The benchmark files keep every remaining problem with a usable trace, whether or not a verified answer exists: 1,106 of 1,155 and 1,053 of 1,096 have `reference_python`.- Built for the held-out splits with the same pipeline. Only one GPU was free for that run, so the fallback generator ran with FP8 weights there. Every answer still had to pass the trace.- The training repository's `prepare` accepts the three SFT files with 0 rejected rows. Its checks cover duplicate ids, duplicate dialogues, and cross-split id/group/prompt/response matches.
## Limitations
- **Post-hoc reasoning.** Except for the two `*_reuse` origins, the `<think>` text was written by Qwen3-Coder-30B-A3B-Instruct after the code had passed verification, as in ChipMATE sec. 2.3. It explains a known-correct answer and is not how the answer was derived. Rationales that mention Verilog, the converter or a given solution, or that criticize the code, were filtered.- **Verified ≠ correct.** A pass means agreement with one reference Verilog on one finite 300-cycle trace. That is differential testing, not formal equivalence. Behavior outside the stimulus is unchecked, and the reference itself can be wrong.- IR-derived answers are mechanical in style: two-phase current/next-state temporaries and extra width masks.- Not 100k: about 13k train-pool problems got no verified answer from the available generator.- No model trained on this set has been evaluated yet.
## History
`python_sft.train.jsonl` at the repository root is the earlier 96,543-row train file in ShareGPT `conversations` format. It issuperseded by `data/python.train.jsonl` (same answers, `messages` format, the removals above). `legacy/` holds the original47,205-row v12 skeleton file, **unverified**, as is.123version https://git-lfs.github.com/spec/v1oid sha256:8f28c883899ce039ac9994daf21ba205e4d1c75bc76881ec100805ba9e5f8e25size 33987542123version https://git-lfs.github.com/spec/v1oid sha256:c7f40fdf4d19087182a832bd1429cba68e4afcd7b5fcbe8b405058e5b9e781d2size 35193547123version https://git-lfs.github.com/spec/v1oid sha256:f1c7ca6dc9ce83b99e6cf533acea8900f6ac3421bed50a256ddfc7cfa72cb7e8size 73282350512345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788{ "dataset": "yil384/rtl-python-sft", "format": "messages (system, user, assistant); provenance per row", "verilog_source": "/nvme2n1/yichen/rtl_handoff_work/release/v062-interim-100k (code.{train,validation,test})", "harness": "iverilog golden trace, 300 cycles, seed 0, X/Z = don't care; Python vs Verilog differential test", "files": { "python.test.jsonl": { "rows": 1037, "sha256": "78f40d13f7e8964bd9e1d908bed973da200740d58ce86e61c5915da16fcbf5f3", "bytes": 6700702, "source": { "vericoder": 600, "verimm": 185, "verireason_luna": 106, "verithoughts": 87, "codev_r1": 59 }, "answer_origin": { "ir_transpile_normalized+posthoc_rationale": 832, "llm_verilog_hint+posthoc_rationale": 205 }, "comb": 778 }, "python.train.jsonl": { "rows": 96525, "sha256": "f1c7ca6dc9ce83b99e6cf533acea8900f6ac3421bed50a256ddfc7cfa72cb7e8", "bytes": 732823505, "source": { "codev_r1": 40702, "vericoder": 32465, "verimm": 11391, "verithoughts": 6467, "verireason_luna": 5500 }, "answer_origin": { "ir_transpile_normalized+posthoc_rationale": 65477, "llm_verilog_hint+posthoc_rationale": 20744, "v32_reuse": 4698, "v12_reuse": 4293, "llm_verilog_hint_repair+posthoc_rationale": 1313 }, "comb": 56422 }, "python.validation.jsonl": { "rows": 1078, "sha256": "42f79ede3b124777b81220de4a4ccc66c2919be5f7acb59c0a883613fa4f79d0", "bytes": 6935228, "source": { "vericoder": 611, "verimm": 219, "verireason_luna": 108, "verithoughts": 87, "codev_r1": 53 }, "answer_origin": { "ir_transpile_normalized+posthoc_rationale": 850, "llm_verilog_hint+posthoc_rationale": 228 }, "comb": 838 }, "python_bench.test.jsonl": { "rows": 1096, "sha256": "8f28c883899ce039ac9994daf21ba205e4d1c75bc76881ec100805ba9e5f8e25", "bytes": 33987542, "source": { "vericoder": 624, "verimm": 190, "verireason_luna": 127, "verithoughts": 89, "codev_r1": 66 }, "with_reference_python": 1053 }, "python_bench.validation.jsonl": { "rows": 1155, "sha256": "c7f40fdf4d19087182a832bd1429cba68e4afcd7b5fcbe8b405058e5b9e781d2", "bytes": 35193547, "source": { "vericoder": 641, "verimm": 233, "verireason_luna": 128, "verithoughts": 94, "codev_r1": 59 }, "with_reference_python": 1106 } }}.gitattributes+3
README.md+94-70
bench/python_bench.test.jsonlAdded+3
bench/python_bench.validation.jsonlAdded+3
data/python.test.jsonlAdded
data/python.train.jsonlAdded+3
data/python.validation.jsonlAdded
release_manifest.jsonAdded+88