Production reproduction repository for pretrained-code HLS latency prediction
and synthesis-free design-space exploration. The maintained implementation is
under predictor/; data/ is read-only input and model weights are not stored
in Git.
- Known-workload DSE: validation-locked 12-expert ensemble,
log_mae=0.1826, raw MAE about252kcycles, pairwise accuracy0.8913, NDCG@30.9771. - Strict unseen-workload transfer: CodeT5-LoRA checkpoint,
validation
log_mae=0.6330and testlog_mae=1.9629. - CHiRM/GNN-DSE/HARP-style synthesis-free loop: 75,000 2mm candidates in 145.38 s on the tested GPU; no HLS synthesis is invoked.
The DSE numbers are known-workload interpolation results and must not be used as strict unseen-workload claims.
git clone git@github.com:2021270902001sc/HLS_demo_code.git
cd HLS_demo_code
python -m pip install -r requirements.txt
./download_code.sh
python prepare_data.py --data data --output artifacts/manifest.jsonlTrain the production DSE components:
python train.py --config configs/qwen3_embedding_dse_signals.json \
--data data --output artifacts/qwen3_embedding_dse_signals \
--epochs 6 --batch-size 16 --device cuda:0
python scripts/train_static_expert.py --data data \
--output artifacts/static_mlp_dse --strategy within_workload --device cuda:0
python scripts/train_static_expert.py --data data \
--output artifacts/group_residual_mlp_dse --strategy within_workload \
--split-seed 20260805 --seed 62 --group-feature group_id \
--group-target residual --hidden-dim 512 --learning-rate 0.001 \
--loss smooth --smooth-beta 0.1 --device cuda:0
python scripts/train_knn_expert.py --data data \
--output artifacts/knn_static_dse --split-seed 20260805 --metric l1 --k 1
python scripts/train_meta_expert.py --data data \
--qwen-train-predictions artifacts/qwen3_embedding_dse_signals/train_predictions.json \
--qwen-validation-predictions artifacts/qwen3_embedding_dse_signals/validation_predictions.json \
--qwen-test-predictions artifacts/qwen3_embedding_dse_signals/test_predictions.json \
--qwen-checkpoint artifacts/qwen3_embedding_dse_signals/checkpoints/best \
--output artifacts/meta_static_dse --device cuda:0Run the complete predictor-only DSE loop:
python scripts/run_chirm_dse.py --mode Exhaustive \
--point-limit 75000 --batch-size 64 --group-id 2mm:v20 \
--device cuda:0 \
--model static=artifacts/static_mlp_dse/checkpoints/best \
--model residual=artifacts/group_residual_mlp_dse/checkpoints/best \
--model knn=artifacts/knn_static_dse/checkpoints/best--offline-data data/designs/v20/2mm.json is optional and is used only for
post-hoc overlap checks; labels are never model inputs. The loop uses the
local design-space definition at configs/chirm/2mm_ds_config.json and never
calls transform, HLS, bitgen, or another synthesis command.
predictor/: maintained data, model, training, evaluation, calibration and DSE implementation.configs/: production training and DSE configurations.scripts/run_chirm_dse.py: complete dependency-aware, batch, cached DSE.data/anddemo_data/: supplied input datasets; never rewritten by tools.tests/: regression tests (python -m pytest -q).models/,encoder_codet5/,artifacts/andreports/: local-only files; weights and generated runs are intentionally excluded from Git.
For exact historical research notes and intermediate experiments, use the
separate private repository HLS_demo_code_private.