CANN/mat-chem-sim-pred SOPDT批处理滚动评分
PidSopdtBatchRolloutScore【免费下载链接】mat-chem-sim-pred面向工业领域聚焦计算仿真、预测两大核心场景构建面向流程工业机理数据双轮驱动的领域计算层推动AI for Science在材料化学领域的深度应用。项目地址: https://gitcode.com/cann/mat-chem-sim-predOverviewPidSopdtBatchRolloutScoreis an independent SOPDT batch closed-loop rollout operator for PID candidate scoring. It evaluates a batch of SOPDT process models against a shared PID candidate set on NPU and returns the best candidate per loop.This operator is used in the tuning stage as the SOPDT candidate simulation and selection kernel:input is process model parameters plus PID candidate arraysoutput is per-loop best score and best PID gainsimplementation is independent from the earlier model-fit operatorsThe plant dynamics are a second-order process plus dead time:y[k1] a1 * y[k] a2 * y[k-1] b * u[k - delay]Versus the FOPDT rollout this adds one history statey[k-1]and one coefficient (a1,a2instead of a singlea). The PID control law, scoring, candidate-axis SIMD, delay ring and tiling are identical toPidFopdtBatchRolloutScore.工程语义SOPDT rollout 与 FOPDT/IPDT rollout 的候选评估框架相同输入已辨识出的模型参数和一批 PID 候选kernel 内部闭环递推累计IAE/ISE/overshoot/settling_time/control_energy计算固定 score 并选出每条回路的最优候选。区别在被控对象动态。SOPDT 多了一个历史输出状态y[k1] a1 * y[k] a2 * y[k-1] b * u[k - delay]它能表达二阶惯性、较慢过渡和更复杂的动态形态。相比 FOPDTSOPDT 需要输入a1/a2/b/delay并在 kernel 中维护y[k]与y[k-1]两个输出历史。PID 候选不由本算子生成本算子只接收kp[M]、ki[M]、kd[M]并评估。候选可以来自整定规则、规则附近扰动、人工网格或外部优化器。当前 batch rollout 已经融合了候选特征、候选评分和候选选优如果使用本算子直接输出best_result/best_idx通常不需要再接独立候选评分/选优算子。pid_step_response_features仅用于需要保留完整候选轨迹特征表的另一条模块化链路。Current status:correctness is validated against the in-process CPU reference (thebenchmarkprogram), max quality rel-err 1e-3the rollout is a serial time recurrence; the candidate axis is evaluated with a wide vector SIMD lane (kLane768) so the inner loop is throughput-bound rather than latency-boundSee benchmark report for the measured results.Inputs And OutputsTensorDtypeShapeMeaninga1float32[B]first output-history coefficient (y[k]term)a2float32[B]second output-history coefficient (y[k-1]term)bfloat32[B]input gain term (u[k-delay]term)delayint32[B]input delay, clamped to0..31in kernely0float32[B]initial outputspfloat32[B]setpointkpfloat32[M]PID candidate Kpkifloat32[M]PID candidate Kikdfloat32[M]PID candidate Kdbest_resultfloat32[B, 8]best candidate metrics per loopbest_idxint32[B]best candidate index per loopbest_resultlayout:best_score,best_kp,best_ki,best_kd,best_iae,best_ise,best_overshoot,best_settling_timeBuildcd prediction/ProcessControl/PIDModelFit/pid_sopdt_batch_rollout_score cmake -S . -B build -DCMAKE_BUILD_TYPERelease -DSOC_VERSIONAscend910B3 cmake --build build -j$(nproc)Note:this project now defaults toReleaseifCMAKE_BUILD_TYPEis not specifiedonnode202, runtime typically needs:export LD_LIBRARY_PATH/usr/local/Ascend/ascend-toolkit/latest/lib64:$PWD/build:$PWD/build/lib:${LD_LIBRARY_PATH}TestPython reference test:python tests/test_pid_sopdt_batch_rollout_score.pyNPU smoke:./build/test_aclnn_pid_sopdt_batch_rollout_score 0NPU / CPU benchmark:./build/benchmark_pid_sopdt_batch_rollout_score 0 64 1024 1024 0 2 0 64 # candidate_tile0 auto (min(C, kLane768))DocumentsAlgorithmAPI ReferenceBenchmark Report【免费下载链接】mat-chem-sim-pred面向工业领域聚焦计算仿真、预测两大核心场景构建面向流程工业机理数据双轮驱动的领域计算层推动AI for Science在材料化学领域的深度应用。项目地址: https://gitcode.com/cann/mat-chem-sim-pred创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考