Repository navigation
2.0.0
TAAC 2026 2.0 重构更新日志
PR: #84
分支: refactor-2-0 -> main
规模: 294 个文件变更,约 +60,714 / -15,653 行
状态: PR 已打开,当前可合并。CI、文档构建、覆盖率和 CodeQL 检查均已通过。
总体更新
TAAC 2026 代码仓库完成 2.0 工程结构重构。仓库从旧的 config/* 实验目录布局,升级为 experiments/* + src/taac2026 的共享运行时架构。
新结构将实验实现、训练流程、评估推理、线上打包、数据管道、checkpoint sidecar、性能 benchmark、文档和测试体系重新对齐。实验包保持轻量,公共能力集中到 src/taac2026 框架层维护。
工程结构调整
新增并强化以下核心分层:
experiments/: 实验包目录,负责模型、默认配置和实验私有逻辑。src/taac2026/domain: 配置、schema、model contract、sidecar、request 和 metrics 契约。src/taac2026/application: 训练、评估、推理、打包、benchmark 和 bootstrap 用例流程。src/taac2026/infrastructure: 数据管道、运行时、加速算子、bundle、建模原语、优化器、平台适配和日志能力。
新增 taac2026.api 作为实验包稳定 public facade。实验包优先从该入口导入共享配置、模型输入契约、建模 primitive、runtime 配置和实验工厂函数。
实验包更新
实验包入口从 config/* 迁移到 experiments/*。
当前维护的实验包包括:
experiments/baselineexperiments/baseline_plusexperiments/interformerexperiments/onetransexperiments/symbiosisexperiments/unitokexperiments/host_device_infoexperiments/online_dataset_eda
清理了旧的 ctr_baseline、deepcontextnet、hyformer、unirec、uniscaleformer 实验包及对应文档入口。
新增 baseline_plus 实验包。该实验包接入共享建模 primitive、数据缓存、数据增强、TileLang RMSNorm / FlashAttention 后端和优化器默认配置。
新增 unitok 实验包。该实验包用于统一 token-stream 建模探索,将 field-level token、dense packet、行为事件和候选 token 放入同一 backbone。
训练、评估和推理入口更新
run.sh 已重构为本地运行和线上训练 bundle 共用入口。
当前支持命令:
bash run.sh train --experiment experiments/baseline
bash run.sh val --experiment experiments/baseline --run-dir outputs/readme_baseline
bash run.sh infer --experiment experiments/baseline \
--checkpoint outputs/readme_baseline/best_model/model.safetensors \
--result-dir outputs/readme_infer训练 CLI 现在要求显式传入 --experiment。本地 PCVR smoke 默认使用 Hugging Face demo parquet 和仓库 schema。线上 bundle 继续使用平台环境变量注入真实数据路径。
run.sh package 和 run.sh package-infer 已移除。线上打包入口统一为专用 console scripts。
线上 Bundle 更新
新增统一打包入口:
uv run taac-package-train --experiment experiments/baseline \
--output-dir outputs/bundles/baseline_training
uv run taac-package-infer --experiment experiments/baseline \
--output-dir outputs/bundles/baseline_inference训练 bundle 顶层输出:
run.sh
code_package.zip
推理 bundle 顶层输出:
infer.py
code_package.zip
bundle manifest 契约已收紧:
- 训练 manifest:
.taac_training_manifest.json - 推理 manifest:
.taac_inference_manifest.json - manifest 使用
bundle_kind、bundle_format和bundle_format_version做版本校验 bundled_experiment_path必须指向experiments/...- zip 内容聚焦
src/taac2026、当前实验包、pyproject.toml和 manifest
Checkpoint 与 Sidecar 更新
PCVR checkpoint sidecar 已版本化。训练产物继续围绕 checkpoint 目录组织:
model.safetensors
schema.json
train_config.json
train_config.json 使用当前版本 sidecar 格式:
taac2026-pcvr-train-config
评估和推理通过 checkpoint 同目录的 schema.json 与 train_config.json 重建模型输入契约、schema、NS 分组和运行时配置。
数据管道与缓存更新
PCVR 数据管道已拆分到 src/taac2026/infrastructure/data/。
新增或重组的能力包括:
- batch 构造
- parquet dataset 读取
- base-batch cache
- sequence crop
- feature mask
- domain dropout
- shuffle / rebatch / prefetch
- sample dataset 自动解析
- observed schema report
缓存策略统一到 native cache_index。当前支持:
lrufifolfurropt
native cache index 支持单进程和多 worker 共享缓存。相关测试覆盖了共享缓存写入、部分覆盖、重复配置、OPT 拒绝候选、缓存重建和统计行为。
数据管道 benchmark 新增 --cache-mode 参数,并补充多轮 passes 统计。
加速算子与建模能力更新
新增 src/taac2026/infrastructure/accelerators/ 分层,按算子族组织加速能力。
新增或扩展的能力包括:
- TileLang FlashAttention
- TileLang RMSNorm
- TileLang embedding bag mean
- gated delta rule kernels
- QLA / FlashQLA 相关 surface
- accelerator tensor validation
- TileLang runtime helper
建模 primitive 已收敛到 src/taac2026/infrastructure/modeling/:
FeatureEmbeddingBankSequenceTokenizerNonSequentialTokenizerDenseTokenProjectorRMSNorm- attention helper
- padding / mask helper
- gradient checkpoint helper
训练配置新增后端选择:
flash_attention_backend: torch | tilelang
rms_norm_backend: torch | tilelang
优化器与训练配置更新
新增 src/taac2026/infrastructure/optimization/ 分层。
当前包含:
- Muon optimizer
- optimizer registry
- learning rate schedules
- optimizer transform helper
文档新增优化器指南、学习率调度指南和梯度检查点指南。各实验默认 max_steps 已统一调整为 100000。
日志与诊断更新
日志系统统一迁移到 loguru。训练、评估、数据加载、checkpoint、实验模型、CLI、打包和 benchmark 输出已统一走共享日志入口。
新增 runtime telemetry 输出:
training_telemetry.json
training_summary.json
evaluation_telemetry.json
inference_telemetry.json
新增 PCVR smoke 诊断面板生成命令:
uv run taac-plot-pcvr-diagnostics诊断图覆盖:
- runtime resources
- prediction distribution
- prediction correlation
- sample disagreement
- stability
online_dataset_eda 同步增强了标签分布、空值率、label lift、类别关联和跨域覆盖统计。
Benchmark 更新
新增 docs/benchmark/ 分区,覆盖:
- cache policies
- RMSNorm
- FlashAttention
- embedding bag mean
- PCVR diagnostics
新增 benchmark CLI:
taac-generate-pcvr-synthetic-dataset
taac-benchmark-pcvr-data-pipeline
taac-benchmark-pcvr-optimizer
taac-benchmark-pcvr-tilelang-ops
taac-plot-pcvr-diagnostics
合成数据集默认规模提升到 300x,并增加最小倍数校验。
测试体系更新
测试目录已按测试层级重组:
tests/unit: 单元测试tests/contract: 实验包和 runtime contract 测试tests/integration: bundle、bootstrap 和跨模块 workflow 测试tests/benchmarks/cpu: CPU-safe benchmark 测试tests/gpu: CUDA / TileLang GPU 测试tests/support: 测试辅助代码
pyproject.toml 新增 pytest markers:
unit
contract
integration
gpu
benchmark_cpu
benchmark_gpu
CI 当前执行 CPU-safe 测试集合:
(unit or contract or integration or benchmark_cpu) and not gpu and not benchmark_gpu
CI 与质量门禁更新
CI 已更新为 Python 3.10、3.11、3.12、3.13 矩阵测试。
当前质量检查包括:
- Ruff 风格检查
- Vulture 死代码检查,当前为 warning-only
- CPU 测试矩阵
- 覆盖率报告
- CodeQL
- 文档严格构建
覆盖率门禁当前为 70%,门禁范围聚焦 domain 与训练应用层关键模块。
文档站更新
文档站结构已重组。
新增分区:
docs/archivedocs/benchmarkdocs/guide
新增或更新的重点页面包括:
- 架构说明
- 快速开始
- 线上训练 bundle
- PCVR 数据管道
- 测试指南
- 性能 benchmark
- cache policies
- gradient checkpointing
- learning rate schedules
- optimizers
- Baseline+
- UniTok
官方训练 baseline、官方推理 baseline 和 schema 快照已归档到 docs/archive/files/。zensical.toml 已同步更新导航。
GitHub Pages workflow 已调整。PR 阶段执行严格构建检查,main 分支部署由 CI 成功状态驱动。
兼容性影响
本次重构包含以下迁移影响:
- 旧路径
config/<name>迁移为experiments/<name>。 - 训练命令需要显式传入
--experiment。 - 本地 PCVR smoke 使用自动 demo 数据解析。
- 旧
run.sh package和run.sh package-infer命令已移除。 - 线上打包入口改为
taac-package-train和taac-package-infer。 - checkpoint 评估和推理依赖新版
schema.json与train_config.jsonsidecar。 - bundle manifest 使用
bundle_kind与 format version 校验。 - 实验包推荐从
taac2026.api导入共享能力。
验证状态
PR 当前检查结果:
代码风格与策略: passCPU 测试 (Python 3.10): passCPU 测试 (Python 3.11): passCPU 测试 (Python 3.12): passCPU 测试 (Python 3.13): pass覆盖率报告: pass文档构建检查: passCodeQL: pass
本次 2.0 更新完成了实验包结构、共享运行时、数据管道、线上 bundle、checkpoint sidecar、性能加速、测试分层和文档体系的统一升级。
What's Changed
- Add observed schema sidecars and separate dev extras by @Puiching-Memory in #79
- Add vulture to dev CI by @Puiching-Memory in #87
- 2.0重构 by @Puiching-Memory in #84
Full Changelog: 1.1.0...2.0.0